1 #ifndef _TWR_MODULE_ENCODER_H
2 #define _TWR_MODULE_ENCODER_H
4 #include <twr_button.h>
void twr_module_encoder_set_event_handler(void(*event_handler)(twr_module_encoder_event_t, void *), void *event_param)
Set callback function.
bool twr_module_encoder_is_present(void)
Get Encoder Module is pressent, can use without twr_module_encoder_init.
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_deinit(void)
Deinitialize Encoder Module.
int twr_module_encoder_get_increment(void)
Read encoder delta increment (can be positive or negative number)
twr_module_encoder_event_t
Callback events.
@ TWR_MODULE_ENCODER_EVENT_CLICK
Event button clicked (pressed and released within certain time)
@ TWR_MODULE_ENCODER_EVENT_PRESS
Event button pressed.
@ TWR_MODULE_ENCODER_EVENT_HOLD
Event button hold (pressed for longer time)
@ TWR_MODULE_ENCODER_EVENT_ERROR
Event error (module is not present)
@ TWR_MODULE_ENCODER_EVENT_ROTATION
Event rotation.
@ TWR_MODULE_ENCODER_EVENT_RELEASE
Event button released.