Firmware SDK
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
bc_rtc.h
1 #ifndef _BC_RTC_H
2 #define _BC_RTC_H
3 
4 #include "bc_common.h"
5 
9 
11 
12 void bc_rtc_init(void);
13 
15 typedef struct
16 {
17  uint8_t seconds;
18  uint16_t subseconds;
19  uint8_t minutes;
20  uint8_t hours;
21  uint8_t week_day;
22  uint8_t date;
23  uint8_t month;
24  uint16_t year;
25  uint32_t timestamp;
26 } bc_rtc_t;
27 
30 
32 
37 
39 
43 
44 uint32_t bc_rtc_rtc_to_timestamp(bc_rtc_t *rtc);
45 
46 
48 
49 #endif // _BC_RTC_H
uint8_t seconds
Seconds parameter, from 00 to 59.
Definition: bc_rtc.h:17
uint8_t hours
Hours parameter, 24Hour mode, 00 to 23.
Definition: bc_rtc.h:20
void bc_rtc_get_date_time(bc_rtc_t *rtc)
Get date and time from RTC.
Definition: bc_rtc.c:52
uint32_t timestamp
Seconds from 01.01.1970 00:00:00.
Definition: bc_rtc.h:25
uint8_t week_day
Day in a week, from 1 to 7.
Definition: bc_rtc.h:21
uint8_t minutes
Minutes parameter, from 00 to 59.
Definition: bc_rtc.h:19
uint8_t month
Month in a year, 1 to 12.
Definition: bc_rtc.h:23
uint16_t subseconds
Subsecond downcounter. When it reaches zero, it's reload value is the same as RTC_SYNC_PREDIV.
Definition: bc_rtc.h:18
uint32_t bc_rtc_rtc_to_timestamp(bc_rtc_t *rtc)
Covert RTC to timestamp.
Definition: bc_rtc.c:23
void bc_rtc_init(void)
Initialize real-time clock.
Definition: bc_rtc.c:19
uint8_t date
Date in a month, 1 to 31.
Definition: bc_rtc.h:22
bool bc_rtc_set_date_time(bc_rtc_t *rtc)
Set gate and time to RTC.
Definition: bc_rtc.c:77
uint16_t year
Year parameter, 2000 to 2099.
Definition: bc_rtc.h:24
RTC date and time structure.
Definition: bc_rtc.h:15