This module handles the definition, initilization and key bounce for key presses. To use this module, call Board_Key_initialize() with a callback function as the parameter, then when a key or keys are pressed, the callback function will be called (after a debounce period). Single or multiple key presses are detected and passed to the callback function.
§ KEY_DEBOUNCE_TIMEOUT
| #define KEY_DEBOUNCE_TIMEOUT 200 |
Debounce timeout in milliseconds
§ KEY_DOWN
§ KEY_LEFT
§ KEY_RIGHT
§ KEY_SELECT
§ KEY_UP
§ Board_Key_keysPressedCB_t
| typedef void(* Board_Key_keysPressedCB_t) (uint8_t keysPressed) |
Key Press Callback function typedef
§ board_key_getValues()
| uint8_t board_key_getValues |
( |
void |
| ) |
|
Get the current value for all the keys.
- Returns
- bit mapped representation of all keys
§ Board_Key_initialize()
Enable interrupts for keys on GPIOs.
- Parameters
-
| appKeyCB | - application key pressed callback |
- Returns
- current state of all keys, check for bit masked KEY_SELECT, KEY_UP, etc.