LevelMeter-Display  2.0
An ultrasonic Level Meter for Stormwater Cisterns
config.h
Go to the documentation of this file.
1 
20 #ifndef CONFIG_H_
21 #define CONFIG_H_
22 
23 #include <stdbool.h>
24 #include <stdio.h>
25 #include "Display.h"
26 
27 #define CONF_MAGIC 0x3797
28 #define NUM_SIGNAL 2
29 
30 #define SNDMASK_ALERT1ALWAYS 1
31 #define SNDMASK_ALERT2ALWAYS 2
32 #define SNDMASK_HOURBELL 4
33 
34 typedef struct
36 {
37  uint16_t activeBelow;
38  uint16_t activeAbove;
40 
41 typedef enum {
45  } cisternType_T;
46 
48 typedef struct
49 { uint16_t magic;
53  double cistLength;
54  double cistHeight;
55  double cistCapacity;
56  uint8_t invDCF77;
57  uint8_t LCDV0;
58  uint8_t LCDBright;
59  double P3VoltsPerLSB;
60  double P5VoltsPerLSB;
64  uint8_t backlightOnTime;
65  uint8_t pageTime;
66  uint8_t pageTimeK;
67  signalOutput_t signalOutputs[NUM_SIGNAL];
68  uint8_t sndHourFrom;
69  uint8_t sndHourTo;
70  uint8_t sndMask;
71  uint8_t instCal;
72  bool useRts;
74 } confStruct_t;
75 extern bool configDirty;
76 
77 extern confStruct_t config;
78 void ReadConfig(void);
79 void WriteConfig(void);
80 void DumpConfigSignal(uint8_t number);
81 void DumpConfig(void);
82 bool SoundsOK(void);
83 
84 #endif /* CONFIG_H_ */
double P3VoltsPerLSB
Calibration Value for 3V3.
Definition: config.h:59
double SWUnregVoltsPerLSB
Calibration Value for Switched Unreg.
Definition: config.h:62
bool useRts
Shall the serial communication use RTS/CTS-handshake?
Definition: config.h:72
double cistAreaOrDiameter
Surface Area of the Cistern (const) or Diameter (horizontal Cylinder or Sphere)
Definition: config.h:52
displayType_t displayType
The display type used.
Definition: config.h:50
void WriteConfig(void)
Writes the Config-Struct to EEPROM.
Definition: config.c:156
Holds all Configuration Data stored in EEPROM.
Definition: config.h:48
void DumpConfigSignal(uint8_t number)
DumpConfig Helper Function for Optocoupler outputs.
Definition: config.c:168
uint8_t sndMask
Flags for special sound treatment.
Definition: config.h:70
cisternType_T
Definition: config.h:41
Cistern with constant area over volume.
Definition: config.h:42
uint8_t LCDV0
Control Voltage for LCD Contrast.
Definition: config.h:57
uint8_t pageTime
Delay for automatic stepping of display pages (0 means no automatic stepping)
Definition: config.h:65
uint8_t invDCF77
Invert the DCF77 Pin?
Definition: config.h:56
uint8_t sndHourFrom
Sounds are only played if current hour is greater or equal.
Definition: config.h:68
Holds the Thresholds for a Signal Optocoupler Output.
Definition: config.h:35
Cistern of horizontal cylinder type.
Definition: config.h:43
double spontaneousReportVolume
Volume is sent over serial if difference to last reported is greater.
Definition: config.h:73
double cistCapacity
Capacity of the cistern in liters (used for %-calculation)
Definition: config.h:55
uint16_t activeAbove
Threshold above this the output is active.
Definition: config.h:38
displayType_t
Constants for Display Type.
Definition: display.h:128
double cistHeight
Height of the Sensor over Cistern Ground.
Definition: config.h:54
double cistLength
Length of the Cistern (horizontal Cylinder Type only)
Definition: config.h:53
void DumpConfig(void)
Lists the current configuration values.
Definition: config.c:193
uint16_t magic
Used to discover unprogrammed Devices.
Definition: config.h:49
#define NUM_SIGNAL
Number of available signal outputs.
Definition: config.h:28
uint8_t pageTimeK
Delay for switchback from manual stepping by key to automatic stepping.
Definition: config.h:66
bool configDirty
Set to true by routines affecting configuration if config memory needs to be saved to the EEPROM.
Definition: config.c:116
confStruct_t config
The Configuration. It is read on startup from the EEPROM.
Definition: config.c:32
bool backlightAlwaysOn
Shall the Backlight always be lit?
Definition: config.h:63
Spherical cistern.
Definition: config.h:44
double UnregVoltsPerLSB
Calibration Value for Unreg.
Definition: config.h:61
double P5VoltsPerLSB
Calibration Value for 5V.
Definition: config.h:60
cisternType_T cisternType
The shape of the cistern.
Definition: config.h:51
uint16_t activeBelow
Threshold below this the output is active.
Definition: config.h:37
bool SoundsOK(void)
Checks if sounds may currently be played.
Definition: config.c:125
uint8_t instCal
Calibration value for analog instrument.
Definition: config.h:71
void ReadConfig(void)
Reads the Config-Struct from EEPROM into config.
Definition: config.c:144
uint8_t backlightOnTime
Time the Backlight will stay on after Key Press in Seconds.
Definition: config.h:64
uint8_t LCDBright
LCD Brightness.
Definition: config.h:58
uint8_t sndHourTo
Sounds are only played if current hour is less than this.
Definition: config.h:69