You are currently viewing the documentation for:
ECF_ReadSector reads a single sector from a block device.
ECF_ErrorCode ECF_ReadSector(
   struct ECF_BlockDriver *pBlockDriver,
   uint32_t sector,
   uint8_t *pData,
   uint8_t flags
This is a pointer to the struct ECF_BlockDriver where you want to read a sector.
This specifies which sector to read.
This points to a uint8_t array that the block driver needs to fill with the read data.
These are flags for the read.
If this flag is set, the block driver will bypass the wear leveling layer and read a physical sector. There are very few reasons, if any, to do this.
Return value
Returns one of the EcFAT error codes (ECFERR_SUCCESS on success)
The difference between calling ECF_ReadSector and calling the block driver's m_fnReadSector directly is that ECF_ReadSector will properly handle wear leveling and locking of the block driver. ECF_ReadSector will automatically handle wear leveling and read sectors even when they have been moved because of wear leveling. The normal use case for ECF_ReadSector is for reading sectors from a RAW partition without file system.
See also