Firmware SDK
twr_module_encoder.h
1 #ifndef _TWR_MODULE_ENCODER_H
2 #define _TWR_MODULE_ENCODER_H
3 
4 #include <twr_button.h>
5 
9 
11 
12 typedef enum
13 {
16 
19 
22 
25 
28 
31 
32 
34 
36 
37 void twr_module_encoder_init(void);
38 
40 
41 void twr_module_encoder_deinit(void);
42 
46 
47 void twr_module_encoder_set_event_handler(void (*event_handler)(twr_module_encoder_event_t, void *), void *event_param);
48 
51 
53 
56 
58 
60 
62 
64 
65 #endif // _TWR_MODULE_ENCODER_H
int twr_module_encoder_get_increment(void)
Read encoder delta increment (can be positive or negative number)
Event button clicked (pressed and released within certain time)
Event button hold (pressed for longer time)
twr_button_t * twr_module_encoder_get_button_instance(void)
Get encoder button instance.
void twr_module_encoder_init(void)
Initialize Encoder Module.
void twr_module_encoder_set_event_handler(void(*event_handler)(twr_module_encoder_event_t, void *), void *event_param)
Set callback function.
Event error (module is not present)
twr_module_encoder_event_t
Callback events.
bool twr_module_encoder_is_present(void)
Get Encoder Module is pressent, can use without twr_module_encoder_init.
void twr_module_encoder_deinit(void)
Deinitialize Encoder Module.
struct twr_button_t twr_button_t
Button instance.
Definition: twr_button.h:32