## disk_ioctl

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 */
    );

#### Parameters

Drive
  Specifies drive number (0-9).
Command
  Specifies the command code.
Buffer
  Pointer to the parameter buffer depends on the command code. When it is not used, specify a NULL pointer.

#### Return Value

RES_OK (0)
  The function succeeded.
RES_ERROR
  Any error occured.
RES_PARERR
  Invalid command code.
RES_NOTRDY
  The disk dirve has not been initialized.

#### Description

The FatFs module uses only device independent commands described below. Any device dependent function is not used. In read-only configuration, This function is not needed.

Command | Description
--- | ---
GET_SECTOR_COUNT | Returns total sectors on the drive into the DWORD variable pointed by Buffer.
CTRL_SYNC | Make sure that the drive has finished to write data. When the module has a write back cache, write back the dirty sector immediately.

Return