Library Functions.
More...
Library Functions.
Initializes a new button to library.
- Note
- This library uses malloc() to allocate memory, so make sure you have enough heap memory
- Parameters
-
| *GPIOx | Pointer to GPIOx where button is located |
| GPIO_Pin | GPIO pin where button is located |
| ButtonState | Button state when it is pressed.
- 0: Button is low when pressed
- > 0: Button is high when pressed
|
| *ButtonHandler | |
- Return values
-
| Button | creation status:
- 0: Button was not created
- > 0: Button created and saved to library, button pointer is returned
|
Sets press timing values.
- Parameters
-
| *ButtonStruct | Pointer to TM_BUTTON_t structure for button used |
| Normal | Time that button must be pressed to indicate normal press. Value is in milliseconds |
| Normal | Time that button must be pressed to indicate long press. Value is in milliseconds |
- Return values
-
| void TM_BUTTON_Update |
( |
void |
| ) |
|
Updates buttons. This function have to be called periodically.
- Note
- Function will automatically call callback functions for buttons
- Parameters
-
- Return values
-