13#ifndef SBL_HW_COMPONENTS_CV_GATE_HPP_
14#define SBL_HW_COMPONENTS_CV_GATE_HPP_
33 : thresh_high_(config.threshold_high),
34 thresh_low_(config.threshold_low),
35 state_(false), rising_(false), falling_(false) {}
47 if (!state_ && raw >= thresh_high_) {
49 }
else if (state_ && raw < thresh_low_) {
55 }
else if (!state_ && was) {
61 bool gate()
const {
return state_; }
93 uint16_t thresh_high_;
uint16_t threshold_high
ADC value to trigger gate ON (~2V for 3.3V/16-bit)
uint16_t threshold_low
ADC value to trigger gate OFF (hysteresis band)