The disk_read function reads sector(s) from the disk drive.
DRESULT disk_read (
BYTE Drive, /* Physical drive number */
BYTE* Buffer, /* Pointer to the read data buffer */
DWORD SectorNumber, /* Start sector number */
BYTE SectorCount /* Number of sectros to read */
- Specifies the physical drive number.
- Pointer to the byte array to store the read data. The buffer size of number of bytes to be read, sector size * sector count, is required. Note that the specified memory address is not that always aligned to word boundary. If the hardware does not support misaligned data transfer, it must be solved in this function.
- Specifies the start sector number in logical block address (LBA).
- Specifies number of sectors to read. The value can be 1 to 128. Generally, a multiple sector transfer request must not be split into single sector transactions to the device, or you may not get good read performance.
- RES_OK (0)
- The function succeeded.
- Any hard error occured during the read operation and could not recover it.
- Invalid parameter.
- The disk drive has not been initialized.