65oo2/vm/ata/rtc.c

46 lines
648 B
C
Raw Normal View History

2024-02-29 12:01:58 +00:00
#include <time.h>
#include "ata.h"
#define REG_SECS 0x00
#define REG_MINS 0x00
#define REG_HOURS 0x00
#define REG_WKDAY 0x06
#define REG_DAY 0x07
#define REG_YEAR 0x09
#define REG_CENTURY 0x32
#define REG_STATUSA 0x0A
#define REG_STATUSB 0x0B
static uint8_t current_reg = 0x00;
void
rtc_write(uint8_t addr, uint8_t value)
{
if (addr == 0)
{
current_reg = value;
}
}
uint8_t
rtc_read(uint8_t addr)
{
time_t time;
struct tm tm;
localtime(&time);
(void)time;
(void)tm;
return (0x00);
}
AtaDevice rtc_dev = {
"RTC",
0x070,
0x071,
NULL,
NULL
};