42_KFS/headers/rtc.h

32 lines
607 B
C
Raw Normal View History

2024-09-18 15:45:10 -04:00
#pragma once
#include "types.h"
2024-09-18 15:45:10 -04:00
#include <stdint.h>
2024-09-18 16:30:11 -04:00
#define SECOND_REGISTER 0x00
#define MINUTE_REGISTER 0x02
#define HOUR_REGISTER 0x04
#define DAY_OF_THE_WEEK_REGISTER 0x06
2024-09-18 15:45:10 -04:00
#define DAY_OF_THE_MONTH_REGISTER 0x07
2024-09-18 16:30:11 -04:00
#define MONTH_REGISTER 0x08
#define YEAR_REGISTER 0x09
#define CENTURY_REGISTER 0x32
2024-09-18 15:45:10 -04:00
#define REGISTER_A 0x0A
#define REGISTER_B 0x0B
2024-09-18 16:30:11 -04:00
enum { CMOS_ADDRESS = 0x70, CMOS_DATA = 0x71 };
2024-09-18 15:45:10 -04:00
struct rtc_date {
u8 second;
u8 minute;
u8 hour;
2024-09-18 15:45:10 -04:00
u8 index_of_the_day;
u8 day;
u8 month;
u32 year;
2024-09-18 15:45:10 -04:00
};
struct rtc_date get_date(void);