Driver for an individual GPIO-connected button with debounce and edge-triggered callbacks.
More...
Driver for an individual GPIO-connected button with debounce and edge-triggered callbacks.
◆ ButtonState
Button states representing current input.
Enumerator |
---|
BUTTON_IDLE | Button is not pressed
|
BUTTON_PRESSED | Button is pressed
|
◆ button_init()
Initialize a button instance.
- Parameters
-
button | Pointer to the Button instance to initialize |
config | Pointer to the ButtonConfig structure |
- Returns
- STATUS_CODE_OK if initialized successfully STATUS_CODE_INVALID_ARGS if an invalid parameter is passed in
◆ button_update()
Update the Button state based on the given GPIO state.
- Parameters
-
button | Pointer to the Button instance |
- Returns
- STATUS_CODE_OK if initialized successfully STATUS_CODE_INVALID_ARGS if an invalid parameter is passed in