srtc.hpp 447 B

12345678910111213141516171819202122
  1. class SRTC : public MMIO {
  2. public:
  3. void update_time();
  4. unsigned weekday(unsigned year, unsigned month, unsigned day);
  5. void init();
  6. void enable();
  7. void power();
  8. void reset();
  9. uint8 mmio_read (unsigned addr);
  10. void mmio_write(unsigned addr, uint8 data);
  11. SRTC();
  12. private:
  13. static const unsigned months[12];
  14. enum RTC_Mode { RTCM_Ready, RTCM_Command, RTCM_Read, RTCM_Write } rtc_mode;
  15. signed rtc_index;
  16. };
  17. extern SRTC srtc;