The f_read 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 WORD ByteToRead, // Number of bytes to read WORD* ByteRead // Pointer to the variable to return number of bytes read );
The read/write pointer increases in number of bytes read. The ByteRead will be smaller than ByteToRead when the read pointer reached to end of the file or any error occured during the read operation.