3-phase PV router
Loading...
Searching...
No Matches
config.h
Go to the documentation of this file.
1
12#ifndef CONFIG_H
13#define CONFIG_H
14
15//--------------------------------------------------------------------------------------------------
16//#define TEMP_ENABLED /**< this line must be commented out if the temperature sensor is not present */
17//#define RF_PRESENT /**< this line must be commented out if the RFM12B module is not present */
18
19// Output messages
20//#define EMONESP /**< Uncomment if an ESP WiFi module is used
21
22#define ENABLE_DEBUG
23#define SERIALPRINT
24//#define SERIALOUT /**< Uncomment if a wired serial connection is used */
25//--------------------------------------------------------------------------------------------------
26
27#include "config_system.h"
28#include "debug.h"
29#include "types.h"
30
31#include "utils_dualtariff.h"
32#include "utils_relay.h"
33#include "utils_temp.h"
34
35//--------------------------------------------------------------------------------------------------
36// constants which must be set individually for each system
37//
38inline constexpr uint8_t NO_OF_DUMPLOADS{ 2 };
40#ifdef EMONESP
41inline constexpr bool EMONESP_CONTROL{ true };
42inline constexpr bool DIVERSION_PIN_PRESENT{ true };
43inline constexpr RotationModes PRIORITY_ROTATION{ RotationModes::PIN };
44inline constexpr bool OVERRIDE_PIN_PRESENT{ true };
45#else
46inline constexpr bool EMONESP_CONTROL{ false };
47inline constexpr bool DIVERSION_PIN_PRESENT{ false };
48inline constexpr RotationModes PRIORITY_ROTATION{ RotationModes::OFF };
49inline constexpr bool OVERRIDE_PIN_PRESENT{ false };
50#endif
51
52inline constexpr bool WATCHDOG_PIN_PRESENT{ false };
53inline constexpr bool RELAY_DIVERSION{ false };
54inline constexpr bool DUAL_TARIFF{ false };
56// ----------- Pinout assignments -----------
57//
58// ANALOG pins are all reserved and hard-wired on the PCB
59//
60// DIGITAL pins:
61// D0 & D1 are reserved for the Serial i/f
62// - RFM12B -------------------------------
63// D2 is for the RFM12B if present
64// D10 is for the RFM12B if present
65// D11 is for the RFM12B if present
66// D12 is for the RFM12B if present
67// D13 is for the RFM12B if present
68// - SPI ----------------------------------
69// D10 is SC
70// D11 is MOSI
71// D12 is MISO
72// D13 is SCK
73
74inline constexpr uint8_t physicalLoadPin[NO_OF_DUMPLOADS]{ 5, 7 };
75inline constexpr uint8_t loadPrioritiesAtStartup[NO_OF_DUMPLOADS]{ 0, 1 };
77// Set the value to 0xff when the pin is not needed (feature deactivated)
78inline constexpr uint8_t dualTariffPin{ 0xff };
79inline constexpr uint8_t diversionPin{ 0xff };
80inline constexpr uint8_t rotationPin{ 0xff };
81inline constexpr uint8_t forcePin{ 0xff };
82inline constexpr uint8_t watchDogPin{ 0xff };
84inline constexpr RelayEngine relays{ { { 0xff, 1000, 200, 1, 1 } } };
86inline constexpr uint8_t ul_OFF_PEAK_DURATION{ 8 };
87inline constexpr pairForceLoad rg_ForceLoad[NO_OF_DUMPLOADS]{ { -3, 2 } };
89inline constexpr int16_t iTemperatureThreshold{ 100 };
92 { { 0x28, 0xBE, 0x41, 0x6B, 0x09, 0x00, 0x00, 0xA4 },
93 { 0x28, 0xED, 0x5B, 0x6A, 0x09, 0x00, 0x00, 0x9D },
94 { 0x28, 0xDB, 0x6D, 0x6A, 0x09, 0x00, 0x00, 0xDA },
95 { 0x28, 0x59, 0x1F, 0x6A, 0x09, 0x00, 0x00, 0xB0 },
96 { 0x28, 0x1B, 0xD7, 0x6A, 0x09, 0x00, 0x00, 0xB7 } } };
98inline constexpr uint32_t ROTATION_AFTER_CYCLES{ 8UL * 3600UL * SUPPLY_FREQUENCY };
100/* --------------------------------------
101 RF configuration (for the RFM12B module)
102 frequency options are RF12_433MHZ, RF12_868MHZ or RF12_915MHZ
103*/
104#ifdef RF_PRESENT
105
106#define RF69_COMPAT 0 // for the RFM12B
107// #define RF69_COMPAT 1 // for the RF69
108
109#define FREQ RF12_868MHZ
110
111inline constexpr int nodeID{ 10 };
112inline constexpr int networkGroup{ 210 };
113inline constexpr int UNO{ 1 };
115#endif // RF_PRESENT
116
117#endif // CONFIG_H
This class implements the relay management engine.
Definition: utils_relay.h:253
This class implements the temperature sensing feature.
Definition: utils_temp.h:47
Config parameters for overriding a load.
constexpr uint8_t loadPrioritiesAtStartup[NO_OF_DUMPLOADS]
Definition: config.h:75
constexpr bool RELAY_DIVERSION
Definition: config.h:53
constexpr int networkGroup
Definition: config.h:112
constexpr pairForceLoad rg_ForceLoad[NO_OF_DUMPLOADS]
Definition: config.h:87
constexpr bool OVERRIDE_PIN_PRESENT
Definition: config.h:49
constexpr uint8_t dualTariffPin
Definition: config.h:78
constexpr TemperatureSensing temperatureSensing
Definition: config.h:91
constexpr uint8_t forcePin
Definition: config.h:81
constexpr RelayEngine relays
Definition: config.h:84
constexpr uint8_t physicalLoadPin[NO_OF_DUMPLOADS]
Definition: config.h:74
constexpr uint32_t ROTATION_AFTER_CYCLES
Definition: config.h:98
constexpr int nodeID
Definition: config.h:111
constexpr bool DUAL_TARIFF
Definition: config.h:54
constexpr uint8_t diversionPin
Definition: config.h:79
constexpr int UNO
Definition: config.h:113
constexpr bool EMONESP_CONTROL
Definition: config.h:46
constexpr uint8_t NO_OF_DUMPLOADS
Definition: config.h:38
constexpr uint8_t ul_OFF_PEAK_DURATION
Definition: config.h:86
constexpr int16_t iTemperatureThreshold
Definition: config.h:89
constexpr bool WATCHDOG_PIN_PRESENT
Definition: config.h:52
constexpr bool DIVERSION_PIN_PRESENT
Definition: config.h:47
constexpr uint8_t rotationPin
Definition: config.h:80
constexpr uint8_t watchDogPin
Definition: config.h:82
Basic configuration values to be set by the end-user.
constexpr uint8_t SUPPLY_FREQUENCY
Definition: config_system.h:27
Some macro for the Serial Output and Debugging.
Some basics classes/types.
RotationModes
Definition: types.h:51
Some utility functions for dual tariff feature.
Some utility functions for the relay output feature.
Some utility functions for temperature sensor(s)