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
sbl::button Namespace Reference

Convenience layer: read a button. More...

Detailed Description

Convenience layer: read a button.

Typedefs

using Button = sbl::components::input::Button
 
using ButtonConfig = sbl::components::input::ButtonConfig
 

Functions

template<typename Driver >
void read (Button &btn, const GpioHandle &handle)
 Read GPIO pin and feed into Button (debounce + edge detection)
 

Typedef Documentation

◆ Button

Definition at line 23 of file input.hpp.

◆ ButtonConfig

Definition at line 24 of file input.hpp.

Function Documentation

◆ read()

template<typename Driver >
void sbl::button::read ( Button &  btn,
const GpioHandle &  handle 
)
inline

Read GPIO pin and feed into Button (debounce + edge detection)

Gpio::read() returns logical value (active_low handled by driver), so Button doesn't need inversion logic.

Template Parameters
DriverGPIO driver type (e.g., sbl::driver::Gpio)
Parameters
btnButton instance to update
handleGPIO handle for the button pin
Note
ISR-safe — single GPIO register read

Definition at line 39 of file input.hpp.

References sbl::components::input::Button::update().