31 #ifndef SWITCH_BUTTON_DRIVER_H 32 #define SWITCH_BUTTON_DRIVER_H 49 typedef enum SWITCH_STATUS_FLAGS_e{
50 SWITCH_STAT_PRESSED = 0b1100000000000001,
51 SWITCH_STAT_LONG_PRESS = 0b1110000000000001,
52 SWITCH_STAT_RELEASED = 0b1000000000000001
53 } SWITCH_STATUS_FLAGS_t;
90 }__attribute__((packed)) bits;
122 extern volatile uint16_t drv_PushButton_Initialize(
volatile struct PUSH_BUTTON_OBJECT_s* pushbtn);
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 unsigned
Bit 1: (reserved)
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 uint16_t value
Status word.
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.