8 #ifndef DIGITALTOMESSAGE_H_ 9 #define DIGITALTOMESSAGE_H_ 38 void setCallback(
void (*newCallback)(
bool,
unsigned int,
void*),
void* arg){
40 stateChangedCallback = newCallback;
41 if(newCallback != NULL){
42 callbackEnabled =
true;
44 callbackEnabled =
false;
47 void process(
unsigned int bit, uint32_t* array,
unsigned int length){
48 if(callbackEnabled ==
false){
51 for(
unsigned int n = 0 ; n < length; ++n){
52 bool state = ((array[n]) >> (bit)) & 1;
53 if(state != lastState){
54 stateChangedCallback(state, n, callbackArg);
59 void setDebounceLength(
unsigned int length);
62 unsigned int debounceLength;
65 void (*stateChangedCallback)(bool,
unsigned int,
void*);
Definition: DigitalToMessage.h:35