The f_read function reads data from a file.
FRESULT f_read ( FIL* FileObject, /* Pointer to the file object structure */ void* Buffer, /* Pointer to the buffer to store read data */ UINT ByteToRead, /* Number of bytes to read */ UINT* ByteRead /* Pointer to the variable to return number of bytes read */ );
FR_OK, FR_DISK_ERR, FR_INT_ERR, FR_NOT_READY, FR_INVALID_OBJECT, FR_TIMEOUT
The file pointer of the file object increases in number of bytes read. After the function succeeded, *ByteRead should be checked to detect the end of file. In case of *ByteRead < ByteToRead, it means the read/write pointer reached end of the file during read operation.
Always available.