Represents a state indicator for one or more attached actuators, indicators are normally connected to a digital out. More...
#include <indicator.hpp>

Public Member Functions | |
| LSH_OPTIONAL_CONSTEXPR_CTOR | Indicator (uint8_t pin) noexcept |
| Construct a new Indicator object using standard I/O. | |
| template<uint8_t Pin> | |
| LSH_OPTIONAL_CONSTEXPR_CTOR | Indicator (lsh::core::PinTag< Pin >) noexcept |
| Construct an indicator from a compile-time pin tag on the slow-I/O path. | |
| void | setState (bool stateToSet) |
| Set the state of the indicator. | |
| void | applyComputedState (bool newState) |
| void | setIndex (uint8_t indexToSet) |
| Set the indicator index on Indicators namespace Array. | |
| void | check () |
| Switch the indicator based on controlled actuators status. | |
| auto | getIndex () const -> uint8_t |
| Get the indicator index on Indicators namespace Array. | |
Represents a state indicator for one or more attached actuators, indicators are normally connected to a digital out.
|
inlineexplicitnoexcept |
Construct a new Indicator object using standard I/O.
| pin | The Arduino pin number for the indicator. |
|
inlineexplicitnoexcept |
Construct an indicator from a compile-time pin tag on the slow-I/O path.
This keeps the public DSL consistent across builds even when the target does not use the AVR fast-I/O backend.
| void Indicator::check | ( | ) |
Switch the indicator based on controlled actuators status.
The behavior depends on mode setting:
If mode = ANY -> If any controlled actuator is ON switch ON the indicator, OFF otherwise. If mode = ALL -> If all controlled actuators are ON switch ON the indicator, OFF otherwise. If mode = MAJORITY -> If the majority of controlled actuators are ON switch ON the indicator, OFF otherwise.
Indicators with zero controlled actuators are treated as OFF here as a final safety net, even though setup validation should already reject that config.
| auto Indicator::getIndex | ( | ) | const -> uint8_t |
Get the indicator index on Indicators namespace Array.
| void Indicator::setIndex | ( | uint8_t | indexToSet | ) |
Set the indicator index on Indicators namespace Array.
| indexToSet | index to set. |
|
inline |
Set the state of the indicator.
| stateToSet | the state to set true=ON, false=OFF. |