1 | /***** |
2 | * S-RTC emulation code |
3 | * Copyright (c) byuu |
4 | *****/ |
5 | |
6 | |
7 | #ifndef _SRTCEMU_H_ |
8 | #define _SRTCEMU_H_ |
9 | |
10 | class SRTC { |
11 | public: |
12 | void update_time(); |
13 | unsigned weekday(unsigned year, unsigned month, unsigned day); |
14 | |
15 | void init(); |
16 | void enable(); |
17 | void power(); |
18 | void reset(); |
19 | |
20 | uint8 mmio_read (unsigned addr); |
21 | void mmio_write(unsigned addr, uint8 data); |
22 | |
23 | SRTC(); |
24 | |
25 | static const unsigned months[12]; |
26 | enum RTC_Mode { RTCM_Ready, RTCM_Command, RTCM_Read, RTCM_Write } rtc_mode; |
27 | signed rtc_index; |
28 | }; |
29 | |
30 | #endif |
31 | |