libnds
|
Slot-1 card commands. More...
Functions | |
void | cardEepromChipErase (void) |
Erase the entirety of a TYPE 3 (FLASH) card EEPROM. | |
u8 | cardEepromCommand (u8 command) |
Send a command to the card EEPROM. | |
u32 | cardEepromGetSize (void) |
Read the card EEPROM's size. | |
int | cardEepromGetType (void) |
Read the card EEPROM's type. | |
u32 | cardEepromReadID (void) |
Attempt to read the ID of the card EEPROM chip. | |
void | cardEepromSectorErase (u32 address) |
Erase a single sector of a TYPE 3 (FLASH) card EEPROM. | |
void | cardParamCommand (u8 command, u32 parameter, u32 flags, u32 *destination, u32 length) |
Write a ROM command of the following form, reading the response via polling (synchronously). | |
void | cardPolledTransfer (u32 flags, u32 *destination, u32 length, const u8 *command) |
Write a ROM command, reading the response via polling (synchronously). | |
void | cardRead (void *dest, size_t offset, size_t len, uint32_t flags) |
Read bytes from the card ROM. | |
void | cardReadEeprom (u32 address, u8 *data, u32 length, u32 addrtype) |
Read from the card EEPROM. | |
void | cardReadHeader (u8 *header) |
Read card header to the provided buffer. | |
u32 | cardReadID (u32 flags) |
Read card ID. | |
void | cardReset (void) |
Reset the card. | |
void | cardStartTransfer (const u8 *command, u32 *destination, int channel, u32 flags) |
Perform a ROM command, reading the response via DMA (asynchronously). | |
uint32_t | cardWriteAndRead (const u8 *command, u32 flags) |
Perform a ROM command, reading one word of response. | |
void | cardWriteCommand (const u8 *command) |
Write a command to the card interface. | |
void | cardWriteEeprom (u32 address, u8 *data, u32 length, u32 addrtype) |
Write to the card EEPROM. | |
void | disableSlot1 (void) |
Disable Slot-1 in a DSi console. | |
static void | eepromWaitBusy (void) |
Wait until an EEPROM command is done. | |
void | enableSlot1 (void) |
Enable Slot-1 in a DSi console. | |
Slot-1 card commands.
Send a command to the card EEPROM.
command | The command to send. |
u32 cardEepromGetSize | ( | void | ) |
Read the card EEPROM's size.
int cardEepromGetType | ( | void | ) |
Read the card EEPROM's type.
u32 cardEepromReadID | ( | void | ) |
Attempt to read the ID of the card EEPROM chip.
Doesn't work well; most chips return 0xFFFF.
void cardEepromSectorErase | ( | u32 | address | ) |
Erase a single sector of a TYPE 3 (FLASH) card EEPROM.
address | The address to erase at. |
Write a ROM command of the following form, reading the response via polling (synchronously).
ccpppppppp000000
where cc is the command and pp is the parameter.
command | The command. |
parameter | The parameter. |
flags | The ROM control flags to use for the transfer. |
destination | The response's destination buffer. |
length | The length of the response, in bytes. |
Write a ROM command, reading the response via polling (synchronously).
flags | The ROM control flags to use for the transfer. |
destination | The response's destination buffer. |
length | The length of the response, in bytes. |
command | 8-byte command buffer, little endian. |
void cardRead | ( | void * | dest, |
size_t | offset, | ||
size_t | len, | ||
uint32_t | flags | ||
) |
Read bytes from the card ROM.
dest | The destination buffer. |
offset | The offset to read from, in bytes. |
len | The number of bytes to read. |
flags | The read flags. |
Read from the card EEPROM.
address | The address to read from. |
data | The data to write. |
length | The length of data, in bytes. |
addrtype | The card EEPROM's type. |
void cardReadHeader | ( | u8 * | header | ) |
Read card header to the provided buffer.
This command requires the cart to not be initialized yet, which may mean the user needs to eject and reinsert the cart or they will return random data.
TODO: Is that correct?
header | Buffer to store the data in. |
Read card ID.
This command requires the cart to not be initialized yet, which may mean the user needs to eject and reinsert the cart or they will return random data.
TODO: Is that correct?
flags | The ROM control flags to use for the transfer. |
void cardReset | ( | void | ) |
Reset the card.
This command requires the cart to not be initialized yet, which may mean the user needs to eject and reinsert the cart or they will return random data.
TODO: Is that correct?
Perform a ROM command, reading the response via DMA (asynchronously).
Note that this function does not wait for the DMA to complete!
command | 8-byte command buffer, little endian. |
destination | The response's destination buffer. |
channel | The DMA channel to use for the transfer. |
flags | The ROM control flags to use for the transfer. |
Perform a ROM command, reading one word of response.
command | 8-byte command buffer, little endian. |
flags | The ROM control flags to use for the transfer. |
void cardWriteCommand | ( | const u8 * | command | ) |
Write a command to the card interface.
command | 8-byte command buffer, little endian. |
Write to the card EEPROM.
Note that TYPE 3 (FLASH) EEPROM must be erased before writing.
address | The address to write to. |
data | The data to write. |
length | The length of data, in bytes. |
addrtype | The card EEPROM's type. |