31 #define TM_BUTTON_H 100
69 #include "stm32f4xx.h"
71 #include "tm_stm32f4_gpio.h"
72 #include "tm_stm32f4_delay.h"
82 #ifndef BUTTON_MAX_BUTTONS
83 #define BUTTON_MAX_BUTTONS 10
87 #ifndef BUTTON_NORMAL_PRESS_TIME
88 #define BUTTON_NORMAL_PRESS_TIME 100
92 #ifndef BUTTON_LONG_PRESS_TIME
93 #define BUTTON_LONG_PRESS_TIME 1500
GPIO_TypeDef * GPIOx
Definition: tm_stm32f4_button.h:119
struct _TM_BUTTON_t TM_BUTTON_t
Button private structure.
void(* ButtonHandler)(TM_BUTTON_PressType_t)
Definition: tm_stm32f4_button.h:122
uint16_t PressNormalTime
Definition: tm_stm32f4_button.h:126
TM_BUTTON_t * TM_BUTTON_SetPressTime(TM_BUTTON_t *ButtonStruct, uint16_t Normal, uint16_t Long)
Sets press timing values.
TM_BUTTON_PressType_t
Button possible press types.
Definition: tm_stm32f4_button.h:109
void TM_BUTTON_Update(void)
Updates buttons. This function have to be called periodically.
uint8_t GPIO_State
Definition: tm_stm32f4_button.h:121
uint16_t GPIO_Pin
Definition: tm_stm32f4_button.h:120
Definition: tm_stm32f4_button.h:112
uint8_t LastStatus
Definition: tm_stm32f4_button.h:124
uint32_t StartTime
Definition: tm_stm32f4_button.h:123
uint8_t State
Definition: tm_stm32f4_button.h:125
Definition: tm_stm32f4_button.h:110
uint16_t PressLongTime
Definition: tm_stm32f4_button.h:127
Button private structure.
Definition: tm_stm32f4_button.h:118
Definition: tm_stm32f4_button.h:111
TM_BUTTON_t * TM_BUTTON_Init(GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin, uint8_t ButtonState, void(*ButtonHandler)(TM_BUTTON_PressType_t))
Initializes a new button to library.