The disk_ioctl function cntrols device specified features and miscellaneous functions other than disk read/write.
DRESULT disk_ioctl ( BYTE Drive, /* Drive number */ BYTE Command, /* Control command code */ void* Buffer /* Data transfer buffer */ );
The FatFs module uses only device independent commands described below. Any device dependent function is not used.
Command | Description |
---|---|
CTRL_SYNC | Make sure that the disk drive has finished pending write process. When the disk I/O module has a write back cache, flush the dirty sector immediately. This command is not required in read-only configuration. |
GET_SECTOR_SIZE | Returns sector size of the drive into the WORD variable pointed by Buffer. This command is not required in single sector size configuration, _MAX_SS is 512. |
GET_SECTOR_COUNT | Returns total sectors on the drive into the DWORD variable pointed by Buffer. This command is used in only f_mkfs function. |
GET_BLOCK_SIZE | Returns erase block size of the memory array in unit of sector into the DWORD variable pointed by Buffer. When the erase block size is unknown or magnetic disk device, return 1. This command is used in only f_mkfs function. |