Function FS Read Sector

From Uzebox Wiki
Jump to: navigation, search
Prototype

uint8_t FS_Read_Sector(sdc_struct_t* sds);

Description

Loads currently selected sector of file into sector buffer.

Parameters
  • sds: SD data structure. The bufp field must point to a valid 512 byte buffer.
Returns

Zero on success, error code on failure.

Video Modes

All

Since

V.5.x.x bootloaders

Notes

Accesses the SD card. The function attempts a retry, so if you receive an error from it, you may assume that the card became inaccessible.

The error codes returned by this function:

  • 1: Card is not initialized
  • 2: CMD17 failed
  • 3: Timed out during waiting for data token
  • 4: CRC error (data is loaded, but possibly corrupt)