diff options
author | Rémi Calixte <remicalixte.rmc@gmail.com> | 2021-05-20 11:46:25 +0200 |
---|---|---|
committer | Rémi Calixte <remicalixte.rmc@gmail.com> | 2021-05-20 11:46:25 +0200 |
commit | 571d9a8d7cff6158e9fcd6327db602349e267d56 (patch) | |
tree | 3950d2a1a5b085c4a61b9e821684e47a3cf04492 /arm9/lib/src | |
parent | 8af497a617e45668f7c3c0badc1324ce45308183 (diff) | |
parent | 98f11489806b6dba4c6080c5429b2368d3092541 (diff) |
Merge branch 'master' into unk_02016B94
Diffstat (limited to 'arm9/lib/src')
-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; +} |