2015-05-12 11:15:16 +12:00
|
|
|
// Copyright 2014 Normmatt
|
|
|
|
// Licensed under GPLv2 or any later version
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
2015-05-10 12:51:46 -07:00
|
|
|
#include "command_ntr.h"
|
|
|
|
|
|
|
|
#include "protocol_ntr.h"
|
|
|
|
|
2015-05-14 21:30:39 -04:00
|
|
|
void NTR_CmdReset(void)
|
2015-05-10 12:51:46 -07:00
|
|
|
{
|
2015-05-11 10:33:33 -04:00
|
|
|
static const u32 reset_cmd[2] = { 0x9F000000, 0x00000000 };
|
2015-05-10 12:51:46 -07:00
|
|
|
NTR_SendCommand(reset_cmd, 0x2000, NTRCARD_CLK_SLOW | NTRCARD_DELAY1(0x1FFF) | NTRCARD_DELAY2(0x18), NULL);
|
|
|
|
}
|
|
|
|
|
2016-06-07 02:30:30 -04:00
|
|
|
u32 NTR_CmdGetCartId(void)
|
2015-05-10 12:51:46 -07:00
|
|
|
{
|
2015-05-24 21:39:35 -03:00
|
|
|
u32 id;
|
2015-05-11 10:33:33 -04:00
|
|
|
static const u32 getid_cmd[2] = { 0x90000000, 0x00000000 };
|
2015-05-10 12:51:46 -07:00
|
|
|
NTR_SendCommand(getid_cmd, 0x4, NTRCARD_CLK_SLOW | NTRCARD_DELAY1(0x1FFF) | NTRCARD_DELAY2(0x18), &id);
|
|
|
|
return id;
|
|
|
|
}
|
|
|
|
|
2015-05-14 21:30:39 -04:00
|
|
|
void NTR_CmdEnter16ByteMode(void)
|
2015-05-10 12:51:46 -07:00
|
|
|
{
|
2015-05-11 10:33:33 -04:00
|
|
|
static const u32 enter16bytemode_cmd[2] = { 0x3E000000, 0x00000000 };
|
2015-05-10 12:51:46 -07:00
|
|
|
NTR_SendCommand(enter16bytemode_cmd, 0x0, 0, NULL);
|
|
|
|
}
|