The disk_write writes sector(s) to the disk.
DRESULT disk_write (
BYTE Drive, /* Physical drive number */
const BYTE* Buffer, /* Pointer to the write data (may be non aligned) */
DWORD SectorNumber, /* Sector number to write */
BYTE SectorCount /* Number of sectors to write */
- Specifies the physical drive number.
- Pointer to the byte array to be written. 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 the number of sectors to write. 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 will never get good write performance.
- RES_OK (0)
- The function succeeded.
- Any hard error occured during the write operation and could not recover it.
- The medium is write protected.
- Invalid parameter.
- The disk drive has not been initialized.
This function is not required in read only configuration.