From 61776017dc42d46aa5cefcb40429d7d96984f703 Mon Sep 17 00:00:00 2001 From: Seth Barberee Date: Sat, 15 May 2021 19:31:22 -0500 Subject: decomp 3 files --- arm9/lib/src/RTC_internal.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 arm9/lib/src/RTC_internal.c (limited to 'arm9/lib/src') 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; +} -- cgit v1.2.3