Appiko
button_ui.h
1 
19 #ifndef CODEBASE_PERIPHERAL_MODULES_BUTTON_UI_H_
20 #define CODEBASE_PERIPHERAL_MODULES_BUTTON_UI_H_
21 
35 #include "stdint.h"
36 #include "stdbool.h"
37 #include "ms_timer.h"
38 
42 typedef enum
43 {
47 
51 typedef enum
52 {
58 
65 const static uint32_t press_duration[] = {
66  MS_TIMER_TICKS_MS(100),
67  MS_TIMER_TICKS_MS(5000),
68  MS_TIMER_TICKS_MS(15000),
69  0xFFFFFFFF
70 };
71 
78 void button_ui_init(uint32_t button_pin, uint32_t irq_priority,
79  void (*button_ui_handler)(button_ui_steps step, button_ui_action act));
85 void button_ui_add_tick(uint32_t ui_ticks);
86 
91 void button_ui_config_wake(bool set_wake_on);
92 
93 #endif /* CODEBASE_PERIPHERAL_MODULES_BUTTON_UI_H_ */
94 
When a button press crosses a particular time.
Definition: button_ui.h:44
For a short button press.
Definition: button_ui.h:54
button_ui_action
Definition: button_ui.h:42
void button_ui_init(uint32_t button_pin, uint32_t irq_priority, void(*button_ui_handler)(button_ui_steps step, button_ui_action act))
Initialize the button ui event generator module.
Definition: button_ui.c:66
For a long button press.
Definition: button_ui.h:55
When a button is released.
Definition: button_ui.h:45
button_ui_steps
Definition: button_ui.h:51
For a short button press.
Definition: button_ui.h:53
#define MS_TIMER_TICKS_MS(ms)
Definition: ms_timer.h:64
void button_ui_config_wake(bool set_wake_on)
To enable/disable the button UI GPIOTE IRQ.
Definition: button_ui.c:128
For the moment a button is pressed.
Definition: button_ui.h:56
void button_ui_add_tick(uint32_t ui_ticks)
The ticks that need to be sent to the button UI module for its processing.
Definition: button_ui.c:86