Debounced switch handling with visual feedback on the OLED.
More...
#include <isf15acp4_button_ui.hpp>
|
| | ButtonUI (uint32_t debounce_ms=25, uint32_t long_press_ms=800) noexcept |
| |
| ButtonEvent | Update (bool pressed, uint32_t elapsed_ms) noexcept |
| | Poll raw pressed state and return edge/event classification.
|
| |
| void | DrawStatus (GraphicsContext &gfx, const char *label, bool active) const noexcept |
| | Draw idle/active visual using graphics context.
|
| |
| uint32_t | PressCount () const noexcept |
| |
| bool | IsDown () const noexcept |
| |
Debounced switch handling with visual feedback on the OLED.
◆ ButtonUI()
| isf15acp4::ButtonUI::ButtonUI |
( |
uint32_t |
debounce_ms = 25, |
|
|
uint32_t |
long_press_ms = 800 |
|
) |
| |
|
inlinenoexcept |
◆ DrawGauge()
Draw a compact gauge arc and numeric value.
◆ DrawStatus()
| void isf15acp4::ButtonUI::DrawStatus |
( |
GraphicsContext & |
gfx, |
|
|
const char * |
label, |
|
|
bool |
active |
|
) |
| const |
|
inlinenoexcept |
Draw idle/active visual using graphics context.
◆ IsDown()
| bool isf15acp4::ButtonUI::IsDown |
( |
| ) |
const |
|
inlinenoexcept |
◆ PressCount()
| uint32_t isf15acp4::ButtonUI::PressCount |
( |
| ) |
const |
|
inlinenoexcept |
◆ Update()
| ButtonEvent isf15acp4::ButtonUI::Update |
( |
bool |
pressed, |
|
|
uint32_t |
elapsed_ms |
|
) |
| |
|
inlinenoexcept |
Poll raw pressed state and return edge/event classification.
- Parameters
-
| pressed | Current momentary switch state. |
| elapsed_ms | Milliseconds since last poll. |
◆ debounce_ms_
| uint32_t isf15acp4::ButtonUI::debounce_ms_ |
|
private |
◆ hold_ms_
| uint32_t isf15acp4::ButtonUI::hold_ms_ {0} |
|
private |
◆ is_down_
| bool isf15acp4::ButtonUI::is_down_ {false} |
|
private |
◆ long_fired_
| bool isf15acp4::ButtonUI::long_fired_ {false} |
|
private |
◆ long_press_ms_
| uint32_t isf15acp4::ButtonUI::long_press_ms_ |
|
private |
◆ press_count_
| uint32_t isf15acp4::ButtonUI::press_count_ {0} |
|
private |
◆ stable_ms_
| uint32_t isf15acp4::ButtonUI::stable_ms_ {0} |
|
private |
The documentation for this class was generated from the following files: