Struct SYN_Button¶
Button descriptor — owns the FSM, debounce, multi-click, and callback state.
#include <syn_button.h>
Public Attributes¶
| Type | Name |
|---|---|
| uint8_t | click_count |
| uint32_t | click_tick |
| uint16_t | debounce_ms |
| uint16_t | double_click_ms |
| uint8_t | events |
| SYN_FSM | fsm |
| bool | in_combo |
| uint16_t | long_press_ms |
| SYN_ButtonCallback | on_double_click |
| void * | on_double_click_ctx |
| SYN_ButtonCallback | on_long_press |
| void * | on_long_press_ctx |
| SYN_ButtonCallback | on_multi_click |
| void * | on_multi_click_ctx |
| SYN_ButtonCallback | on_press |
| void * | on_press_ctx |
| SYN_ButtonCallback | on_release |
| void * | on_release_ctx |
| SYN_ButtonCallback | on_repeat |
| void * | on_repeat_ctx |
| SYN_ButtonCallback | on_single_click |
| void * | on_single_click_ctx |
| SYN_ButtonCallback | on_triple_click |
| void * | on_triple_click_ctx |
| SYN_GPIO_Pin | pin |
| uint8_t | polarity |
| bool | pressed |
| bool | raw_pressed |
| uint16_t | repeat_ms |
| uint32_t | repeat_tick |
| uint32_t | state_tick |
Public Attributes Documentation¶
variable click_count¶
Consecutive click counter
variable click_tick¶
Tick of last release event
variable debounce_ms¶
Debounce window (ms)
variable double_click_ms¶
Max gap between clicks (ms, default 250)
variable events¶
Pending events bitmask
variable fsm¶
Button FSM (uses syn_fsm)
variable in_combo¶
True while button is part of active combo
variable long_press_ms¶
Long-press threshold (ms)
variable on_double_click¶
Double-click callback
variable on_double_click_ctx¶
Double-click context
variable on_long_press¶
Long-press callback
variable on_long_press_ctx¶
Long-press context
variable on_multi_click¶
Multi-click callback
variable on_multi_click_ctx¶
Multi-click context
variable on_press¶
Press callback
variable on_press_ctx¶
Press callback context
variable on_release¶
Release callback
variable on_release_ctx¶
Release callback context
variable on_repeat¶
Repeat callback
variable on_repeat_ctx¶
Repeat callback context
variable on_single_click¶
Single-click callback
variable on_single_click_ctx¶
Single-click context
variable on_triple_click¶
Triple-click callback
variable on_triple_click_ctx¶
Triple-click context
variable pin¶
GPIO pin number
variable polarity¶
SYN_ButtonPolarity
variable pressed¶
Debounced pressed state
variable raw_pressed¶
Last raw GPIO reading
variable repeat_ms¶
Auto-repeat interval (ms)
variable repeat_tick¶
Tick of last repeat event
variable state_tick¶
Tick when state was entered
The documentation for this class was generated from the following file src/syntropic/input/syn_button.h