9 #include "push_button/app_push_button.h" 10 #include "config/hal.h" 40 volatile uint16_t retval = 1;
72 volatile uint16_t retval = 1;
73 static uint16_t press_cnt = 0, release_cnt = 0;
74 static bool pre_pressed =
false, pre_long_press =
false;
94 else if ((!SW_USER_Get()) && (pushbtn->
status.bits.
pressed)) {
113 else if ((SW_USER_Get()) && (pushbtn->
status.bits.
pressed)) {
155 volatile uint16_t retval = 1;
volatile uint16_t long_press_delay
Number of call cycles until a "long press" switch event is triggered.
volatile uint16_t(* event_pressed)(void)
Function pointer to user function triggering a LONG_PRESS event.
volatile uint16_t(* event_long_press)(void)
Function pointer to user function triggering a LONG_PRESS event.
volatile uint16_t debounce_delay
Number of call cycles until a switch event is triggered.
volatile struct PUSH_BUTTON_STATUS_s status
Status word of the switch object.
volatile bool long_press
Bit 13: Indicates if switch has been pressed for a longer time.
volatile bool sw_event
Bit 0: Event bit indicating a state has changed (cleared automatically)
volatile uint16_t(* event_btn_up)(void)
Function pointer to user function triggering a RELEASE event.
volatile bool pressed
Bit 14: Indicates if the button is pressed or not.
volatile bool enabled
Bit 15: Enables/disables the Switch button object.
volatile uint16_t(* event_btn_down)(void)
Function pointer to user function triggering a PRESSED event.