32 lines
555 B
C
32 lines
555 B
C
|
#pragma once
|
||
|
|
||
|
#include <stdint.h>
|
||
|
|
||
|
#define SECOND_REGISTER 0x00
|
||
|
#define MINUTE_REGISTER 0x02
|
||
|
#define HOUR_REGISTER 0x04
|
||
|
#define DAY_OF_THE_MONTH_REGISTER 0x07
|
||
|
#define MONTH_REGISTER 0x08
|
||
|
#define YEAR_REGISTER 0x09
|
||
|
#define CENTURY_REGISTER 0x32
|
||
|
|
||
|
#define REGISTER_A 0x0A
|
||
|
#define REGISTER_B 0x0B
|
||
|
|
||
|
enum {
|
||
|
CMOS_ADDRESS = 0x70,
|
||
|
CMOS_DATA = 0x71
|
||
|
};
|
||
|
|
||
|
struct rtc_date {
|
||
|
uint8_t second;
|
||
|
uint8_t minute;
|
||
|
uint8_t hour;
|
||
|
|
||
|
uint8_t index_of_the_day;
|
||
|
uint8_t day;
|
||
|
uint8_t month;
|
||
|
uint32_t year;
|
||
|
};
|
||
|
|
||
|
struct rtc_date get_date(void);
|