33static_assert((PRIORITY_ROTATION ==
RotationModes::PIN) ^ (
rotationPin == 0xff),
"******** Wrong pin value for rotation command. Please check your config.h ! ********");
34static_assert(
OVERRIDE_PIN_PRESENT ^ (
forcePin == 0xff),
"******** Wrong pin value for override command. Please check your config.h ! ********");
37static_assert(
DUAL_TARIFF ^ (
dualTariffPin == 0xff),
"******** Wrong pin value for dual tariff. Please check your config.h ! ********");
39static_assert(!(
DUAL_TARIFF & (
ul_OFF_PEAK_DURATION > 12)),
"******** Off-peak duration cannot last more than 12 hours. Please check your config.h ! ********");
93 if (bitRead(used_pins, loadPin))
105 if (relayPin != 0xff)
107 if (bitRead(used_pins, relayPin))
120 bool pins_ok{
true };
128 pins_ok &= (relayPin != 0xff);
132 pins_ok &= (relayPin == 0xff);
159static_assert(
check_load_priorities(),
"******** Load Priorities wrong ! Please check your config ! ********");
160static_assert(
check_pins(),
"******** Duplicate pin definition ! Please check your config ! ********");
161static_assert((
check_pins() & B00000011) == 0,
"******** Pins 0 & 1 are reserved for RX/TX ! Please check your config ! ********");
162static_assert((
check_pins() & 0xC000) == 0,
"******** Pins 14 and/or 15 do not exist ! Please check your config ! ********");
163static_assert(!(
RF_CHIP_PRESENT && ((
check_pins() & 0x3C04) != 0)),
"******** Pins from RF chip are reserved ! Please check your config ! ********");
164static_assert(
check_relay_pins(),
"******** Wrong pin(s) configuration for relay(s) ********");
constexpr auto get_size() const
Get the number of relays.
constexpr const auto & get_relay(uint8_t idx) const
Get the relay object.
constexpr auto get_pin() const
Get the pin of the sensor(s)
Configuration values to be set by the end-user.
constexpr uint8_t loadPrioritiesAtStartup[NO_OF_DUMPLOADS]
constexpr bool RELAY_DIVERSION
constexpr bool OVERRIDE_PIN_PRESENT
constexpr uint8_t dualTariffPin
constexpr TemperatureSensing temperatureSensing
constexpr uint8_t forcePin
constexpr RelayEngine relays
constexpr uint8_t physicalLoadPin[NO_OF_DUMPLOADS]
constexpr bool DUAL_TARIFF
constexpr uint8_t diversionPin
constexpr bool EMONESP_CONTROL
constexpr uint8_t NO_OF_DUMPLOADS
constexpr uint8_t ul_OFF_PEAK_DURATION
constexpr bool WATCHDOG_PIN_PRESENT
constexpr bool DIVERSION_PIN_PRESENT
constexpr uint8_t rotationPin
constexpr uint8_t watchDogPin
Basic configuration values to be set by the end-user.
constexpr uint8_t DATALOG_PERIOD_IN_SECONDS
Some utility functions for pins manipulation.
constexpr void bit_set(T &_dest, const uint8_t bit)
Set the specified bit to 1.
constexpr uint8_t bit_read(const T &_src, const uint8_t bit)
Read the specified bit.
Some utility functions for the RF chip.
constexpr bool RF_CHIP_PRESENT
constexpr bool TEMP_SENSOR_PRESENT
constexpr uint16_t check_pins()
constexpr uint16_t check_relay_pins()
constexpr bool check_load_priorities()