firmware/dcftime.h File Reference

Decoder for DCF-77 time signals. More...

#include "boole.h"

Include dependency graph for dcftime.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  dcf_time_struct
 format of the dcf_time More...
struct  dcf_date_struct
 format of the dcf_date More...
struct  dcf_datetime_struct
 format of the dcf_datetime More...

Defines

#define DCF_RATE   244
 number of samples per second.

Typedefs

typedef unsigned int dcf_second
 seconds (0-59)
typedef unsigned int dcf_minute
 minutes (0-59)
typedef unsigned int dcf_hour
 hours (0-24)
typedef unsigned int dcf_dayofmonth
 day of month (1-31)
typedef unsigned int dcf_year
 year (0-99)
typedef boolean dcf_is_dst
 daylight saving: True: MESZ, False: MEZ
typedef enum dcf_dayofweek_enum dcf_dayofweek
 definition of weekdays
typedef enum dcf_month_enum dcf_month
 definition of months
typedef dcf_time_struct dcf_time
 definition of dcf_time
typedef dcf_date_struct dcf_date
 definition of dcf_date
typedef dcf_datetime_struct dcf_datetime
 definition of dcf_datetime

Enumerations

enum  dcf_dayofweek_enum {
  dcf_monday = 1, dcf_tuesday, dcf_wednesday, dcf_thursday,
  dcf_friday, dcf_saturday, dcf_sunday
}
 definition of weekdays More...
enum  dcf_month_enum {
  dcf_january = 1, dcf_february, dcf_march, dcf_april,
  dcf_may, dcf_june, dcf_july, dcf_august,
  dcf_september, dcf_october, dcf_november, dcf_december
}
 definition of months More...

Functions

void dcf_init (void)
 Initialize the DCF-module.
void dcf_signal (boolean signal)
 Tell the DCF-module if the signal is high or low.
dcf_datetime dcf_current_datetime (void)
 Fetch the current date and time.
const char * dcf_dayofweek_name (dcf_dayofweek dow)
 Get the name of the current weekday.
const char * dcf_is_dst_name (dcf_is_dst dst)
 Get the name of the current daylight saving time (summertime, wintertime).


Detailed Description

Decoder for DCF-77 time signals.

Author:
Ronald Schaten & Thomas Stegemann
Version:
Id
dcftime.h,v 1.2 2007/01/03 12:38:55 rschaten Exp
License: See documentation.

Definition in file dcftime.h.


Define Documentation

#define DCF_RATE   244

number of samples per second.

dcf_signal() should be called this often

Definition at line 19 of file dcftime.h.


Typedef Documentation

typedef struct dcf_date_struct dcf_date

definition of dcf_date

Definition at line 81 of file dcftime.h.

typedef struct dcf_datetime_struct dcf_datetime

definition of dcf_datetime

Definition at line 91 of file dcftime.h.

typedef unsigned int dcf_dayofmonth

day of month (1-31)

Definition at line 28 of file dcftime.h.

typedef enum dcf_dayofweek_enum dcf_dayofweek

definition of weekdays

Definition at line 43 of file dcftime.h.

typedef unsigned int dcf_hour

hours (0-24)

Definition at line 27 of file dcftime.h.

typedef boolean dcf_is_dst

daylight saving: True: MESZ, False: MEZ

Definition at line 30 of file dcftime.h.

typedef unsigned int dcf_minute

minutes (0-59)

Definition at line 26 of file dcftime.h.

typedef enum dcf_month_enum dcf_month

definition of months

Definition at line 61 of file dcftime.h.

typedef unsigned int dcf_second

seconds (0-59)

Definition at line 25 of file dcftime.h.

typedef struct dcf_time_struct dcf_time

definition of dcf_time

Definition at line 71 of file dcftime.h.

typedef unsigned int dcf_year

year (0-99)

Definition at line 29 of file dcftime.h.


Enumeration Type Documentation

enum dcf_dayofweek_enum

definition of weekdays

Enumerator:
dcf_monday  monday = 1
dcf_tuesday  tuesday
dcf_wednesday  wednesday
dcf_thursday  thursday
dcf_friday  friday
dcf_saturday  saturday
dcf_sunday  sunday = 7

Definition at line 33 of file dcftime.h.

enum dcf_month_enum

definition of months

Enumerator:
dcf_january  january = 1
dcf_february  february
dcf_march  march
dcf_april  april
dcf_may  may
dcf_june  june
dcf_july  july
dcf_august  august
dcf_september  september
dcf_october  october
dcf_november  november
dcf_december  december = 12

Definition at line 46 of file dcftime.h.


Function Documentation

dcf_datetime dcf_current_datetime ( void   ) 

Fetch the current date and time.

Returns:
The current date and time in a dcf_datetime structure

Definition at line 407 of file dcftime.c.

References dcf_data_struct::current_datetime, dcf_datetime_struct::has_signal, dcf_receiving_data_struct::is_valid, dcf_data_struct::receiving_data, and dcf_data_struct::use_first_current_datetime.

Referenced by timerInterrupt().

const char* dcf_dayofweek_name ( dcf_dayofweek  dow  ) 

Get the name of the current weekday.

Parameters:
dow Day of the current week. Monday = 1, tuesday = 2...
Returns:
Pointer to the name

Definition at line 417 of file dcftime.c.

void dcf_init ( void   ) 

Initialize the DCF-module.

Call dcf_init before any other DCF function.

Definition at line 350 of file dcftime.c.

References dcf_data_struct::current_datetime, dcf_data_struct::current_datetime_sample, dcf_data_struct::receiving_data, True, and dcf_data_struct::use_first_current_datetime.

Referenced by main().

const char* dcf_is_dst_name ( dcf_is_dst  dst  ) 

Get the name of the current daylight saving time (summertime, wintertime).

Parameters:
dst daylight saving time bit from the time signal
Returns:
Pointer to the name

Definition at line 438 of file dcftime.c.

void dcf_signal ( boolean  signal  ) 

Tell the DCF-module if the signal is high or low.

This function decides if the received bit is a long or a short one, and if it is usable at all. It should be called regularly, the number of calls per second is defined in DCF_RATE.

Parameters:
signal True if the input signal is high, False if it is low.

Definition at line 358 of file dcftime.c.

References dcf_data_struct::current_datetime_sample, dcf_receiving_data_struct::current_signal, dcf_logic_false_max, dcf_logic_false_min, dcf_logic_true_max, dcf_logic_true_min, dcf_second_samples, dcf_signal_false, dcf_signal_invalid, dcf_signal_true, False, dcf_receiving_data_struct::high_samples, dcf_receiving_data_struct::is_valid, dcf_receiving_data_struct::low_samples, dcf_data_struct::receiving_data, dcf_time_struct::second, dcf_receiving_data_struct::time, and True.

Referenced by timerInterrupt().


Generated on Wed Jan 3 22:22:44 2007 for Binary DCF-77 Clock by  doxygen 1.5.1