orcus
Functions
sd.h File Reference

SD card. More...

#include <stdint.h>

Functions

int sdInit ()
 Initialise SD card. More...
 
bool sdIsInserted ()
 Check if SD card is inserted. More...
 
int sdReadBlocks (int startBlock, int numberOfBlocks, uint8_t *dest)
 Read blocks from SD card. More...
 
int sdWriteBlocks (int startBlock, int numberOfBlocks, uint8_t *src)
 Write blocks to SD card. More...
 

Function Documentation

◆ sdInit()

int sdInit ( )

Initialise SD card.

Returns
0 if successful, non-zero otherwise

◆ sdIsInserted()

bool sdIsInserted ( )

Check if an SD card is physically inserted into the slot (reads the state of the mechanical switch).

Returns
true if an SD card is inserted, false otherwise

◆ sdReadBlocks()

int sdReadBlocks ( int  startBlock,
int  numberOfBlocks,
uint8_t *  dest 
)

Read blocks (512B) from SD card.

Note
Must have called sdInit first
Parameters
startBlockBlock to start reading from (i.e. address / 512)
numberOfBlocksNumber of 512B blocks to read
destPointer to memory location to store data
Returns
0 if successful, non-zero otherwise
See also
sdInit

◆ sdWriteBlocks()

int sdWriteBlocks ( int  startBlock,
int  numberOfBlocks,
uint8_t *  src 
)

Write blocks (512B) to SD card.

Note
Must have called sdInit first
Parameters
startBlockBlock to start reading writing at (i.e. address / 512)
numberOfBlocksNumber of 512B blocks to write
destPointer to memory location of data to write
Returns
0 if successful, non-zero otherwise
See also
sdInit