diff options
author | Seth Barberee <seth.barberee@gmail.com> | 2021-05-15 19:31:22 -0500 |
---|---|---|
committer | Seth Barberee <seth.barberee@gmail.com> | 2021-05-15 19:31:22 -0500 |
commit | 61776017dc42d46aa5cefcb40429d7d96984f703 (patch) | |
tree | 261f97b3b61ed678eca9d036e10d6056de2880a0 /arm9/lib | |
parent | 21ebb3b01cdd47bd7aa56affe7d2179d167453bc (diff) |
decomp 3 files
Diffstat (limited to 'arm9/lib')
-rw-r--r-- | arm9/lib/include/RTC_internal.h | 10 | ||||
-rw-r--r-- | arm9/lib/src/RTC_internal.c | 32 |
2 files changed, 42 insertions, 0 deletions
diff --git a/arm9/lib/include/RTC_internal.h b/arm9/lib/include/RTC_internal.h new file mode 100644 index 00000000..fb86e818 --- /dev/null +++ b/arm9/lib/include/RTC_internal.h @@ -0,0 +1,10 @@ +#ifndef NITRO_RTC_INTERNAL_H_ +#define NITRO_RTC_INTERNAL_H_ + +u32 RtcSendPxiCommand(u8 command); +u32 RTCi_WriteRawStatus2Async(void); +u32 RTCi_ReadRawTimeAsync(void); +u32 RTCi_ReadRawDateAsync(void); +u32 RTCi_ReadRawDateTimeAsync(void); + +#endif //NITRO_RTC_INTERNAL_H_ diff --git a/arm9/lib/src/RTC_internal.c b/arm9/lib/src/RTC_internal.c new file mode 100644 index 00000000..2e997eed --- /dev/null +++ b/arm9/lib/src/RTC_internal.c @@ -0,0 +1,32 @@ +#include "global.h" +#include "PXI_fifo.h" +#include "RTC_internal.h" + +u32 RTCi_ReadRawDateTimeAsync(void) +{ + return RtcSendPxiCommand(16); +} + +u32 RTCi_ReadRawDateAsync(void) +{ + return RtcSendPxiCommand(17); +} + +u32 RTCi_ReadRawTimeAsync(void) +{ + return RtcSendPxiCommand(18); +} + +u32 RTCi_WriteRawStatus2Async(void) +{ + return RtcSendPxiCommand(39); +} + +u32 RtcSendPxiCommand(u8 command) +{ + s32 data = command << 8 & 0x7f00; + if(PXI_SendWordByFifo(PXI_FIFO_TAG_RTC, data, FALSE) >= 0) + return 1; + else + return 0; +} |