|
3-phase PV router
|
Authoring and decoding helpers for the packed load map. More...
Classes | |
| struct | OverrideMasks |
| Override bit of each load, in the local or in the remote override bitmask. More... | |
Functions | |
| template<uint8_t N> | |
| constexpr uint8_t | bitOf (const uint8_t(&map)[N], uint8_t loadNum) |
| Rank of a load among the loads of its own unit, in ascending map order. | |
| template<uint8_t N> | |
| constexpr uint8_t | countRemoteLoads (const uint8_t(&map)[N]) |
| Number of entries of the map that are driven remotely. | |
| template<uint8_t N> | |
| constexpr uint8_t | countUnits (const uint8_t(&map)[N]) |
| Highest remote unit number appearing in the map (0 if fully local). | |
| template<uint8_t N> | |
| constexpr bool | hasValidRemoteUnits (const uint8_t(&map)[N]) |
| Check that every remote load of a map was declared with a unit from 1 to 3. | |
| constexpr bool | isLocal (uint8_t entry) |
| True if the entry describes a locally driven load. | |
| template<uint8_t N> | |
| constexpr bool | isValidMap (const uint8_t(&map)[N]) |
| Check that every entry of a load map designates a usable pin. | |
| constexpr uint8_t | local (uint8_t pin) |
| Declares a load driven locally by the router. | |
| template<uint8_t N> | |
| constexpr uint8_t | maxLoadsPerUnit (const uint8_t(&map)[N]) |
| Largest number of loads assigned to any single remote unit. | |
| template<uint8_t N> | |
| constexpr OverrideMasks< N > | overrideMasks (const uint8_t(&map)[N]) |
| Build the override bits of a load map. | |
| constexpr uint8_t | pinOf (uint8_t entry) |
| The pin of the entry: TRIAC pin if local, status LED (0 = none) if remote. | |
| constexpr uint8_t | remote (uint8_t unit, uint8_t ledPin=0) |
| Declares a load driven by a remote unit over RF. | |
| template<uint8_t N> | |
| constexpr uint8_t | remoteOrdinal (const uint8_t(&map)[N], uint8_t loadNum) |
| Rank of a remote load among the remote loads, in ascending map order. | |
| constexpr uint8_t | unitOf (uint8_t entry) |
| The owning unit of the entry: 0 for a local load, 1..3 for a remote one. | |
Authoring and decoding helpers for the packed load map.
|
constexpr |
Rank of a load among the loads of its own unit, in ascending map order.
This is the bit position of the load inside its unit's RF payload.
Definition at line 195 of file load_map.h.


|
constexpr |
Number of entries of the map that are driven remotely.
Definition at line 127 of file load_map.h.


|
constexpr |
Highest remote unit number appearing in the map (0 if fully local).
Definition at line 110 of file load_map.h.


|
constexpr |
Check that every remote load of a map was declared with a unit from 1 to 3.
Load::remote() returns invalidRemoteUnitEntry otherwise: see there.
Definition at line 288 of file load_map.h.

|
constexpr |
True if the entry describes a locally driven load.
Definition at line 89 of file load_map.h.

|
constexpr |
Check that every entry of a load map designates a usable pin.
A local load needs a real TRIAC pin, 2..13 (0 and 1 are the serial interface, 14 and above do not exist). A remote load needs no pin, but its optional status LED, when present, obeys the same range.
This is also what catches an entry left at unused_pin: 0xFF decodes as unit 3 / pin 63, which is out of range.
Definition at line 258 of file load_map.h.


|
constexpr |
Declares a load driven locally by the router.
| pin | The digital pin of the TRIAC output. |
Definition at line 68 of file load_map.h.

|
constexpr |
Largest number of loads assigned to any single remote unit.
Definition at line 144 of file load_map.h.


|
constexpr |
Build the override bits of a load map.
An entry out of range (rejected by isValidMap() and the remote load count checks) gets no bit, so that the error reported is that one.
| map | The load map. |
Definition at line 230 of file load_map.h.


|
constexpr |
The pin of the entry: TRIAC pin if local, status LED (0 = none) if remote.
Definition at line 101 of file load_map.h.

|
constexpr |
Declares a load driven by a remote unit over RF.
| unit | The remote unit number (1..3). |
| ledPin | Optional status LED pin on the router, 0 for none. |
Definition at line 79 of file load_map.h.

|
constexpr |
Rank of a remote load among the remote loads, in ascending map order.
This is the ordinal used by the virtual-pin space of the override subsystem (REMOTE_PIN_BASE + ordinal) and by bit 16+ordinal of the ALL_REMOTE_LOADS() bitmask.
| map | The load map. |
| loadNum | Index into the map, which must designate a remote load. |
Definition at line 176 of file load_map.h.


|
constexpr |
The owning unit of the entry: 0 for a local load, 1..3 for a remote one.
Definition at line 95 of file load_map.h.
