Wirepas SDK
|
Board-independent button functions. More...
Board-independent button functions.
Definition in file button.h.
Go to the source code of this file.
Typedefs | |
typedef void(* | on_button_event_cb) (uint8_t button_id, button_event_e event) |
Callback structure for a button event. More... | |
Functions | |
void | Button_init (void) |
Initialize Button module. More... | |
button_res_e | Button_register_for_event (uint8_t button_id, button_event_e event, on_button_event_cb cb) |
Register for a button event. More... | |
button_res_e | Button_getState (uint8_t button_id, bool *state_p) |
Get State of a given button. More... | |
uint8_t | Button_get_number (void) |
Get number of buttons. More... | |
Enumerations | |
enum | button_event_e { BUTTON_PRESSED, BUTTON_RELEASED } |
Different events for a button. More... | |
enum | button_res_e { BUTTON_RES_OK = 0, BUTTON_RES_INVALID_ID = 1 } |
List of return code. More... | |
typedef void(* on_button_event_cb) (uint8_t button_id, button_event_e event) |
uint8_t Button_get_number | ( | void | ) |
Get number of buttons.
button_res_e Button_getState | ( | uint8_t | button_id, |
bool * | state_p | ||
) |
Get State of a given button.
button_id | Id of the button |
state_p | state of the button, true for pressed Valid only if return code is BUTTON_RES_OK |
void Button_init | ( | void | ) |
Initialize Button module.
button_res_e Button_register_for_event | ( | uint8_t | button_id, |
button_event_e | event, | ||
on_button_event_cb | cb | ||
) |
Register for a button event.
button_id | Id of the button |
event | Event to monitor |
cb | Callback to call when event happen |
enum button_event_e |
enum button_res_e |