Status word of the push button driver. More...
#include <push_button/drivers/drv_push_button.h>
Data Fields | |
union { | |
volatile uint16_t value | |
Status word. More... | |
}; | |
volatile bool | sw_event:1 |
Bit 0: Event bit indicating a state has changed (cleared automatically) More... | |
volatile | unsigned:1 |
Bit 1: (reserved) More... | |
volatile bool | long_press:1 |
Bit 13: Indicates if switch has been pressed for a longer time. More... | |
volatile bool | pressed:1 |
Bit 14: Indicates if the button is pressed or not. More... | |
volatile bool | enabled:1 |
Bit 15: Enables/disables the Switch button object. More... | |
Data Fields inherited from PUSH_BUTTON_OBJECT_s | |
volatile struct PUSH_BUTTON_STATUS_s | status |
Status word of the switch object. More... | |
volatile uint16_t | debounce_delay |
Number of call cycles until a switch event is triggered. More... | |
volatile uint16_t | long_press_delay |
Number of call cycles until a "long press" switch event is triggered. More... | |
volatile uint16_t(* | event_btn_down )(void) |
Function pointer to user function triggering a PRESSED event. More... | |
volatile uint16_t(* | event_long_press )(void) |
Function pointer to user function triggering a LONG_PRESS event. More... | |
volatile uint16_t(* | event_pressed )(void) |
Function pointer to user function triggering a LONG_PRESS event. More... | |
volatile uint16_t(* | event_btn_up )(void) |
Function pointer to user function triggering a RELEASE event. More... | |
Status word of the push button driver.
The status word of the push button function driver allows asynchronous monitoring of the push button status, encoding the detection of short and long press as well as the immediate switch event.
In addition, an Enable control bit is provided to allow external code modules to turn the monitoring of the push-button input on or off.
Definition at line 70 of file drv_push_button.h.
union { ... } |
volatile bool enabled |
Bit 15: Enables/disables the Switch button object.
Definition at line 89 of file drv_push_button.h.
volatile bool long_press |
Bit 13: Indicates if switch has been pressed for a longer time.
Definition at line 87 of file drv_push_button.h.
volatile bool pressed |
Bit 14: Indicates if the button is pressed or not.
Definition at line 88 of file drv_push_button.h.
volatile bool sw_event |
Bit 0: Event bit indicating a state has changed (cleared automatically)
Definition at line 74 of file drv_push_button.h.
volatile unsigned |
Bit 1: (reserved)
Bit 12: (reserved)
Bit 11: (reserved)
Bit 10: (reserved)
Bit 9: (reserved)
Bit 8: (reserved)
Bit 7: (reserved)
Bit 6: (reserved)
Bit 5: (reserved)
Bit 4: (reserved)
Bit 3: (reserved)
Bit 2: (reserved)
Definition at line 75 of file drv_push_button.h.
volatile uint16_t value |
Status word.
Definition at line 91 of file drv_push_button.h.