]> begriffs open source - cmsis-driver-bare/blob - inc/debounce.h
Pass cmsis validator test
[cmsis-driver-bare] / inc / debounce.h
1 #ifndef CMSIS_DRIVER_BARE_DEBOUNCE_H
2 #define CMSIS_DRIVER_BARE_DEBOUNCE_H
3
4 #include <stdbool.h>
5 #include <stdint.h>
6
7 typedef struct sample_state
8 {
9         bool candidate;
10         uint32_t count;
11         uint32_t count_reset;
12 } sample_state;
13
14 void debounce_init(sample_state *ss,
15         bool initial, uint32_t threshold);
16 bool *debounce(sample_state *ss, bool val);
17
18 #endif