#include "boole.h"
#include "dcftime.h"
Include dependency graph for dcftime.c:
Go to the source code of this file.
Data Structures | |
struct | dcf_receiving_data_struct |
format of the received data, filled during reception More... | |
struct | dcf_data_struct |
format of the DCF data. More... | |
Typedefs | |
typedef unsigned int | dcf_sample |
number of the current sample | |
typedef unsigned int | dcf_sizetype |
used for the size of a month | |
typedef enum dcf_logic_signal_enum | dcf_logic_signal |
definition of logical signal states | |
typedef dcf_receiving_data_struct | dcf_receiving_data |
definition of the received data, filled during reception | |
Enumerations | |
enum | dcf_logic_signal_enum { dcf_signal_no, dcf_signal_false, dcf_signal_true, dcf_signal_invalid } |
definition of logical signal states 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). | |
Variables | |
const dcf_sample | dcf_second_samples = (DCF_RATE) |
number of samples per second | |
const dcf_sample | dcf_logic_false_min = (DCF_RATE)*3/100 |
dcf signal between 30ms and 130ms => dcf logic false (lower value) | |
const dcf_sample | dcf_logic_false_max = (DCF_RATE)*13/100 |
dcf signal between 30ms and 130ms => dcf logic false (upper value) | |
const dcf_sample | dcf_logic_true_min = (DCF_RATE)*14/100 |
dcf signal between 140ms and 230ms => dcf logic true (lower value) | |
const dcf_sample | dcf_logic_true_max = (DCF_RATE)*23/100 |
dcf signal between 140ms and 230ms => dcf logic true (upper value) | |
const dcf_sample | dcf_second_tolerance_min = (DCF_RATE) - (DCF_RATE)*3/100 |
duration between begin of dcf second (== begin of signal), should be 1 * second +/- 3% (lower value) | |
const dcf_sample | dcf_second_tolerance_max = (DCF_RATE) + (DCF_RATE)*3/100 |
duration between begin of dcf second (== begin of signal), should be 1 * second +/- 3% (upper value) |
Definition in file dcftime.c.
typedef enum dcf_logic_signal_enum dcf_logic_signal |
typedef struct dcf_receiving_data_struct dcf_receiving_data |
typedef unsigned int dcf_sample |
typedef unsigned int dcf_sizetype |
dcf_datetime dcf_current_datetime | ( | void | ) |
Fetch the current date and time.
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 | ) |
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 | ) |
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.
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().
const dcf_sample dcf_logic_false_max = (DCF_RATE)*13/100 |
dcf signal between 30ms and 130ms => dcf logic false (upper value)
Definition at line 24 of file dcftime.c.
Referenced by dcf_signal().
const dcf_sample dcf_logic_false_min = (DCF_RATE)*3/100 |
dcf signal between 30ms and 130ms => dcf logic false (lower value)
Definition at line 22 of file dcftime.c.
Referenced by dcf_signal().
const dcf_sample dcf_logic_true_max = (DCF_RATE)*23/100 |
dcf signal between 140ms and 230ms => dcf logic true (upper value)
Definition at line 28 of file dcftime.c.
Referenced by dcf_signal().
const dcf_sample dcf_logic_true_min = (DCF_RATE)*14/100 |
dcf signal between 140ms and 230ms => dcf logic true (lower value)
Definition at line 26 of file dcftime.c.
Referenced by dcf_signal().
const dcf_sample dcf_second_samples = (DCF_RATE) |
const dcf_sample dcf_second_tolerance_max = (DCF_RATE) + (DCF_RATE)*3/100 |
const dcf_sample dcf_second_tolerance_min = (DCF_RATE) - (DCF_RATE)*3/100 |