LevelMeter-Display  2.0
An ultrasonic Level Meter for Stormwater Cisterns
Macros | Functions | Variables
dcf77.h File Reference
Include dependency graph for dcf77.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define DCF77_DDR   DDRA
 
#define DCF77_PIN   PINA
 
#define DCF77_PINMASK   (1<<1)
 
#define DCF77_PORT   PORTA
 

Functions

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 void InitDCF77 (void)
 Initializes the DCF77-Variables. More...
 
void Invalidate ()
 Invalidates Reception Variables, so Reception is started from scratch. More...
 
static void RTCsync (void)
 Synchronizes the RTC with DCF77. More...
 

Variables

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...
 
uint8_t hour
 The Hour Value received. More...
 
uint8_t min
 The Minute Value received. More...
 

Macro Definition Documentation

◆ DCF77_DDR

#define DCF77_DDR   DDRA

◆ DCF77_PIN

#define DCF77_PIN   PINA

◆ DCF77_PINMASK

#define DCF77_PINMASK   (1<<1)

◆ DCF77_PORT

#define DCF77_PORT   PORTA

Function Documentation

◆ 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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetDCFdiff()

int32_t GetDCFdiff ( )

Gets the difference between DCF and RTC in seconds. Positive means RTC is late.

References DCFdiff.

Referenced by CmdStat().

Here is the caller graph for this function:

◆ InitDCF77()

static void InitDCF77 ( void  )
inlinestatic

Initializes the DCF77-Variables.

Must be called during system initialization

References DCF77_DDR, DCF77_PINMASK, DCF77_PORT, and Invalidate().

Referenced by Init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Invalidate()

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().

Here is the caller graph for this function:

◆ RTCsync()

static void RTCsync ( void  )
inlinestatic

Synchronizes the RTC with DCF77.

References DCFdiff, DCFInSync, DFLAG_DCF77, dFlags, hour, hprintf_P(), hrCnt, min, minCnt, RTC_FASTER, RTC_NORMAL, RTC_SLOWER, RTCAdj, RTCAdjTxt, secCnt, and tickCnt.

Referenced by DCF77int().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ DCFdiff

int32_t DCFdiff

Difference to RTC in Seconds, positive means RTC is late.

Referenced by GetDCFdiff(), and RTCsync().

◆ DCFInSync

bool DCFInSync

True when a valid Telegram has been received.

Referenced by CmdSetTime(), CmdStat(), Invalidate(), RTCsync(), and ShowScreen().

◆ hour

uint8_t hour

The Hour Value received.

Referenced by DCF77int(), Invalidate(), PushBit(), and RTCsync().

◆ min

uint8_t min

The Minute Value received.

Referenced by CmdSetTime(), DCF77int(), Invalidate(), PushBit(), and RTCsync().