PicoWAN SDK Documentation
button.h
Go to the documentation of this file.
1 
31 #ifndef _BUTTON_H_
32 #define _BUTTON_H_
33 
34 #include <stdint.h>
35 
36 #define MAX_BUTTONS 4
37 
38 enum button_mode {
39  BUTTON_ACTIVE_LOW = 0,
40  BUTTON_ACTIVE_HIGH = 1
41 };
42 
43 enum button_press_duration {
44  BUTTON_SHORT_PRESS = 0,
45  BUTTON_LONG_PRESS = 1
46 };
47 
48 
58 void button_init(void (*cb)(uint8_t num, enum button_press_duration duration));
59 
67 uint8_t button_is_pressed(uint8_t num);
68 
69 #endif /* _BUTTON_H_ */
void button_init(void(*cb)(uint8_t num, enum button_press_duration duration))
Initializes the button driver.
Definition: button.c:80
uint8_t button_is_pressed(uint8_t num)
Checks if a button is currently pressed.
Definition: button.c:98