DCF77 long wave receiver with 77,5 kHz

Device driver long wave receiver with 77,5 kHz. More...

Detailed Description

Device driver long wave receiver with 77,5 kHz.

Files

file  dcf77_internal.h
 Bit definitions for DCF77 transmission.
 
file  dcf77_params.h
 Default configuration for DCF77 devices.
 
file  dcf77.h
 Interface definition for the dcf77 sensor driver.
 

Data Structures

struct  dcf77_params_t
 Configuration parameters for DCF77 devices. More...
 
struct  dcf77
 Device descriptor for DCF77 sensor devices. More...
 

Typedefs

typedef void(* dcf77_tick_cb_t) (struct dcf77 *dev, void *arg)
 Signature for tick callback. More...
 
typedef struct dcf77 dcf77_t
 Device descriptor for DCF77 sensor devices.
 

Enumerations

enum  { DCF77_OK = 0, DCF77_NOCSUM = -1, DCF77_TIMEOUT = -2, DCF77_INIT_ERROR = -3 }
 Possible return codes. More...
 

Functions

int dcf77_init (dcf77_t *dev, const dcf77_params_t *params)
 Initialize a new DCF77 device. More...
 
int dcf77_get_time (dcf77_t *dev, struct tm *time)
 get a new timestamp from the device. More...
 
void dcf77_set_tick_cb (dcf77_t *dev, dcf77_tick_cb_t cb, void *arg)
 Set a tick callback for DCF77. More...
 

Typedef Documentation

◆ dcf77_tick_cb_t

typedef void(* dcf77_tick_cb_t) (struct dcf77 *dev, void *arg)

Signature for tick callback.

Parameters
[in]devdevice that triggered the alarm
[in]argoptional argument to put the callback in the right context

Definition at line 46 of file dcf77.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

Possible return codes.

Enumerator
DCF77_OK 

all good

DCF77_NOCSUM 

checksum error

DCF77_TIMEOUT 

communication timed out

DCF77_INIT_ERROR 

Initialization error.

Definition at line 51 of file dcf77.h.

Function Documentation

◆ dcf77_get_time()

int dcf77_get_time ( dcf77_t dev,
struct tm *  time 
)

get a new timestamp from the device.

Note
if reading fails or checksum is invalid, last_vaules will be unwritten
Parameters
[in]devdevice descriptor of a DCF device
[in]timedatastruct for timeinformation
Return values
<tt>DCF77_OK</tt>Success
<tt>DCF77_NOCSUM</tt>Checksum error

◆ dcf77_init()

int dcf77_init ( dcf77_t dev,
const dcf77_params_t params 
)

Initialize a new DCF77 device.

Parameters
[out]devdevice descriptor of a DCF device
[in]paramsconfiguration parameters
Return values
<tt>DCF77_OK</tt>Success
<tt>DCF77_INIT_ERROR</tt>Error in initialization

◆ dcf77_set_tick_cb()

void dcf77_set_tick_cb ( dcf77_t dev,
dcf77_tick_cb_t  cb,
void *  arg 
)

Set a tick callback for DCF77.

The registered callback function will be called for every new minute.

Parameters
[in]devdevice descriptor of a DCF device
[in]cbCallback executed when a new minute starts.
[in]argArgument passed to callback.