disk_readp

The disk_readp function reads a partial sector of the device.

DRESULT disk_readp (
  BYTE* buff,    /* [OUT] Pointer to the read buffer */
  DWORD sector,  /* [IN]  Sector number */
  UINT offset,   /* [IN]  Byte offset in the sector to start to read */
  UINT count     /* [IN]  Number of bytes to read */
);

Parameters

buff
Pointer to the read buffer to store the read data. If a NULL is given, read bytes will be forwarded to the outgoing stream instead of the memory.
sector
Specifies the sector number to be read in logical block address (LBA).
offset
Specifies the byte offset in the sector to start to read. The value can be 0 to 511.
count
Specifies number of bytes to read. The value can be 0 to 512 and offset + count must not exceed 512.

Return Value

RES_OK (0)
The function succeeded.
RES_ERROR
Any hard error occured during the disk read operation and could not recover it.
RES_PARERR
Invalid parameter.
RES_NOTRDY
The device has not been initialized.

Return