The disk_status function returns the current drive status.
DSTATUS disk_status ( BYTE pdrv /* [IN] Physical drive number */ );
The current drive status is returned in combination of status flags described below. FatFs refers only STA_NOINIT and STA_PROTECT.