CHGame 0.3.0
Libraries for the CHGame handheld
Loading...
Searching...
No Matches
SdSpi.h File Reference

The SD card's blocks: identify the card, read one 512-byte block or stream a run of them. More...

#include <stdint.h>

Go to the source code of this file.

Namespaces

namespace  sd
 The SD card's SPI-mode block driver (CHSd).
 

Typedefs

typedef void(* sd::BlockFn) (const uint8_t *block, void *ctx)
 What stream() calls with each block, in order.
 

Functions

bool sd::init ()
 Wakes the card and identifies it (SD v1, SDSC v2, SDHC/SDXC).
 
bool sd::read (uint32_t lba, uint8_t *dst)
 Reads one 512-byte block (CMD17), polled at 12 MHz.
 
bool sd::stream (uint32_t lba, uint32_t n, uint8_t *buf0, uint8_t *buf1, BlockFn fn, void *ctx)
 Reads n consecutive blocks with one multi-block read (CMD18), handing each to fn while the next one arrives.
 

Detailed Description

The SD card's blocks: identify the card, read one 512-byte block or stream a run of them.