|
LevelMeter-Display
2.0
An ultrasonic Level Meter for Stormwater Cisterns
|
Routines for setting and adjusting the Real Time Clock via DCF77. More...

Functions | |
| static uint8_t | BitsSet (uint8_t b) |
| Counts the Number of 1-Bits in a Byte. More... | |
| void | DCF77int (void) |
| Interrupt Handler for DCF77. More... | |
| int32_t | GetDCFdiff () |
| Gets the difference between DCF and RTC in seconds. Positive means RTC is late. More... | |
| static uint8_t | GetPinState (void) |
| Returns the logical Signal of the DCF Pin. More... | |
| void | Invalidate () |
| Invalidates Reception Variables, so Reception is started from scratch. More... | |
| static void | PushBit (uint8_t b) |
| Stores a Bit in the next Position of the Telegram. More... | |
Variables | |
| static uint8_t | bitcnt |
| counts the bits in the telegram More... | |
| int32_t | DCFdiff |
| Difference to RTC in Seconds, positive means RTC is late. More... | |
| bool | DCFInSync |
| True when a valid Telegram has been received. More... | |
| static uint8_t | dcfTicks |
| counts 10ms-intervals between the edges of the signal More... | |
| uint8_t | hour |
| The Hour Value received. More... | |
| static bool | lastPinState |
| The Pin State at last Interrupt. More... | |
| uint8_t | min |
| The Minute Value received. More... | |
| static bool | minpulseReceived |
| Did we receive a valid Minute Pulse (missing Pulse at second 59)? More... | |
| static const uint8_t | ms100max =14 |
| The maximum Pulse Width to be recognized as 100ms. More... | |
| static const uint8_t | ms100min =6 |
| The minimum Pulse Width to be recognized as 100ms. More... | |
| static const uint8_t | ms200max =23 |
| The maximum Pulse Width to be recognized as 200ms. More... | |
| static const uint8_t | ms200min =15 |
| The minimum Pulse Width to be recognized as 200ms. More... | |
| static const uint8_t | mspause59max =220 |
| The maximum Pulse Width to be recognized as a missing pulse. More... | |
| static const uint8_t | mspause59min =150 |
| The minimum Pulse Width to be recognized as a missing pulse. More... | |
| static const uint8_t | xorMask =0 |
| set to 0 or DCF77_PINMASK to invert signal More... | |
Routines for setting and adjusting the Real Time Clock via DCF77.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
|
static |
Counts the Number of 1-Bits in a Byte.
| b | The Byte |
Referenced by DCF77int().

| void DCF77int | ( | void | ) |
Interrupt Handler for DCF77.
Has to be called from 10ms interrupt
References bitcnt, BitsSet(), dcfTicks, DFLAG_DCF77, dFlags, GetPinState(), hour, hprintf_P(), Invalidate(), lastPinState, min, minpulseReceived, ms100max, ms100min, ms200max, ms200min, mspause59max, mspause59min, PushBit(), and RTCsync().
Referenced by ISR().


| int32_t GetDCFdiff | ( | ) |
|
inlinestatic |
Returns the logical Signal of the DCF Pin.
This function honors the invDCF77 configuration variable and returns a polarity corrected value of the DCF77 receive signal.
References config, DCF77_PIN, DCF77_PINMASK, confStruct_t::invDCF77, LEDBlueOff(), and LEDBlueOn().
Referenced by DCF77int().


| void Invalidate | ( | ) |
Invalidates Reception Variables, so Reception is started from scratch.
References bitcnt, DCFInSync, dcfTicks, hour, min, minpulseReceived, RTC_NORMAL, and RTCAdj.
Referenced by DCF77int(), InitDCF77(), and PushBit().

|
static |
Stores a Bit in the next Position of the Telegram.
References bitcnt, DFLAG_DCF77, dFlags, hour, hprintf_P(), Invalidate(), and min.
Referenced by DCF77int().


|
static |
counts the bits in the telegram
Referenced by DCF77int(), Invalidate(), and PushBit().
| int32_t DCFdiff |
Difference to RTC in Seconds, positive means RTC is late.
Referenced by GetDCFdiff(), and RTCsync().
| bool DCFInSync |
True when a valid Telegram has been received.
Referenced by CmdSetTime(), CmdStat(), Invalidate(), RTCsync(), and ShowScreen().
|
static |
counts 10ms-intervals between the edges of the signal
Referenced by DCF77int(), and Invalidate().
| uint8_t hour |
The Hour Value received.
Referenced by DCF77int(), Invalidate(), PushBit(), and RTCsync().
|
static |
The Pin State at last Interrupt.
Referenced by DCF77int().
| uint8_t min |
The Minute Value received.
Referenced by CmdSetTime(), DCF77int(), Invalidate(), PushBit(), and RTCsync().
|
static |
Did we receive a valid Minute Pulse (missing Pulse at second 59)?
Referenced by DCF77int(), and Invalidate().
|
static |
The maximum Pulse Width to be recognized as 100ms.
Referenced by DCF77int().
|
static |
The minimum Pulse Width to be recognized as 100ms.
Referenced by DCF77int().
|
static |
The maximum Pulse Width to be recognized as 200ms.
Referenced by DCF77int().
|
static |
The minimum Pulse Width to be recognized as 200ms.
Referenced by DCF77int().
|
static |
The maximum Pulse Width to be recognized as a missing pulse.
Referenced by DCF77int().
|
static |
The minimum Pulse Width to be recognized as a missing pulse.
Referenced by DCF77int().
|
static |
set to 0 or DCF77_PINMASK to invert signal
1.8.15