|
3-phase PV router
|
What config.h is written with: its types, constants and helpers. More...


Go to the source code of this file.
Classes | |
| struct | BoostEntry< MaxPins > |
| When a set of loads is boosted: a window and the targets. More... | |
| struct | BoostLength |
| How long a boost lasts, in minutes, or UNTIL_THE_END. More... | |
| struct | BoostStart |
Where a boost starts: minutes after the start of the off-peak period, or before its end if fromEnd. More... | |
| struct | BoostWindow |
| When a load is boosted during the off-peak period. More... | |
| struct | DeviceAddress |
| Structure representing the address of a device. More... | |
| struct | KeyIndexPair< MaxPins > |
| Structure holding a pin and its associated index list. More... | |
| struct | Minutes |
| A number of minutes: the unit of the scheduled boosts, built with HOURS() or MINUTES(). More... | |
| class | OverridePins< N, MaxPins > |
| The override pins, as in config.h: each pin with the targets it forces. More... | |
| struct | PinList< MaxPins > |
| Wrapper for a list of pins, constructible from variadic arguments. More... | |
| class | RelayEngine< N, D > |
| The relays, as in config.h: the sliding average and the settings of each relay. More... | |
| struct | RelaySetting |
| The settings of one relay, as in config.h: { pin, surplus, import, minON, minOFF }. More... | |
| class | RotationGroups< N, MaxPins > |
| The rotation groups, as in config.h: the loads that take turns at the top of the priority list, one group per appliance (the elements of a 3-phase water heater). More... | |
| class | RotationGroups< 0, MaxPins > |
| No rotation group. More... | |
| class | ScheduledBoosts< N, MaxPins > |
| The scheduled boosts, as in config.h: each window with the targets it forces. More... | |
| class | ScheduledBoosts< 0, MaxPins > |
| No boost at all. More... | |
| class | TemperatureSensing< N > |
| The temperature sensors, as in config.h: the pin of the bus and the address of each sensor. More... | |
| struct | RotationGroups< N, MaxPins >::Ten |
Namespaces | |
| namespace | TargetCode |
| The codes LOAD(), RELAY() and ALL_...() put in a target list. | |
Typedefs | |
| using | RotationGroupTargets = PinList< 16 > |
Enumerations | |
| enum class | PcbVersion : uint8_t { OLD , NEW } |
| enum class | RotationModes : uint8_t { OFF , AUTO , PIN } |
| enum class | SerialOutputType { HumanReadable , IoT , JSON } |
Functions | |
| constexpr uint8_t | ALL_LOADS () |
| Every load, local and remote. | |
| constexpr uint8_t | ALL_LOADS_AND_RELAYS () |
| Every load and every relay. | |
| constexpr uint8_t | ALL_LOCAL_LOADS () |
| Every local load. | |
| constexpr uint8_t | ALL_RELAYS () |
| Every relay (none without relay diversion). | |
| constexpr uint8_t | ALL_REMOTE_LOADS () |
| Every remote load. | |
| constexpr BoostStart | BEFORE_END (const Minutes m) |
A start m before the end of the off-peak period. | |
| constexpr BoostWindow | FIRST (const Minutes d) |
The first d of the off-peak period. | |
| constexpr BoostLength | FOR (const Minutes m) |
A boost lasting m. | |
| constexpr BoostStart | FROM_START (const Minutes m) |
A start m after the beginning of the off-peak period. | |
| constexpr BoostWindow | LAST (const Minutes d) |
The last d of the off-peak period, until the end. | |
| constexpr uint8_t | LOAD (const uint8_t loadNum) |
Load loadNum of physicalLoadPin[], local or remote (0, no load, if out of range). | |
| constexpr uint8_t | LOCAL_LOAD (const uint8_t loadNum) |
| Same as LOAD(), for a load known to be local. | |
| template<uint8_t MaxPins, uint8_t N> | |
| OverridePins (const KeyIndexPair< MaxPins >(&)[N]) -> OverridePins< N, MaxPins > | |
| Deduction guide: N and MaxPins from the list. | |
| constexpr uint8_t | RELAY (const uint8_t relayNum) |
Relay relayNum of relays (0, no relay, if out of range or without relay diversion). | |
| template<uint8_t N> | |
| RelayEngine (const RelaySetting(&)[N]) -> RelayEngine< N, 10 > | |
| Deduction guide: the default sliding average. | |
| template<uint8_t N, uint16_t D> | |
| RelayEngine (integral_constant< uint16_t, D >, const RelaySetting(&)[N]) -> RelayEngine< N, static_cast< uint8_t >(D) > | |
| Deduction guide: the sliding average from MINUTES(). | |
| template<uint8_t N, uint8_t D> | |
| RelayEngine (integral_constant< uint8_t, D >, const RelaySetting(&)[N]) -> RelayEngine< N, D > | |
| Deduction guide: the sliding average as an integral_constant< uint8_t >. | |
| constexpr uint8_t | REMOTE_LOAD (const uint8_t loadNum) |
The loadNum-th REMOTE load, counting remote loads only, in physicalLoadPin[] order. | |
| RotationGroups () -> RotationGroups< 0 > | |
| Deduction guides: the number of groups is the number of lists. | |
| RotationGroups (const RotationGroupTargets &) -> RotationGroups< 1 > | |
| RotationGroups (const RotationGroupTargets &, const RotationGroupTargets &) -> RotationGroups< 2 > | |
| RotationGroups (const RotationGroupTargets &, const RotationGroupTargets &, const RotationGroupTargets &) -> RotationGroups< 3 > | |
| RotationGroups (const RotationGroupTargets &, const RotationGroupTargets &, const RotationGroupTargets &, const RotationGroupTargets &) -> RotationGroups< 4 > | |
| RotationGroups (const RotationGroupTargets &, const RotationGroupTargets &, const RotationGroupTargets &, const RotationGroupTargets &, const RotationGroupTargets &) -> RotationGroups< 5 > | |
| RotationGroups (const RotationGroupTargets &, const RotationGroupTargets &, const RotationGroupTargets &, const RotationGroupTargets &, const RotationGroupTargets &, const RotationGroupTargets &) -> RotationGroups< 6 > | |
| RotationGroups (const RotationGroupTargets &, const RotationGroupTargets &, const RotationGroupTargets &, const RotationGroupTargets &, const RotationGroupTargets &, const RotationGroupTargets &, const RotationGroupTargets &) -> RotationGroups< 7 > | |
| RotationGroups (const RotationGroupTargets &, const RotationGroupTargets &, const RotationGroupTargets &, const RotationGroupTargets &, const RotationGroupTargets &, const RotationGroupTargets &, const RotationGroupTargets &, const RotationGroupTargets &) -> RotationGroups< 8 > | |
| RotationGroups (const RotationGroupTargets &, const RotationGroupTargets &, const RotationGroupTargets &, const RotationGroupTargets &, const RotationGroupTargets &, const RotationGroupTargets &, const RotationGroupTargets &, const RotationGroupTargets &, const RotationGroupTargets &) -> RotationGroups< 9 > | |
| RotationGroups (const RotationGroupTargets &, const RotationGroupTargets &, const RotationGroupTargets &, const RotationGroupTargets &, const RotationGroupTargets &, const RotationGroupTargets &, const RotationGroupTargets &, const RotationGroupTargets &, const RotationGroupTargets &, const RotationGroupTargets &) -> RotationGroups< 10 > | |
| ScheduledBoosts () -> ScheduledBoosts< 0 > | |
| Deduction guide: no argument, no boost. | |
| template<uint8_t MaxPins, uint8_t N> | |
| ScheduledBoosts (const BoostEntry< MaxPins >(&)[N]) -> ScheduledBoosts< N, MaxPins > | |
| Deduction guide, as for OverridePins. | |
Variables | |
| constexpr uint8_t | TargetCode::ALL_LOADS { 0xF2 } |
| constexpr uint8_t | TargetCode::ALL_LOADS_AND_RELAYS { 0xF4 } |
| constexpr uint8_t | TargetCode::ALL_LOCAL_LOADS { 0xF0 } |
| constexpr uint8_t | TargetCode::ALL_RELAYS { 0xF3 } |
| constexpr uint8_t | TargetCode::ALL_REMOTE_LOADS { 0xF1 } |
| constexpr uint8_t | TargetCode::LOAD { 0x40 } |
| constexpr uint8_t | TargetCode::LOCAL_LOAD { 0x60 } |
| constexpr uint8_t | LOCAL_MASK_BITS { 16 } |
| constexpr uint8_t | TargetCode::MAX_LOADS { 32 } |
| constexpr uint8_t | TargetCode::MAX_LOCAL_LOADS { 16 } |
| constexpr uint8_t | TargetCode::MAX_RELAYS { 16 } |
| constexpr uint8_t | TargetCode::RELAY { 0x70 } |
| constexpr uint8_t | REMOTE_MASK_BITS { 8 } |
| constexpr uint8_t | REMOTE_PIN_BASE { 128 } |
| Base value for virtual pins representing remote loads. | |
| constexpr uint16_t | UNTIL_THE_END { UINT16_MAX } |
| The length of a boost that only the meter ends: the end of the off-peak period stops it anyway. | |
What config.h is written with: its types, constants and helpers.
config.h includes this file and nothing else. Nothing here depends on a setting, so config.h reads on its own, top to bottom, for the compiler as for the configurator. Nothing here depends on Arduino either: the native tests build it on the PC.
The settings types (RelayEngine, OverridePins, ScheduledBoosts, RotationGroups, TemperatureSensing) only hold what config.h says. The objects the firmware works with are built from them in config_derived.h, which the code includes instead of config.h.
Definition in file config_types.h.
| using RotationGroupTargets = PinList< 16 > |
the targets of one rotation group
Definition at line 601 of file config_types.h.
|
strong |
Motherboard: each has its own analog inputs and ADC reference (adc_chain.h)
| Enumerator | |
|---|---|
| OLD | the former 3-phase board: ADC reference AVCC (= VCC, 5 V or 3.3 V) |
| NEW | the universal 3phaseDiverter board (rev. 6.0 and later): internal 1.1 V ADC reference |
Definition at line 39 of file config_types.h.
|
strong |
Rotation modes
| Enumerator | |
|---|---|
| OFF | Off |
| AUTO | Once a day |
| PIN | Pin triggered |
Definition at line 46 of file config_types.h.
|
strong |
Enum for serial output types
| Enumerator | |
|---|---|
| HumanReadable | Human-readable output for commissioning |
| IoT | Output for HomeAssistant or similar |
| JSON | Output in JSON format |
Definition at line 31 of file config_types.h.
|
constexpr |
Every load, local and remote.
Definition at line 132 of file config_types.h.

|
constexpr |
Every load and every relay.
Definition at line 144 of file config_types.h.

|
constexpr |
Every local load.
Definition at line 120 of file config_types.h.

|
constexpr |
Every relay (none without relay diversion).
Definition at line 138 of file config_types.h.

|
constexpr |
Every remote load.
Definition at line 126 of file config_types.h.

|
constexpr |
A start m before the end of the off-peak period.
Definition at line 395 of file config_types.h.

|
constexpr |
The first d of the off-peak period.
Definition at line 412 of file config_types.h.


|
constexpr |
A boost lasting m.
Definition at line 406 of file config_types.h.

|
constexpr |
A start m after the beginning of the off-peak period.
Definition at line 389 of file config_types.h.

|
constexpr |
The last d of the off-peak period, until the end.
Definition at line 418 of file config_types.h.


|
constexpr |
Load loadNum of physicalLoadPin[], local or remote (0, no load, if out of range).
Definition at line 93 of file config_types.h.

|
constexpr |
Same as LOAD(), for a load known to be local.
Definition at line 99 of file config_types.h.

| OverridePins | ( | const KeyIndexPair< MaxPins > | (&)[N] | ) | -> OverridePins< N, MaxPins > |
Deduction guide: N and MaxPins from the list.
|
constexpr |
Relay relayNum of relays (0, no relay, if out of range or without relay diversion).
Definition at line 114 of file config_types.h.

| RelayEngine | ( | const | RelaySetting(&)[N] | ) | -> RelayEngine< N, 10 > |
Deduction guide: the default sliding average.
| RelayEngine | ( | integral_constant< uint16_t, D > | , |
| const | RelaySetting(&)[N] ) -> RelayEngine< N, static_cast< uint8_t >(D) > |
Deduction guide: the sliding average from MINUTES().
| RelayEngine | ( | integral_constant< uint8_t, D > | , |
| const | RelaySetting(&)[N] ) -> RelayEngine< N, D > |
Deduction guide: the sliding average as an integral_constant< uint8_t >.
|
constexpr |
The loadNum-th REMOTE load, counting remote loads only, in physicalLoadPin[] order.
loadNum (0, no load, from REMOTE_MASK_BITS on). Definition at line 108 of file config_types.h.
| RotationGroups | ( | ) | -> RotationGroups< 0 > |
Deduction guides: the number of groups is the number of lists.
| RotationGroups | ( | const RotationGroupTargets & | ) | -> RotationGroups< 1 > |
| RotationGroups | ( | const RotationGroupTargets & | , |
| const RotationGroupTargets & | ) -> RotationGroups< 2 > |
| RotationGroups | ( | const RotationGroupTargets & | , |
| const RotationGroupTargets & | , | ||
| const RotationGroupTargets & | ) -> RotationGroups< 3 > |
| RotationGroups | ( | const RotationGroupTargets & | , |
| const RotationGroupTargets & | , | ||
| const RotationGroupTargets & | , | ||
| const RotationGroupTargets & | ) -> RotationGroups< 4 > |
| RotationGroups | ( | const RotationGroupTargets & | , |
| const RotationGroupTargets & | , | ||
| const RotationGroupTargets & | , | ||
| const RotationGroupTargets & | , | ||
| const RotationGroupTargets & | ) -> RotationGroups< 5 > |
| RotationGroups | ( | const RotationGroupTargets & | , |
| const RotationGroupTargets & | , | ||
| const RotationGroupTargets & | , | ||
| const RotationGroupTargets & | , | ||
| const RotationGroupTargets & | , | ||
| const RotationGroupTargets & | ) -> RotationGroups< 6 > |
| RotationGroups | ( | const RotationGroupTargets & | , |
| const RotationGroupTargets & | , | ||
| const RotationGroupTargets & | , | ||
| const RotationGroupTargets & | , | ||
| const RotationGroupTargets & | , | ||
| const RotationGroupTargets & | , | ||
| const RotationGroupTargets & | ) -> RotationGroups< 7 > |
| RotationGroups | ( | const RotationGroupTargets & | , |
| const RotationGroupTargets & | , | ||
| const RotationGroupTargets & | , | ||
| const RotationGroupTargets & | , | ||
| const RotationGroupTargets & | , | ||
| const RotationGroupTargets & | , | ||
| const RotationGroupTargets & | , | ||
| const RotationGroupTargets & | ) -> RotationGroups< 8 > |
| RotationGroups | ( | const RotationGroupTargets & | , |
| const RotationGroupTargets & | , | ||
| const RotationGroupTargets & | , | ||
| const RotationGroupTargets & | , | ||
| const RotationGroupTargets & | , | ||
| const RotationGroupTargets & | , | ||
| const RotationGroupTargets & | , | ||
| const RotationGroupTargets & | , | ||
| const RotationGroupTargets & | ) -> RotationGroups< 9 > |
| RotationGroups | ( | const RotationGroupTargets & | , |
| const RotationGroupTargets & | , | ||
| const RotationGroupTargets & | , | ||
| const RotationGroupTargets & | , | ||
| const RotationGroupTargets & | , | ||
| const RotationGroupTargets & | , | ||
| const RotationGroupTargets & | , | ||
| const RotationGroupTargets & | , | ||
| const RotationGroupTargets & | , | ||
| const RotationGroupTargets & | ) -> RotationGroups< 10 > |
| ScheduledBoosts | ( | ) | -> ScheduledBoosts< 0 > |
Deduction guide: no argument, no boost.
| ScheduledBoosts | ( | const BoostEntry< MaxPins > | (&)[N] | ) | -> ScheduledBoosts< N, MaxPins > |
Deduction guide, as for OverridePins.
|
inlineconstexpr |
pins in a target's local mask (uint16_t): D0-D15
Definition at line 64 of file config_types.h.
|
inlineconstexpr |
remote loads in a target's remote mask (uint8_t)
Definition at line 65 of file config_types.h.
|
inlineconstexpr |
Base value for virtual pins representing remote loads.
Values >= REMOTE_PIN_BASE are virtual pins for remote loads. REMOTE_LOAD(0) returns 128, REMOTE_LOAD(1) returns 129, etc.
Definition at line 62 of file config_types.h.
|
inlineconstexpr |
The length of a boost that only the meter ends: the end of the off-peak period stops it anyway.
Definition at line 373 of file config_types.h.