35template <u
int8_t BITS,
class T_in = u
int16_t,
class T_out = u
int8_t>
52 if (inputLevel < lowerbound || inputLevel > upperbound) {
73 constexpr static T_in
margin = (1UL << BITS) - 1;
74 constexpr static T_in
offset = 1UL << (BITS - 1);
77 static_assert(
max_in > 0,
"Error: only unsigned types are supported");
#define AH_DIAGNOSTIC_POP()
#define AH_DIAGNOSTIC_WERROR()
A class for applying hysteresis to a given input.
static constexpr T_out max_out
bool update(T_in inputLevel)
Update the hysteresis output with a new input value.
static constexpr T_in max_in
void setValue(T_in inputLevel)
Forcefully update the internal state to the given level.
T_out getValue() const
Get the current output level.
static constexpr T_in offset
static constexpr T_in margin