1-phase PV router
Loading...
Searching...
No Matches
config.h
Go to the documentation of this file.
1
11
12#ifndef CONFIG_H
13#define CONFIG_H
14
15//--------------------------------------------------------------------------------------------------
16//#define RF_PRESENT /**< this line must be commented out if the RFM12B module is not present */
17
18// Output messages
19//#define EMONESP /**< Uncomment if an ESP WiFi module is used
20
21#define ENABLE_DEBUG
22#define SERIALPRINT
23#define SERIALOUT
24//--------------------------------------------------------------------------------------------------
25
26#include "config_system.h"
27#include "debug.h"
28#include "types.h"
29
30#include "utils_dualtariff.h"
31#include "utils_relay.h"
32
34
35inline constexpr uint8_t NO_OF_DUMPLOADS{ 1 };
36
37inline constexpr bool EMONESP_CONTROL{ false };
38inline constexpr bool DIVERSION_PIN_PRESENT{ true };
39inline constexpr RotationModes PRIORITY_ROTATION{ RotationModes::OFF };
40inline constexpr bool OVERRIDE_PIN_PRESENT{ true };
41
42inline constexpr bool WATCHDOG_PIN_PRESENT{ false };
43inline constexpr bool RELAY_DIVERSION{ false };
44inline constexpr bool DUAL_TARIFF{ false };
45inline constexpr bool TEMP_SENSOR_PRESENT{ false };
46
47#include "utils_temp.h"
48
49inline constexpr bool OLD_PCB{ false };
50
52
54// WARNING: the 7-seg display uses a lot of pins (Old PCB only !)
55//
56// For SEG_HW (Hardware-Driven Display)
57// Pins: 5, 6, 7, 8, 9, 14, 15, 16
58// Pins 2, 3, 4, 10, 11, 12, 13 are available for other uses (e.g. triac, relay control, diversion pin, etc.)
59//
60// For SEG (Software-Driven Display)
61// Pins: 2, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16
62// Only 3 pins, 3, 4 and 15, are available for other uses (e.g. triac, relay control, diversion pin, etc.)
63//
64
66// allocation of digital pins which are not dependent on the display type that is in use
67//
68inline constexpr uint8_t physicalLoadPin[NO_OF_DUMPLOADS]{ 4 };
69inline constexpr uint8_t loadPrioritiesAtStartup[NO_OF_DUMPLOADS]{ 0 };
70
72// Set the value to 0xff when the pin is not needed (feature deactivated)
73inline constexpr uint8_t dualTariffPin{ 0xff };
74inline constexpr uint8_t diversionPin{ 15 };
75inline constexpr uint8_t rotationPin{ 0xff };
76inline constexpr uint8_t forcePin{ 3 };
77inline constexpr uint8_t watchDogPin{ 0xff };
78
79inline constexpr RelayEngine relays{ { { 0xff, 1000, 200, 1, 1 } } };
80
82// Dual tariff configuration
83inline constexpr uint8_t ul_OFF_PEAK_DURATION{ 8 };
84inline constexpr pairForceLoad rg_ForceLoad[NO_OF_DUMPLOADS]{ { -3, 2 } };
85
87// Temperature sensor configuration
88inline constexpr int16_t iTemperatureThreshold{ 100 };
90 { { 0x28, 0x1B, 0xD7, 0x6A, 0x09, 0x00, 0x00, 0xB7 } } };
91
92inline constexpr uint16_t ROTATION_AFTER_SECONDS{ 8u * 3600u };
93
94#endif /* CONFIG_H */
Manages a collection of relays and their behavior based on surplus and import thresholds.
Implements temperature sensing functionality for multiple sensors.
Definition utils_temp.h:106
Config parameters for overriding a load.
constexpr uint8_t loadPrioritiesAtStartup[NO_OF_DUMPLOADS]
Definition config.h:69
constexpr bool RELAY_DIVERSION
Definition config.h:43
constexpr pairForceLoad rg_ForceLoad[NO_OF_DUMPLOADS]
Definition config.h:84
constexpr bool OVERRIDE_PIN_PRESENT
Definition config.h:40
constexpr uint8_t dualTariffPin
Definition config.h:73
constexpr TemperatureSensing temperatureSensing
Definition config.h:89
constexpr uint8_t forcePin
Definition config.h:76
constexpr RelayEngine relays
Definition config.h:79
constexpr uint8_t physicalLoadPin[NO_OF_DUMPLOADS]
Definition config.h:68
constexpr bool DUAL_TARIFF
Definition config.h:44
constexpr uint8_t diversionPin
Definition config.h:74
constexpr SerialOutputType SERIAL_OUTPUT_TYPE
Definition config.h:33
constexpr bool OLD_PCB
Definition config.h:49
constexpr bool EMONESP_CONTROL
Definition config.h:37
constexpr uint16_t ROTATION_AFTER_SECONDS
Definition config.h:92
constexpr uint8_t NO_OF_DUMPLOADS
Definition config.h:35
constexpr DisplayType TYPE_OF_DISPLAY
Definition config.h:51
constexpr uint8_t ul_OFF_PEAK_DURATION
Definition config.h:83
constexpr bool TEMP_SENSOR_PRESENT
Definition config.h:45
constexpr int16_t iTemperatureThreshold
Definition config.h:88
constexpr bool WATCHDOG_PIN_PRESENT
Definition config.h:42
constexpr bool DIVERSION_PIN_PRESENT
Definition config.h:38
constexpr uint8_t rotationPin
Definition config.h:75
constexpr uint8_t watchDogPin
Definition config.h:77
Basic configuration values to be set by the end-user.
Some macro for the Serial Output and Debugging.
Some basics classes/types.
RotationModes
Definition types.h:59
SerialOutputType
Definition types.h:26
DisplayType
Definition types.h:67
Some utility functions for dual tariff feature.
Some utility functions for the relay output feature.
Provides utilities for managing temperature sensors.