3-phase PV router
Loading...
Searching...
No Matches
validation.h
Go to the documentation of this file.
1
12
13#ifndef VALIDATION_H
14#define VALIDATION_H
15
16#include "config_system.h"
17#include "utils_pins.h"
18#include "utils_rf.h"
19
20#include "config_derived.h"
21#include "ct_filter.h"
22#include "datalog_math.h"
23#include "energy_bucket.h"
24#include "temp_schedule.h"
25
33
34static_assert(SUPPLY_FREQUENCY == 50 || SUPPLY_FREQUENCY == 60, "******** SUPPLY_FREQUENCY must be 50 or 60 Hz ! ********");
35
36static_assert(DATALOG_PERIOD_IN_SECONDS <= 30, "**** Data log duration is too long and will lead to overflow ! 30 s at most. ****");
37
38static_assert(Energy::isValidCalibration(f_powerCal), "******** Wrong power calibration ! Each value of f_powerCal must be positive and below 8. Please check your calibration.h ! ********");
39static_assert(Datalog::isValidVoltageCalibration(Datalog::vrmsFactor(DATALOG_PERIOD_IN_SECONDS), f_voltageCal), "******** Wrong voltage calibration ! Each value of f_voltageCal must be positive. Please check your calibration.h ! ********");
40static_assert(lpf_gain == 0.0F || alpha == 0.0F || CtFilter::isAccurate(lpf_gain, alpha), "******** Wrong CT filter settings ! alpha must be from 0.00005 to below 0.0625 and lpf_gain from 0 to below 64. Please check your calibration.h ! ********");
41
42static_assert(TEMP_SENSOR_PRESENT ^ (temperatureSensing.get_pin() == unused_pin), "******** Wrong pin value for temperature sensor(s). Please check your config.h ! ********");
43static_assert(DIVERSION_PIN_PRESENT ^ (diversionPin == unused_pin), "******** Wrong pin value for diversion command. Please check your config.h ! ********");
44static_assert(ROUTER_OFF_PIN_PRESENT ^ (routerOffPin == unused_pin), "******** Wrong pin value for router OFF command. Please check your config.h ! ********");
45static_assert((PRIORITY_ROTATION == RotationModes::PIN) ^ (rotationPin == unused_pin), "******** Wrong pin value for rotation command. Please check your config.h ! ********");
46static_assert(WATCHDOG_PIN_PRESENT ^ (watchDogPin == unused_pin), "******** Wrong pin value for watchdog. Please check your config.h ! ********");
47
48static_assert(DUAL_TARIFF ^ (dualTariffPin == unused_pin), "******** Wrong pin value for dual tariff. Please check your config.h ! ********");
49static_assert(!(DUAL_TARIFF & (ul_OFF_PEAK_DURATION == 0)), "******** Off-peak duration cannot be zero. Please check your config.h ! ********");
50static_assert(!(DUAL_TARIFF & (ul_OFF_PEAK_DURATION > 12)), "******** Off-peak duration cannot last more than 12 hours. Please check your config.h ! ********");
51
57constexpr bool check_boost_windows()
58{
59 for (uint8_t i = 0; i != scheduledBoosts.size(); ++i)
60 {
61 const BoostWindow window{ scheduledBoosts.getWindow(i) };
62
63 if (!DualTariff::startsWithinOffPeak(window, ul_OFF_PEAK_DURATION) || !DualTariff::endsWithinOffPeak(window, ul_OFF_PEAK_DURATION) || !DualTariff::hasLength(window))
64 {
65 return false;
66 }
67 }
68 return true;
69}
70static_assert(!DUAL_TARIFF || check_boost_windows(), "******** A scheduled boost starts or ends outside the off-peak period, or lasts 0 minutes. Please check scheduledBoosts in your config.h ! ********");
71
72static_assert(!RELAY_DIVERSION | (60 / DATALOG_PERIOD_IN_SECONDS * DATALOG_PERIOD_IN_SECONDS == 60), "******** Wrong configuration. DATALOG_PERIOD_IN_SECONDS must be a divider of 60 ! ********");
73// the EWMA of the relays averages D * 60 / DATALOG_PERIOD_IN_SECONDS datalogs, D being the minutes
74// that relays carries (MINUTES(RELAY_FILTER_DELAY), 10 without MINUTES()): below 5, its triple EMA
75// would shift by a negative count; above 255, the count would wrap (EWMA_average< uint8_t >,
76// ewma_avg.hpp)
77static_assert(!RELAY_DIVERSION | (relays.filterDelay() * 60 / DATALOG_PERIOD_IN_SECONDS >= 5), "******** RELAY_FILTER_DELAY too short for DATALOG_PERIOD_IN_SECONDS: the filter must span at least 5 datalog periods ! ********");
78static_assert(!RELAY_DIVERSION | (relays.filterDelay() * 60 / DATALOG_PERIOD_IN_SECONDS <= UINT8_MAX), "******** RELAY_FILTER_DELAY too long for DATALOG_PERIOD_IN_SECONDS: the filter can span at most 255 datalog periods (21 minutes at 5 s) ! Please check your config.h ! ********");
79
80static_assert(NO_OF_DUMPLOADS > 0, "Number of dump loads must be greater than 0");
81static_assert(iTemperatureThreshold > 0, "Temperature threshold must be greater than 0");
82static_assert(iTemperatureThreshold <= 100, "Temperature threshold must be lower than 100");
83
84static_assert(REQUIRED_EXPORT_IN_WATTS >= -32768 && REQUIRED_EXPORT_IN_WATTS <= 32767, "******** REQUIRED_EXPORT_IN_WATTS out of range ! ********");
85static_assert(DIVERSION_START_THRESHOLD_WATTS >= 0 && DIVERSION_START_THRESHOLD_WATTS <= 32767, "******** DIVERSION_START_THRESHOLD_WATTS must be positive ! ********");
86
87static_assert(sizeof(physicalLoadPin) / sizeof(physicalLoadPin[0]) == NO_OF_DUMPLOADS, "******** physicalLoadPin array size mismatch (one entry per dump load) ! ********");
88static_assert(sizeof(loadPrioritiesAtStartup) / sizeof(loadPrioritiesAtStartup[0]) == NO_OF_DUMPLOADS, "******** loadPrioritiesAtStartup array size mismatch ! ********");
89
90static_assert(ROTATION_AFTER_SECONDS > 0, "******** ROTATION_AFTER_SECONDS must be greater than 0 ! ********");
91// compared with a 16-bit counter of seconds (Shared::absenceOfDivertedEnergyCountInSeconds)
92static_assert(ROTATION_AFTER_SECONDS < UINT16_MAX, "******** ROTATION_AFTER_SECONDS cannot exceed 65534 seconds (about 18 hours) ! ********");
93
94static_assert(!TEMP_SENSOR_PRESENT || (temperatureSensing.size() > 0), "******** No temperature sensors configured but TEMP_SENSOR_PRESENT is true ! ********");
95static_assert(!TEMP_SENSOR_PRESENT || (BOOST_TEMP_SENSOR < temperatureSensing.size()), "******** BOOST_TEMP_SENSOR must be one of the sensors in temperatureSensing (from 0) ! ********");
96// one 1-Wire transaction per mains cycle (temp_schedule.h): the conversion, 750 ms, then 3 per sensor
97static_assert(!TEMP_SENSOR_PRESENT || TempSchedule::fitsInPeriod(temperatureSensing.size(), SUPPLY_FREQUENCY, DATALOG_PERIOD_IN_MAINS_CYCLES), "******** Too many temperature sensors for DATALOG_PERIOD_IN_SECONDS: their conversion (750 ms) and reads must end within a datalog period. Lengthen DATALOG_PERIOD_IN_SECONDS ! ********");
98static_assert(TEMP_RANGE_LOW < TEMP_RANGE_HIGH, "******** Invalid temperature range ! ********");
99
107{
108 bool unique;
109 uint32_t used;
110};
111
117constexpr bool claimPin(uint32_t &used, const uint8_t pin)
118{
119 const uint8_t bit{ pin > 31 ? static_cast< uint8_t >(31) : pin };
120 const bool free{ !bit_read(used, bit) };
121 bit_set(used, bit);
122 return free;
123}
124
126{
127 uint32_t used_pins{ 0 };
128
129 if constexpr (TEMP_SENSOR_PRESENT)
130 {
131 if (temperatureSensing.get_pin() != unused_pin && !claimPin(used_pins, temperatureSensing.get_pin()))
132 return { false, 0 };
133 }
134
136 {
137 if (!claimPin(used_pins, diversionPin))
138 return { false, 0 };
139 }
140
142 {
143 if (!claimPin(used_pins, routerOffPin))
144 return { false, 0 };
145 }
146
147 if (rotationPin != unused_pin)
148 {
149 if (!claimPin(used_pins, rotationPin))
150 return { false, 0 };
151 }
152
154 {
155 if (!claimPin(used_pins, dualTariffPin))
156 return { false, 0 };
157 }
158
159 // Check override pins from the flexible override system
160 if constexpr (OVERRIDE_PIN_PRESENT)
161 {
162 for (uint8_t i = 0; i < overridePins.size(); ++i)
163 {
164 const uint8_t pin = overridePins.getPin(i);
165 if (pin != unused_pin)
166 {
167 if (!claimPin(used_pins, pin))
168 return { false, 0 };
169 }
170 }
171 }
172
173 if (watchDogPin != unused_pin)
174 {
175 if (!claimPin(used_pins, watchDogPin))
176 return { false, 0 };
177 }
178
179 // physicalLoadPin: the local TRIACs, plus the optional status LED of each remote load
180 for (const auto &loadEntry : physicalLoadPin)
181 {
182 const uint8_t pin{ Load::pinOf(loadEntry) };
183
184 // A remote load may legitimately have no status LED.
185 // Note that a local entry left at 'unused_pin' (0xFF) decodes as unit 3 / pin 63,
186 // which Load::isValidMap() rejects - the pin field alone cannot carry that sentinel.
187 if (!Load::isLocal(loadEntry) && (pin == 0))
188 continue;
189
190 // a wrong remote unit: Load::hasValidRemoteUnits() reports it
191 if (loadEntry == invalidRemoteUnitEntry)
192 continue;
193
194 // out of range for the bitmask: Load::isValidMap() reports it
195 if (pin > 15)
196 continue;
197
198 if (!claimPin(used_pins, pin))
199 return { false, 0 };
200 }
201
202 if constexpr (RELAY_DIVERSION)
203 {
204 for (uint8_t idx = 0; idx < relayDiverter.size(); ++idx)
205 {
206 const auto relayPin = relayDiverter.get_relay(idx).get_pin();
207
208 if (relayPin != unused_pin)
209 {
210 if (!claimPin(used_pins, relayPin))
211 return { false, 0 };
212 }
213 }
214 }
215
216 return { true, used_pins };
217}
218
219constexpr bool check_load_priorities()
220{
221 uint8_t _sum{ 0 };
222 uint16_t _enum_val{ 0 };
223
224 for (const auto &loadPrio : loadPrioritiesAtStartup)
225 {
226 // we check if a prio is used twice
227 if (bit_read(_enum_val, loadPrio))
228 return 0;
229
230 bit_set(_enum_val, loadPrio);
231
232 _sum += loadPrio;
233 }
234
235 // check if we have all prio between 0 and (NO_OF_DUMPLOADS - 1)
236 return _sum == ((NO_OF_DUMPLOADS * (NO_OF_DUMPLOADS - 1)) >> 1);
237}
238
245template< typename List >
246constexpr bool targetsAreOutputs(const List &list)
247{
248 uint16_t outputs{ 0 };
249
250 for (const auto &loadEntry : physicalLoadPin)
251 {
252 if (Load::isLocal(loadEntry))
253 bit_set(outputs, Load::pinOf(loadEntry));
254 }
255
256 if constexpr (RELAY_DIVERSION)
257 {
258 for (uint8_t idx = 0; idx < relayDiverter.size(); ++idx)
259 bit_set(outputs, relayDiverter.get_relay(idx).get_pin());
260 }
261
262 for (uint8_t i = 0; i != list.size(); ++i)
263 {
264 if (list.getLocalBitmask(i) & ~outputs)
265 return false;
266 }
267
268 return true;
269}
270
280template< typename List >
281constexpr bool targetsAreRemoteLoads(const List &list)
282{
283 // a local load on a pin from 16 on lands in the remote range of LOAD(): isValidMap() reports it
285 {
286 return true;
287 }
288
289 const uint16_t existing{ static_cast< uint16_t >((1U << NO_OF_REMOTE_LOADS) - 1) };
290
291 for (uint8_t i = 0; i != list.size(); ++i)
292 {
293 if (list.getRemoteBitmask(i) & ~existing)
294 return false;
295 }
296
297 return true;
298}
299
304{
305 if constexpr (OVERRIDE_PIN_PRESENT)
306 {
308 }
309 return true;
310}
311
316{
317 if constexpr (OVERRIDE_PIN_PRESENT)
318 {
320 }
321 return true;
322}
323
324constexpr uint16_t check_relay_pins()
325{
326 bool pins_ok{ true };
327
328 for (uint8_t idx = 0; idx < relayDiverter.size(); ++idx)
329 {
330 const auto relayPin = relayDiverter.get_relay(idx).get_pin();
331
332 if constexpr (RELAY_DIVERSION)
333 {
334 pins_ok &= (relayPin != unused_pin);
335 }
336 else
337 {
338 pins_ok &= (relayPin == unused_pin);
339 }
340 }
341
342 return pins_ok;
343}
344
349{
350 for (uint8_t idx = 0; idx < relayDiverter.size(); ++idx)
351 {
352 if (!relayDiverter.get_relay(idx).hasValidMinimumTimes())
353 {
354 return false;
355 }
356 }
357 return true;
358}
359
360static_assert(Load::hasValidRemoteUnits(physicalLoadPin), "******** Wrong remote unit ! Load::remote() takes a unit from 1 to 3. Please check physicalLoadPin in your config.h ! ********");
361static_assert(Load::isValidMap(physicalLoadPin), "******** Wrong load map ! Each local load needs a pin in 2..13. Please check physicalLoadPin in your config.h ! ********");
362static_assert(Load::maxLoadsPerUnit(physicalLoadPin) <= MAX_LOADS_PER_UNIT, "******** Too many loads on a single remote unit (one payload byte per unit) ! ********");
363static_assert(NO_OF_REMOTE_LOADS <= MAX_LOADS_PER_UNIT, "******** Too many remote loads (the override bitmask holds 8 of them) ! ********");
364static_assert(sizeof(RFConfig::REMOTE_NODE_ID) >= NO_OF_REMOTE_UNITS * sizeof(RFConfig::REMOTE_NODE_ID[0]), "******** REMOTE_NODE_ID needs one entry per remote unit ! Please check your config_rf.h ! ********");
365static_assert(areValidNodeIds(RFConfig::REMOTE_NODE_ID, NO_OF_REMOTE_UNITS, RFConfig::ROUTER_NODE_ID), "******** Remote node IDs must be unique, differ from the router and lie between 1 and 30 ! ********");
366
367static_assert(check_load_priorities(), "******** Load Priorities wrong ! Please check your config ! ********");
368static_assert(PRIORITY_ROTATION == RotationModes::OFF || rotationGroups.size() != 0, "******** Priority rotation is on but rotationGroups is empty ! Please check rotationGroups in your config.h ! ********");
369static_assert(PRIORITY_ROTATION != RotationModes::OFF || rotationGroups.size() == 0, "******** rotationGroups is set but priority rotation is OFF ! Please check rotationGroups in your config.h ! ********");
370static_assert(Rotation::targetsAreLoads(rotationGroups, physicalLoadPin), "******** A rotation group names something that is not a load ! Please check rotationGroups in your config.h ! ********");
371static_assert(Rotation::groupsHaveTwoLoads(rotationGroups, physicalLoadPin), "******** A rotation group needs at least 2 loads ! Please check rotationGroups in your config.h ! ********");
372static_assert(Rotation::noLoadTwice(rotationGroups, physicalLoadPin), "******** A load is listed twice in rotationGroups ! Please check rotationGroups in your config.h ! ********");
373static_assert(Rotation::groupsAreConsistent(rotationGroups, physicalLoadPin), "******** A rotation group mixes local and remote loads, or loads of two remote units ! Please check rotationGroups in your config.h ! ********");
374static_assert(check_pins().unique, "******** Duplicate pin definition ! Please check your config ! ********");
375static_assert((check_pins().used & B00000011) == 0, "******** Pins 0 & 1 are reserved for RX/TX ! Please check your config ! ********");
376static_assert((check_pins().used & 0xFFFFC000UL) == 0, "******** Pins 14 and above cannot be used (A0 to A5 are the analog inputs) ! Please check your config ! ********");
377static_assert(check_relay_pins(), "******** Wrong pin(s) configuration for relay(s) ********");
378static_assert(check_relay_minimum_times(), "******** A relay's minimum ON or OFF time cannot exceed 1092 minutes (about 18 hours) ! Please check relays in your config.h ! ********");
379static_assert(check_override_targets(), "******** An override pin forces a pin that is neither a local load nor a relay (REMOTE_LOAD() goes up to 7) ! Please check overridePins in your config.h ! ********");
380static_assert(check_override_remote_targets(), "******** An override pin forces a remote load that does not exist ! REMOTE_LOAD(n) counts from 0. Please check overridePins in your config.h ! ********");
381static_assert(!DUAL_TARIFF || targetsAreOutputs(boostSchedule), "******** A scheduled boost forces something that is neither a local load nor a relay (is relay diversion on? REMOTE_LOAD() goes up to 7). Please check scheduledBoosts in your config.h ! ********");
382static_assert(!DUAL_TARIFF || targetsAreRemoteLoads(boostSchedule), "******** A scheduled boost forces a remote load that does not exist (REMOTE_LOAD() counts from 0). Please check scheduledBoosts in your config.h ! ********");
383
384static_assert(!(RF_CHIP_PRESENT && ((check_pins().used & 0x3C04) != 0)), "******** Pins from RF chip are reserved ! Please check your config ! ********");
385static_assert(!(RF_CHIP_PRESENT && (SharedRF::ROUTER_NODE_ID < 1 || SharedRF::ROUTER_NODE_ID > 30)), "******** RF node ID must be between 1 and 30 ! ********");
386static_assert(!(RF_CHIP_PRESENT && (SharedRF::NETWORK_ID < 1 || SharedRF::NETWORK_ID > 250)), "******** RF network ID must be between 1 and 250 ! ********");
387
388#endif /* VALIDATION_H */
constexpr float alpha
Definition calibration.h:73
constexpr float lpf_gain
Definition calibration.h:72
constexpr uint8_t loadPrioritiesAtStartup[NO_OF_DUMPLOADS]
Definition config.h:91
constexpr bool ROUTER_OFF_PIN_PRESENT
Definition config.h:58
constexpr ScheduledBoosts scheduledBoosts
Definition config.h:172
constexpr bool RELAY_DIVERSION
Definition config.h:63
constexpr bool OVERRIDE_PIN_PRESENT
Definition config.h:60
constexpr uint32_t ROTATION_AFTER_SECONDS
Definition config.h:181
constexpr uint8_t dualTariffPin
Definition config.h:103
constexpr TemperatureSensing temperatureSensing
Definition config.h:177
constexpr RelayEngine relays
Definition config.h:130
constexpr uint8_t physicalLoadPin[NO_OF_DUMPLOADS]
Definition config.h:50
constexpr bool DUAL_TARIFF
Definition config.h:64
constexpr uint8_t diversionPin
Definition config.h:104
constexpr OverridePins overridePins
Definition config.h:157
constexpr RotationGroups rotationGroups
Definition config.h:100
constexpr uint8_t NO_OF_DUMPLOADS
Definition config.h:40
constexpr uint8_t ul_OFF_PEAK_DURATION
Definition config.h:159
constexpr bool TEMP_SENSOR_PRESENT
Definition config.h:65
constexpr int16_t iTemperatureThreshold
Definition config.h:174
constexpr uint8_t routerOffPin
Definition config.h:105
constexpr bool WATCHDOG_PIN_PRESENT
Definition config.h:62
constexpr uint8_t BOOST_TEMP_SENSOR
Definition config.h:175
constexpr bool DIVERSION_PIN_PRESENT
Definition config.h:57
constexpr uint8_t rotationPin
Definition config.h:106
constexpr uint8_t watchDogPin
Definition config.h:107
The configuration as the firmware uses it: the settings, and what is built from them.
constexpr float f_voltageCal[NO_OF_PHASES]
constexpr uint8_t NO_OF_REMOTE_UNITS
constexpr BoostSchedule boostSchedule
constexpr RelayDiverter relayDiverter
constexpr float f_powerCal[NO_OF_PHASES]
constexpr OverrideTable overrideTable
constexpr uint8_t NO_OF_REMOTE_LOADS
Basic configuration values to be set by the end-user.
constexpr int16_t REQUIRED_EXPORT_IN_WATTS
constexpr conditional< DATALOG_PERIOD_IN_SECONDS *SUPPLY_FREQUENCY >=UINT8_MAX, uint16_t, uint8_t >::type DATALOG_PERIOD_IN_MAINS_CYCLES
constexpr uint8_t DATALOG_PERIOD_IN_SECONDS
constexpr uint8_t SUPPLY_FREQUENCY
constexpr int16_t DIVERSION_START_THRESHOLD_WATTS
The CT filter: a low-pass of the current added back with a gain, one per phase.
Integer arithmetic of the datalog: power and RMS voltage per phase.
constexpr int16_t TEMP_RANGE_LOW
Definition ds18b20.h:35
constexpr int16_t TEMP_RANGE_HIGH
Definition ds18b20.h:36
uint8_t i
Integer arithmetic of the energy bucket.
constexpr uint8_t MAX_LOADS_PER_UNIT
Definition load_map.h:43
constexpr uint8_t invalidRemoteUnitEntry
The entry Load::remote() returns for a unit outside 1..MAX_REMOTE_UNITS.
Definition load_map.h:57
constexpr bool isAccurate(const float gain, const float alpha)
Whether the settings fit the fixed point, the coefficients within 1 % of them.
Definition ct_filter.h:95
constexpr uint16_t vrmsFactor(const uint8_t datalogPeriodInSeconds)
Scaling of the datalog voltage, Vrms_L_x100.
constexpr bool isValidVoltageCalibration(const uint16_t factor, const float(&cal)[N])
Check that the voltage calibration values can be represented.
constexpr bool isValidCalibration(const float(&cal)[N])
Check that the calibration values can be represented.
constexpr bool isLocal(uint8_t entry)
True if the entry describes a locally driven load.
Definition load_map.h:89
constexpr uint8_t maxLoadsPerUnit(const uint8_t(&map)[N])
Largest number of loads assigned to any single remote unit.
Definition load_map.h:144
constexpr uint8_t pinOf(uint8_t entry)
The pin of the entry: TRIAC pin if local, status LED (0 = none) if remote.
Definition load_map.h:101
constexpr bool isValidMap(const uint8_t(&map)[N])
Check that every entry of a load map designates a usable pin.
Definition load_map.h:258
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.
Definition load_map.h:288
constexpr uint8_t ROUTER_NODE_ID
Definition config_rf.h:47
constexpr uint8_t REMOTE_NODE_ID[]
Node ID of each remote load unit, unit 1 first (only if REMOTE_LOADS_PRESENT=true)
Definition config_rf.h:53
constexpr uint8_t NETWORK_ID
Definition config_rf.h:46
constexpr bool noLoadTwice(const RotationGroups< NG, MaxPins > &groups, const uint8_t(&loadMap)[NL])
No load is named twice, within a group or across groups.
constexpr bool targetsAreLoads(const RotationGroups< NG, MaxPins > &groups, const uint8_t(&loadMap)[NL])
Every code of every group stands for at least one load.
constexpr bool groupsHaveTwoLoads(const RotationGroups< NG, MaxPins > &groups, const uint8_t(&loadMap)[NL])
Every group holds at least 2 loads.
constexpr bool groupsAreConsistent(const RotationGroups< NG, MaxPins > &groups, const uint8_t(&loadMap)[NL])
In each group, every load is local, or every load is on the same remote unit.
constexpr bool fitsInPeriod(const uint8_t noOfSensors, const uint8_t supplyFrequency, const uint16_t periodCycles)
Whether a round ends within its datalog period.
constexpr bool areValidNodeIds(const uint8_t(&nodeIds)[NumIds], uint8_t numUnits, uint8_t routerId)
Check the node IDs of the first numUnits remote units.
When a load is boosted during the off-peak period.
Result of check_pins(): whether every pin is used once, and the pins used.
Definition validation.h:107
bool unique
Definition validation.h:108
uint32_t used
Definition validation.h:109
Which 1-Wire transaction of the temperature sensors runs on which mains cycle.
constexpr void bit_set(T &_dest, const uint8_t bit)
Set the specified bit to 1.
Definition utils_bits.h:30
constexpr uint8_t bit_read(const T &_src, const uint8_t bit)
Read the specified bit.
Definition utils_bits.h:44
constexpr uint8_t unused_pin
Definition utils_bits.h:20
Some utility functions for pins manipulation.
RF module support for RFM69.
constexpr bool RF_CHIP_PRESENT
Definition utils_rf.h:25
constexpr uint16_t check_relay_pins()
Definition validation.h:324
constexpr bool targetsAreOutputs(const List &list)
Overrides and boosts reach the outputs through the load states and the relay engine only,...
Definition validation.h:246
constexpr bool check_load_priorities()
Definition validation.h:219
constexpr bool targetsAreRemoteLoads(const List &list)
Each REMOTE_LOAD(n) target of an entry of list must be an existing remote load.
Definition validation.h:281
constexpr bool check_boost_windows()
Every scheduled boost lies within the off-peak period and lasts: otherwise, it never runs (LAST(HOURS...
Definition validation.h:57
constexpr bool claimPin(uint32_t &used, const uint8_t pin)
Marks pin as used in used.
Definition validation.h:117
constexpr bool check_override_targets()
Each override pin may only force local loads and relays.
Definition validation.h:303
constexpr bool check_override_remote_targets()
Each REMOTE_LOAD(n) target of an override pin must be an existing remote load.
Definition validation.h:315
constexpr bool check_relay_minimum_times()
Each relay's minimum ON and OFF times fit in 16 bits of seconds: 1092 minutes at most.
Definition validation.h:348
constexpr PinCheck check_pins()
Definition validation.h:125