|
Sound Byte Libs 0.5.1-340-gab5b79a
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
|
Gate input with Schmitt trigger hysteresis and edge detection. More...
Gate input with Schmitt trigger hysteresis and edge detection.
Definition at line 38 of file gate_input.hpp.
#include <gate_input.hpp>
Public Member Functions | |
| GateInput (const GateConfig &config={}) | |
| Construct with the gate off. | |
| 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. | |
|
inlineexplicit |
Construct with the gate off.
| config | Thresholds |
Definition at line 44 of file gate_input.hpp.
|
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.
| raw | ADC sample, 0 to 65535 |
Definition at line 60 of file gate_input.hpp.
|
inline |
Current gate state (true = high)
Definition at line 77 of file gate_input.hpp.
|
inline |
True if gate just went high (rising edge)
Consuming read - resets after first read. Call once per update cycle.
Definition at line 84 of file gate_input.hpp.
|
inline |
True if gate just went low (falling edge)
Consuming read - resets after first read. Call once per update cycle.
Definition at line 95 of file gate_input.hpp.
|
inline |
Reset all state.
Definition at line 102 of file gate_input.hpp.