36template <u
int8_t Bits,
class T_in = u
int16_t,
class T_out = u
int8_t>
53 if (inputLevel < lowerbound || inputLevel > upperbound) {
74 constexpr static T_in
margin = (1ul << Bits) - 1ul;
75 constexpr static T_in
offset = Bits >= 1 ? 1ul << (Bits - 1) : 0;
76 constexpr static T_in
max_in =
static_cast<T_in
>(-1);
78 static_assert(
max_in > 0,
"Error: only unsigned types are supported");
81template <
class T_in,
class T_out>
#define BEGIN_AH_NAMESPACE
bool update(T_in inputLevel)
void setValue(T_in inputLevel) const
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