Device driver long wave receiver with 77,5 kHz.
More...
Device driver long wave receiver with 77,5 kHz.
|
typedef void(* | dcf77_tick_cb_t) (struct dcf77 *dev, void *arg) |
| Signature for tick callback.
|
|
typedef struct dcf77 | dcf77_t |
| Device descriptor for DCF77 sensor devices.
|
|
◆ dcf77_tick_cb_t
typedef void(* dcf77_tick_cb_t) (struct dcf77 *dev, void *arg) |
Signature for tick callback.
- Parameters
-
[in] | dev | device that triggered the alarm |
[in] | arg | optional argument to put the callback in the right context |
Definition at line 46 of file dcf77.h.
◆ 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.
◆ 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] | dev | device descriptor of a DCF device |
[in] | time | datastruct for timeinformation |
- Return values
-
`DCF77_OK` | Success |
`DCF77_NOCSUM` | Checksum error |
◆ dcf77_init()
Initialize a new DCF77 device.
- Parameters
-
[out] | dev | device descriptor of a DCF device |
[in] | params | configuration parameters |
- Return values
-
`DCF77_OK` | Success |
`DCF77_INIT_ERROR` | Error in initialization |
◆ dcf77_set_tick_cb()
Set a tick callback for DCF77.
The registered callback function will be called for every new minute.
- Parameters
-
[in] | dev | device descriptor of a DCF device |
[in] | cb | Callback executed when a new minute starts. |
[in] | arg | Argument passed to callback. |