3-phase PV router
|
Manages override pins and their associated bitmasks for forced operation. More...
#include <utils_override.h>
Classes | |
struct | Entry |
Internal structure representing a pin and its associated bitmask. More... | |
Public Member Functions | |
constexpr | OverridePins (const KeyIndexPair< MaxPins >(&pairs)[N]) |
Constructor. Initializes the override pin mapping from pin-index pairs. | |
constexpr uint16_t | findBitmask (uint8_t pin) const |
Finds the bitmask associated with a given pin number. | |
constexpr uint16_t | getBitmask (uint8_t index) const |
Returns the bitmask for the specified entry index. | |
constexpr uint8_t | getPin (uint8_t index) const |
Returns the pin number at the specified entry index. | |
void | printOverrideConfig () const |
Print the configured override pins and their bitmasks to Serial during startup. | |
constexpr uint8_t | size () const |
Returns the number of override pin entries. | |
Private Attributes | |
const Entry | entries_ [N] |
Manages override pins and their associated bitmasks for forced operation.
This class provides compile-time mapping between override pins and the loads/relays they control. Each pin can be associated with a set of pins (loads/relays), represented as a bitmask.
N | Number of pin-index pairs (entries). |
MaxPins | Maximum number of pins supported (loads + relays). |
Definition at line 228 of file utils_override.h.
|
inlineconstexpr |
Constructor. Initializes the override pin mapping from pin-index pairs.
pairs | Array of pin-index pairs, each specifying a pin and its associated pins. |
Definition at line 254 of file utils_override.h.
|
inlineconstexpr |
Finds the bitmask associated with a given pin number.
pin | Pin value to search for. |
Definition at line 302 of file utils_override.h.
|
inlineconstexpr |
Returns the bitmask for the specified entry index.
index | Index in the entries array. |
Definition at line 292 of file utils_override.h.
|
inlineconstexpr |
Returns the pin number at the specified entry index.
index | Index in the entries array. |
Definition at line 282 of file utils_override.h.
|
inline |
Print the configured override pins and their bitmasks to Serial during startup.
This method outputs the pin number and associated bitmask for each entry.
Definition at line 319 of file utils_override.h.
|
inlineconstexpr |
Returns the number of override pin entries.
Definition at line 272 of file utils_override.h.
|
private |
Array of entries for all pin-index pairs.
Definition at line 246 of file utils_override.h.