PixelKey
NeoPixel USB Key
Loading...
Searching...
No Matches
rtc.h
Go to the documentation of this file.
1#ifndef SERIAL_H
2#define SERIAL_H
3
11#include <stdlib.h>
12#include <stdint.h>
13#include <stdbool.h>
14#include <time.h>
15
16#include "pixelkey_errors.h"
17
19typedef int16_t rtc_tzoffset_t;
20
22typedef uint32_t rtc_period_ms_t;
23
25typedef struct st_rtc_api
26{
31 pixelkey_error_t (* time_get)(struct tm * p_time);
32
37 pixelkey_error_t (* time_set)(struct tm * const p_time);
38
39 rtc_tzoffset_t (* tzoffset_get)(void);
40 pixelkey_error_t (* tzoffset_set)(rtc_tzoffset_t tzoffset);
41
46 pixelkey_error_t (* timer_alarm_set)(rtc_period_ms_t period);
47
52 pixelkey_error_t (* calendar_alarm_set)(struct tm * const p_alarm_time);
53} rtc_api_t;
54
55rtc_api_t const * rtc(void);
56void rtc_register(rtc_api_t const * p_instance);
57
60#endif
uint32_t rtc_period_ms_t
Time period in milliseconds.
Definition: rtc.h:22
int16_t rtc_tzoffset_t
Time-zone offset from UTC in minutes.
Definition: rtc.h:19
pixelkey_error_t
PixelKey errors.
Definition: pixelkey_errors.h:11
Real-time clock interface abstraction.
Definition: rtc.h:26