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::components::input::DigitalGateInput Class Reference

Detailed Description

Debounced digital gate input with edge detection and retrigger lockout.

Note
All public methods are ISR-safe — pure state machine with no hardware I/O.

Definition at line 31 of file digital_gate.hpp.

#include <digital_gate.hpp>

Public Member Functions

 DigitalGateInput (const DigitalGateConfig &config={})
 
void update (bool logical_state)
 
bool gate () const
 Current debounced gate state (true = high).
 
bool rising ()
 
bool falling ()
 
void reset ()
 Reset all state.
 

Constructor & Destructor Documentation

◆ DigitalGateInput()

sbl::components::input::DigitalGateInput::DigitalGateInput ( const DigitalGateConfig &  config = {})
inlineexplicit

Definition at line 33 of file digital_gate.hpp.

Member Function Documentation

◆ update()

void sbl::components::input::DigitalGateInput::update ( bool  logical_state)
inline

Feed a new logical GPIO reading. Call once per update cycle (e.g. 200 Hz control rate).

Definition at line 39 of file digital_gate.hpp.

Referenced by sbl::gate::read().

◆ gate()

bool sbl::components::input::DigitalGateInput::gate ( ) const
inline

Current debounced gate state (true = high).

Definition at line 67 of file digital_gate.hpp.

◆ rising()

bool sbl::components::input::DigitalGateInput::rising ( )
inline

True if gate just went high (rising edge). Consuming read — resets after first read. Call once per update cycle.

Definition at line 71 of file digital_gate.hpp.

◆ falling()

bool sbl::components::input::DigitalGateInput::falling ( )
inline

True if gate just went low (falling edge). Consuming read — resets after first read. Call once per update cycle.

Definition at line 79 of file digital_gate.hpp.

◆ reset()

void sbl::components::input::DigitalGateInput::reset ( )
inline

Reset all state.

Definition at line 86 of file digital_gate.hpp.


The documentation for this class was generated from the following file: