|
Sound Byte Libs 29c5ff3
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
|
Button component — debounced digital input with edge detection. More...
#include <cstdint>Go to the source code of this file.
Classes | |
| struct | sbl::components::control::ButtonConfig |
| class | sbl::components::control::Button |
| Debounced button with edge detection and held-duration tracking. More... | |
Namespaces | |
| namespace | sbl |
| Root namespace for all Sound Byte Libs functionality. | |
| namespace | sbl::components |
| Mid-level functional components. | |
| namespace | sbl::components::control |
| Physical control components. | |
Button component — debounced digital input with edge detection.
Button takes logical GPIO readings (true = pressed) and provides debounced state, edge detection, and held-duration tracking. No active_low logic needed — Gpio::read() already returns logical value.
Usage: sbl::components::control::Button btn; btn.update(gpio_reading); // Feed logical state each tick if (btn.just_pressed()) { ... } // Rising edge (auto-resets) if (btn.held_count() > 500) { ... } // Long press
Definition in file button.hpp.