diff options
author | PikalaxALT <PikalaxALT@users.noreply.github.com> | 2021-05-16 10:24:32 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-16 10:24:32 -0400 |
commit | 2641108e50d9d4e50b1cf85458256713e0444021 (patch) | |
tree | ea8f9ed488f5b73074e5d82ea731a9450ed3f4b1 /arm9/lib/src/RTC_internal.c | |
parent | 6a91d89d2c9cde15b12e092dcc7d92c19a994b55 (diff) | |
parent | b09a7b81d1f44adc521686d2b56d4b28c748995c (diff) |
Merge branch 'master' into pikalax_work
Diffstat (limited to 'arm9/lib/src/RTC_internal.c')
-rw-r--r-- | arm9/lib/src/RTC_internal.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/arm9/lib/src/RTC_internal.c b/arm9/lib/src/RTC_internal.c new file mode 100644 index 00000000..c7a5f2aa --- /dev/null +++ b/arm9/lib/src/RTC_internal.c @@ -0,0 +1,31 @@ +#include "function_target.h" +#include "PXI_fifo.h" +#include "RTC_internal.h" + +static BOOL RtcSendPxiCommand(u8 command); + +ARM_FUNC BOOL RTCi_ReadRawDateTimeAsync(void) +{ + return RtcSendPxiCommand(16); +} + +ARM_FUNC BOOL RTCi_ReadRawDateAsync(void) +{ + return RtcSendPxiCommand(17); +} + +ARM_FUNC BOOL RTCi_ReadRawTimeAsync(void) +{ + return RtcSendPxiCommand(18); +} + +ARM_FUNC BOOL RTCi_WriteRawStatus2Async(void) +{ + return RtcSendPxiCommand(39); +} + +ARM_FUNC static BOOL RtcSendPxiCommand(u8 command) +{ + s32 data = command << 8 & 0x7f00; + return PXI_SendWordByFifo(PXI_FIFO_TAG_RTC, data, FALSE) >= 0; +} |