Firmware SDK
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
bc_module_encoder

Driver for Encoder Module. More...

Enumerations

enum  bc_module_encoder_event_t {
  BC_MODULE_ENCODER_EVENT_ROTATION = 0,
  BC_MODULE_ENCODER_EVENT_PRESS = 1,
  BC_MODULE_ENCODER_EVENT_RELEASE = 2,
  BC_MODULE_ENCODER_EVENT_CLICK = 3,
  BC_MODULE_ENCODER_EVENT_HOLD = 4,
  BC_MODULE_ENCODER_EVENT_ERROR = 5
}
 Callback events. More...
 

Functions

void bc_module_encoder_init (void)
 Initialize Encoder Module.
 
void bc_module_encoder_deinit (void)
 Deinitialize Encoder Module.
 
void bc_module_encoder_set_event_handler (void(*event_handler)(bc_module_encoder_event_t, void *), void *event_param)
 Set callback function. More...
 
bc_button_tbc_module_encoder_get_button_instance (void)
 Get encoder button instance. More...
 
int bc_module_encoder_get_increment (void)
 Read encoder delta increment (can be positive or negative number) More...
 
bool bc_module_encoder_is_present (void)
 Get Encoder Module is pressent, can use without bc_module_encoder_init.
 

Detailed Description

Driver for Encoder Module.

Enumeration Type Documentation

Callback events.

Enumerator
BC_MODULE_ENCODER_EVENT_ROTATION 

Event rotation.

BC_MODULE_ENCODER_EVENT_PRESS 

Event button pressed.

BC_MODULE_ENCODER_EVENT_RELEASE 

Event button released.

BC_MODULE_ENCODER_EVENT_CLICK 

Event button clicked (pressed and released within certain time)

BC_MODULE_ENCODER_EVENT_HOLD 

Event button hold (pressed for longer time)

BC_MODULE_ENCODER_EVENT_ERROR 

Event error (module is not present)

Definition at line 12 of file bc_module_encoder.h.

Function Documentation

bc_button_t* bc_module_encoder_get_button_instance ( void  )

Get encoder button instance.

Returns
Pointer to button instance

Definition at line 70 of file bc_module_encoder.c.

int bc_module_encoder_get_increment ( void  )

Read encoder delta increment (can be positive or negative number)

Returns
Delta increment

Definition at line 75 of file bc_module_encoder.c.

void bc_module_encoder_set_event_handler ( void(*)(bc_module_encoder_event_t, void *)  event_handler,
void *  event_param 
)

Set callback function.

Parameters
[in]event_handlerFunction address
[in]event_paramOptional event parameter (can be NULL)

Definition at line 63 of file bc_module_encoder.c.