|
LevelMeter-Display
2.0
An ultrasonic Level Meter for Stormwater Cisterns
|
Go to the source code of this file.
Data Structures | |
| struct | displayMetrics_T |
| Parameters for each of the possible Displays. More... | |
| struct | displayValues_t |
| Holds all values used for Display Purposes. More... | |
Macros | |
| #define | ADCVoltsPerLSB (2.56/1024) |
| Voltage step for one LSB of the AD converter. More... | |
| #define | dividerP3 (4.7/(4.7+8.2)) |
| Resistor divider for P3. Gives 7.03V FSR or 6.86mV/LSB. More... | |
| #define | dividerP5 (4.7/(4.7+8.2)) |
| Resistor divider for P5. Gives 7.03V FSR or 6.86mV/LSB. More... | |
| #define | dividerSWUnreg (4.7/(4.7+68)) |
| Resistor divider for SWUnreg. Gives 39.6V FSR or 38.7mV/LSB. More... | |
| #define | dividerUnreg (4.7/(4.7+68)) |
| Resistor divider for Unreg. Gives 39.6V FSR or 38.7mV/LSB. More... | |
| #define | SCREENABSPAGE_VERSION 128 |
| Display Version Screen at startup. More... | |
| #define | SIGNAL_1_MASK 0b00000100 |
| #define | SIGNAL_2_MASK 0b00001000 |
| #define | SIGNAL_PORT PORTA |
| #define | WITH_UPDATE |
| Compile with Sensor Update Function. More... | |
Typedefs | |
| typedef uint8_t | delay_t |
| typedef double | LITERS_T |
| Remember that liters may go negative. More... | |
Enumerations | |
| enum | displayType_t { DISPLAY_2x16, DISPLAY_4x20, DISPLAY_ANALOG } |
| Constants for Display Type. More... | |
| enum | RTCAdj_t { RTC_NORMAL, RTC_FASTER, RTC_SLOWER } |
| Current speed of the RTC (Real Time Clock) More... | |
| enum | showScreen_t { SCREENSTEPAUTO, SCREENSTEPMANU, SCREENREFRESH, SCREENABSPAGE } |
| Command for ShowScreen() More... | |
Functions | |
| static void | BluetoothPowerOff (void) |
| Switches the Bluetooth Power off. More... | |
| static void | BluetoothPowerOn (void) |
| Switches the Bluetooth Power on. More... | |
| void | delay10ms (delay_t delay10ms) |
| Delay for a multiple of 10ms. More... | |
| static bool | GetSig1 (void) |
| Gets State of Optocoupler 1 True means Optocoupler is ON. More... | |
| static bool | GetSig2 (void) |
| Gets State of Optocoupler 2 True means Optocoupler is ON. More... | |
| static void | SensorPowerOff (void) |
| Switches the Sensor Power off. More... | |
| static void | SensorPowerOn (void) |
| Switches the Sensor Power on. More... | |
| void | SetAnalogPerCent (double perCent) |
| Sets the analog Instrument display. More... | |
| static void | Sig1OFF (void) |
| Switches Signal Output Optocoupler 1 to OFF. More... | |
| static void | Sig1ON (void) |
| Switches Signal Output Optocoupler 1 to ON. More... | |
| static void | Sig2OFF (void) |
| Switches Signal Output Optocoupler 2 to OFF. More... | |
| static void | Sig2ON (void) |
| Switches Signal Output Optocoupler 2 to ON. More... | |
Variables | |
| volatile uint8_t | blFlags |
| Boot Loader Communication Flags. More... | |
| uint16_t | bootLdAdr |
| The address of the page. More... | |
| static const uint8_t | BOOTLDDATA =2 |
| Boot Loader Data received ("=") More... | |
| static const uint8_t | BOOTLDERROR =8 |
| Boot Loader Error received ("-") More... | |
| static const uint8_t | BOOTLDHELLO =1 |
| Boot Loader Hello received ("*") More... | |
| static const uint8_t | BOOTLDOK =4 |
| Boot Loader Data received ("+") More... | |
| uint8_t | bootLdPage [] |
| Holds the data for boot loader write/read. More... | |
| static const uint8_t | BOOTLDPROTECTED =16 |
| Boot Loader Protected Area received ("P") More... | |
| static const uint8_t | CFLAG_BYTERECEIVED =32 |
| Received a Byte from the host. More... | |
| static const uint8_t | CFLAG_CHECKSUMERROR =8 |
| Checksum Error in received Telegram. More... | |
| static const uint8_t | CFLAG_CMDRECEIVED =16 |
| Received the terminating CR of a Command. More... | |
| static const uint8_t | CFLAG_PARITYERROR =4 |
| Parity Error in received Byte. More... | |
| static const uint8_t | CFLAG_TEMPRECEIVED =2 |
| Received the current Sensor Temperature. More... | |
| static const uint8_t | CFLAG_TIMERECEIVED =1 |
| Received a Travel Time from the Sensor. More... | |
| volatile uint8_t | cFlags |
| Flags set by Serial Communication with the Sensor. More... | |
| volatile char | cmdline [81] |
| Ready to hold 80 chars plus terminating 0. More... | |
| uint8_t | deadTime |
| Received dead time value from the sensor. More... | |
| static const uint8_t | DFLAG_DCF77 =1 |
| Gives information about DCF77 and RTC. More... | |
| static const uint8_t | DFLAG_SENSOR =2 |
| Gives information about Sensor Communication. More... | |
| volatile uint8_t | dFlags |
| Flags Controlling Debug Output. More... | |
| const displayMetrics_T | displayMetrics [] |
| Metrics for each of the possible displays. More... | |
| displayType_t | displayType |
| volatile uint8_t | hrCnt |
| Hours of the RTC. More... | |
| volatile uint8_t | minCnt |
| Minutes of the RTC. More... | |
| uint16_t | pulseTimeInt |
| Traveling time of the last pulse in timer1-clocks of the sensor CPU. More... | |
| uint8_t | pulseTimeMult |
| 1 or 8 clocks from sensor timer1 prescaler More... | |
| volatile RTCAdj_t | RTCAdj |
| Soft Adjustment of the RTC (+-1%) More... | |
| const char * | RTCAdjTxt [] |
| Human readable interpretation of RTCAdj. More... | |
| volatile uint8_t | secCnt |
| Seconds of the RTC. More... | |
| uint8_t | tempRaw |
| Raw value from the ADC. More... | |
| signed char | tempSemi |
| Temperature in 0.5°C. More... | |
| static const uint8_t | TFLAG_DAY =8 |
| Is set every Day at Midnight. More... | |
| static const uint8_t | TFLAG_HOUR =4 |
| Is set once per Hour at Minute 0. More... | |
| static const uint8_t | TFLAG_MIN =2 |
| Is set once per Minute at Second 0. More... | |
| static const uint8_t | TFLAG_SEC =1 |
| Is set once per Second. More... | |
| volatile uint8_t | tFlags |
| Flags set by Timer Interrupt to signal Main Loop. More... | |
| volatile uint8_t | tickCnt |
| counter for timer0 interrupts More... | |
| #define ADCVoltsPerLSB (2.56/1024) |
Voltage step for one LSB of the AD converter.
| #define dividerP3 (4.7/(4.7+8.2)) |
Resistor divider for P3. Gives 7.03V FSR or 6.86mV/LSB.
| #define dividerP5 (4.7/(4.7+8.2)) |
Resistor divider for P5. Gives 7.03V FSR or 6.86mV/LSB.
| #define dividerSWUnreg (4.7/(4.7+68)) |
Resistor divider for SWUnreg. Gives 39.6V FSR or 38.7mV/LSB.
| #define dividerUnreg (4.7/(4.7+68)) |
Resistor divider for Unreg. Gives 39.6V FSR or 38.7mV/LSB.
| #define SCREENABSPAGE_VERSION 128 |
Display Version Screen at startup.
| #define SIGNAL_1_MASK 0b00000100 |
| #define SIGNAL_2_MASK 0b00001000 |
| #define SIGNAL_PORT PORTA |
| #define WITH_UPDATE |
Compile with Sensor Update Function.
| typedef uint8_t delay_t |
| typedef double LITERS_T |
Remember that liters may go negative.
| enum displayType_t |
| enum RTCAdj_t |
| enum showScreen_t |
Command for ShowScreen()
|
inlinestatic |
Switches the Bluetooth Power off.
|
inlinestatic |
Switches the Bluetooth Power on.
| void delay10ms | ( | delay_t | delay10ms | ) |
Delay for a multiple of 10ms.
This function allows delays up to the range of delay_t controlled by the timer interrupt.
delay_t should be an unsigned integer type.
delaycnt must be decremented in the 100Hz-Interrupt.
This function of course takes care of the Watchdog and puts the CPU into sleep mode until the time expires.
| delay10ms | Delay in multiple of 10ms |
|
inlinestatic |
Gets State of Optocoupler 1 True means Optocoupler is ON.
|
inlinestatic |
Gets State of Optocoupler 2 True means Optocoupler is ON.
|
inlinestatic |
Switches the Sensor Power off.
|
inlinestatic |
Switches the Sensor Power on.
| void SetAnalogPerCent | ( | double | perCent | ) |
Sets the analog Instrument display.
| perCent | The value in a range from 0.0 to 100.0. Exceeding values will be trimmed correctly. |
|
inlinestatic |
Switches Signal Output Optocoupler 1 to OFF.
|
inlinestatic |
Switches Signal Output Optocoupler 1 to ON.
|
inlinestatic |
Switches Signal Output Optocoupler 2 to OFF.
|
inlinestatic |
Switches Signal Output Optocoupler 2 to ON.
| volatile uint8_t blFlags |
Boot Loader Communication Flags.
| uint16_t bootLdAdr |
The address of the page.
|
static |
Boot Loader Data received ("=")
|
static |
Boot Loader Error received ("-")
|
static |
Boot Loader Hello received ("*")
|
static |
Boot Loader Data received ("+")
| uint8_t bootLdPage[] |
Holds the data for boot loader write/read.
|
static |
Boot Loader Protected Area received ("P")
|
static |
Received a Byte from the host.
|
static |
Checksum Error in received Telegram.
|
static |
Received the terminating CR of a Command.
|
static |
Parity Error in received Byte.
|
static |
Received the current Sensor Temperature.
|
static |
Received a Travel Time from the Sensor.
| volatile uint8_t cFlags |
Flags set by Serial Communication with the Sensor.
The flags are set by serial interrupt and must be cleared by the main loop
| volatile char cmdline[81] |
Ready to hold 80 chars plus terminating 0.
| uint8_t deadTime |
Received dead time value from the sensor.
|
static |
Gives information about DCF77 and RTC.
|
static |
Gives information about Sensor Communication.
| volatile uint8_t dFlags |
Flags Controlling Debug Output.
| const displayMetrics_T displayMetrics[] |
Metrics for each of the possible displays.
| displayType_t displayType |
| volatile uint8_t hrCnt |
Hours of the RTC.
| volatile uint8_t minCnt |
Minutes of the RTC.
| uint16_t pulseTimeInt |
Traveling time of the last pulse in timer1-clocks of the sensor CPU.
| uint8_t pulseTimeMult |
1 or 8 clocks from sensor timer1 prescaler
| volatile RTCAdj_t RTCAdj |
Soft Adjustment of the RTC (+-1%)
| const char* RTCAdjTxt[] |
Human readable interpretation of RTCAdj.
| volatile uint8_t secCnt |
Seconds of the RTC.
| uint8_t tempRaw |
Raw value from the ADC.
| signed char tempSemi |
Temperature in 0.5°C.
|
static |
Is set every Day at Midnight.
|
static |
Is set once per Hour at Minute 0.
|
static |
Is set once per Minute at Second 0.
|
static |
Is set once per Second.
| volatile uint8_t tFlags |
Flags set by Timer Interrupt to signal Main Loop.
The flags are set each second, minute, hour or day respectively by timer interrupt. The flags must be cleared by the main loop.
| volatile uint8_t tickCnt |
counter for timer0 interrupts
1.8.3.1