## disk_readp

The disk_readp function reads a partial sector from the disk drive.

    DRESULT disk_readp (
      BYTE* Buffer,        /* Pointer to the read buffer */
      DWORD SectorNumber,  /* Sector number */
      WORD Offset,         /* Byte offset in the sector to start to read */
      WORD Count           /* Number of bytes to read */
    );

#### Parameters

Buffer
  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 read buffer.
SectorNumber
  Specifies the sector 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 disk drive has not been initialized.

Return