Sound Byte Libs 0.5.1-121-g3358a44
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
Loading...
Searching...
No Matches
button.hpp File Reference

Button component — debounced digital input with edge detection. More...

Detailed Description

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::input::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.

#include <cstdint>

Go to the source code of this file.

Classes

struct  sbl::components::input::ButtonConfig
 
class  sbl::components::input::Button
 Debounced button with edge detection and held-duration tracking. More...
 

Namespaces

namespace  sbl
 Root namespace for all Sound Byte Libs code.
 
namespace  sbl::components
 Functional hardware components.
 
namespace  sbl::components::input
 Pots, buttons, encoders.