![]() |
CHGame 0.3.0
Libraries for the CHGame handheld
|
A read-only SPI-mode microSD block driver: sd::init(), sd::read() and sd::stream().
More...
Namespaces | |
| namespace | sd |
| The SD card's SPI-mode block driver (CHSd). | |
A read-only SPI-mode microSD block driver: sd::init(), sd::read() and sd::stream().
HypeRunner's clean-room driver cut down to what reading a game's data file needs: identify the card, read one 512-byte block. No writing, no CRC (the games' files check their own blocks or records), and DMA only in stream(), for a sketch that reads whole files every frame. Most sketches never call these directly: fat::open() and fat::read() do it for them.
The card is a block device addressed by LBA (512-byte block number) whatever its size: SDSC, SDHC and SDXC cards all work.
gfx_wait(), before the next flush. SPI1 is handed back exactly as CHGfx left it.sd::init() before reading again: a block whose token came late may still be on its way, and init()'s CMD0 is what clears it.