Gate input with Schmitt trigger hysteresis and edge detection.
More...
#include <gate.hpp>
|
| | GateInput (const GateConfig &config={}) |
| |
| void | update (uint16_t raw) |
| | Feed a new raw ADC sample.
|
| |
| bool | gate () const |
| | Current gate state (true = high)
|
| |
| bool | rising () |
| | True if gate just went high (rising edge)
|
| |
| bool | falling () |
| | True if gate just went low (falling edge)
|
| |
| void | reset () |
| | Reset all state.
|
| |
Gate input with Schmitt trigger hysteresis and edge detection.
- Note
- All public methods are ISR-safe — pure state machine with no hardware I/O.
Definition at line 29 of file gate.hpp.
◆ GateInput()
| sbl::components::cv::GateInput::GateInput |
( |
const GateConfig & |
config = {} | ) |
|
|
inlineexplicit |
◆ falling()
| bool sbl::components::cv::GateInput::falling |
( |
| ) |
|
|
inline |
True if gate just went low (falling edge)
Consuming read — resets after first read. Call once per update cycle.
Definition at line 78 of file gate.hpp.
◆ gate()
| bool sbl::components::cv::GateInput::gate |
( |
| ) |
const |
|
inline |
Current gate state (true = high)
Definition at line 60 of file gate.hpp.
◆ reset()
| void sbl::components::cv::GateInput::reset |
( |
| ) |
|
|
inline |
Reset all state.
Definition at line 85 of file gate.hpp.
◆ rising()
| bool sbl::components::cv::GateInput::rising |
( |
| ) |
|
|
inline |
True if gate just went high (rising edge)
Consuming read — resets after first read. Call once per update cycle.
Definition at line 67 of file gate.hpp.
◆ update()
| void sbl::components::cv::GateInput::update |
( |
uint16_t |
raw | ) |
|
|
inline |
Feed a new raw ADC sample.
Schmitt trigger: gate turns ON when value >= threshold_high, turns OFF when value < threshold_low. The hysteresis band between the two thresholds prevents chatter.
Definition at line 43 of file gate.hpp.
The documentation for this class was generated from the following file: