Appiko
Enumerations | Functions
Button UI event generator

Driver for the generating all the button related UI events for the application. More...

Enumerations

enum  button_ui_action { BUTTON_UI_ACT_CROSS, BUTTON_UI_ACT_RELEASE }
 
enum  button_ui_steps { BUTTON_UI_STEP_QUICK, BUTTON_UI_STEP_SHORT, BUTTON_UI_STEP_LONG, BUTTON_UI_STEP_WAKE }
 

Functions

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. More...
 
void button_ui_add_tick (uint32_t ui_ticks)
 The ticks that need to be sent to the button UI module for its processing. More...
 
void button_ui_config_wake (bool set_wake_on)
 To enable/disable the button UI GPIOTE IRQ. More...
 

Detailed Description

Enumeration Type Documentation

◆ button_ui_action

Enum defining the type of actions possible with buttons

Enumerator
BUTTON_UI_ACT_CROSS 

When a button press crosses a particular time.

BUTTON_UI_ACT_RELEASE 

When a button is released.

Definition at line 42 of file button_ui.h.

◆ button_ui_steps

Enum to define the different kinds of button presses

Enumerator
BUTTON_UI_STEP_QUICK 

For a short button press.

BUTTON_UI_STEP_SHORT 

For a short button press.

BUTTON_UI_STEP_LONG 

For a long button press.

BUTTON_UI_STEP_WAKE 

For the moment a button is pressed.

Definition at line 51 of file button_ui.h.

Function Documentation

◆ button_ui_add_tick()

void button_ui_add_tick ( uint32_t  ui_ticks)
Parameters
ui_ticksUI ticks generated by next interval handler

Definition at line 86 of file button_ui.c.

Referenced by next_interval_handler().

◆ button_ui_config_wake()

void button_ui_config_wake ( bool  set_wake_on)
Parameters
set_wake_onSet to true to enable and false to disable

Definition at line 128 of file button_ui.c.

Referenced by button_handler().

◆ button_ui_init()

void button_ui_init ( uint32_t  button_pin,
uint32_t  irq_priority,
void(*)(button_ui_steps step, button_ui_action act)  button_ui_handler 
)
Parameters
button_pinButton Pin number to monitor
irq_priorityIRQ priority of the GPIOTE irq used
button_ui_handlerHandler to be called for all the button events

Definition at line 66 of file button_ui.c.