summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/rtc.h40
-rw-r--r--include/rtc_util.h24
2 files changed, 32 insertions, 32 deletions
diff --git a/include/rtc.h b/include/rtc.h
index 5ecff238f..5864f95b8 100644
--- a/include/rtc.h
+++ b/include/rtc.h
@@ -3,11 +3,11 @@
#include "gba/gba.h"
-#define RTC_INFO_CTRL_UNK1 0x01 // unknown
-#define RTC_INFO_CTRL_IRQ_ENABLE 0x02 // per-minute IRQ enable
-#define RTC_INFO_CTRL_UNK2 0x04 // unknown
-#define RTC_INFO_CTRL_24HOUR 0x40 // 0: 12-hour mode, 1: 24-hour mode
-#define RTC_INFO_CTRL_POWER_FAILURE 0x80 // power failure occurred
+#define SIIRTCINFO_INTFE 0x01 // frequency interrupt enable
+#define SIIRTCINFO_INTME 0x02 // per-minute interrupt enable
+#define SIIRTCINFO_INTAE 0x04 // alarm interrupt enable
+#define SIIRTCINFO_24HOUR 0x40 // 0: 12-hour mode, 1: 24-hour mode
+#define SIIRTCINFO_POWER 0x80 // power on or power failure occurred
enum
{
@@ -25,7 +25,7 @@ enum
MONTH_DEC
};
-struct RtcInfo
+struct SiiRtcInfo
{
u8 year;
u8 month;
@@ -34,21 +34,21 @@ struct RtcInfo
u8 hour;
u8 minute;
u8 second;
- u8 control;
- u8 unknown1;
- u8 unknown2;
+ u8 status;
+ u8 alarmHour;
+ u8 alarmMinute;
};
-void RTC_Unprotect();
-void RTC_Protect();
-u8 RTC_Probe();
-bool8 RTC_Reset();
-bool8 RTC_GetControl(struct RtcInfo *rtc);
-bool8 RTC_SetControl(struct RtcInfo *rtc);
-bool8 RTC_GetDateTime(struct RtcInfo *rtc);
-bool8 RTC_SetDateTime(struct RtcInfo *rtc);
-bool8 RTC_GetTime(struct RtcInfo *rtc);
-bool8 RTC_SetTime(struct RtcInfo *rtc);
-bool8 RTC_SetUnknownData(struct RtcInfo *rtc);
+void SiiRtcUnprotect();
+void SiiRtcProtect();
+u8 SiiRtcProbe();
+bool8 SiiRtcReset();
+bool8 SiiRtcGetStatus(struct SiiRtcInfo *rtc);
+bool8 SiiRtcSetStatus(struct SiiRtcInfo *rtc);
+bool8 SiiRtcGetDateTime(struct SiiRtcInfo *rtc);
+bool8 SiiRtcSetDateTime(struct SiiRtcInfo *rtc);
+bool8 SiiRtcGetTime(struct SiiRtcInfo *rtc);
+bool8 SiiRtcSetTime(struct SiiRtcInfo *rtc);
+bool8 SiiRtcSetAlarm(struct SiiRtcInfo *rtc);
#endif // GUARD_RTC_H
diff --git a/include/rtc_util.h b/include/rtc_util.h
index c92566e94..039d7e4fd 100644
--- a/include/rtc_util.h
+++ b/include/rtc_util.h
@@ -3,22 +3,22 @@
#include "global.h"
-#define RTC_STAT_INIT_ERROR 0x0001
-#define RTC_STAT_INIT_WARNING 0x0002
+#define RTC_INIT_ERROR 0x0001
+#define RTC_INIT_WARNING 0x0002
-#define RTC_STAT_ERR_12HOUR_CLOCK 0x0010
-#define RTC_STAT_ERR_POWER_FAILURE 0x0020
-#define RTC_STAT_ERR_INVALID_YEAR 0x0040
-#define RTC_STAT_ERR_INVALID_MONTH 0x0080
-#define RTC_STAT_ERR_INVALID_DAY 0x0100
-#define RTC_STAT_ERR_INVALID_HOUR 0x0200
-#define RTC_STAT_ERR_INVALID_MINUTE 0x0400
-#define RTC_STAT_ERR_INVALID_SECOND 0x0800
+#define RTC_ERR_12HOUR_CLOCK 0x0010
+#define RTC_ERR_POWER_FAILURE 0x0020
+#define RTC_ERR_INVALID_YEAR 0x0040
+#define RTC_ERR_INVALID_MONTH 0x0080
+#define RTC_ERR_INVALID_DAY 0x0100
+#define RTC_ERR_INVALID_HOUR 0x0200
+#define RTC_ERR_INVALID_MINUTE 0x0400
+#define RTC_ERR_INVALID_SECOND 0x0800
-#define RTC_STAT_ERROR_FLAGS 0x0FF0
+#define RTC_ERROR_FLAGS 0x0FF0
void RtcInit();
-u16 RtcGetStatus();
+u16 RtcGetErrorStatus();
void RtcReset();
void FormatDecimalTime(u8 *dest, s32 hour, s32 minute, s32 second);
void FormatHexTime(u8 *dest, s32 hour, s32 minute, s32 second);