Please enable JavaScript to view this site.

This function is used to read a block of data from a file that has been opened in binary read mode.

Syntax

i32 f_read (buff, i32 blockLen, i32 nBlock, stru_filehnd stru)

buff

Local or global variable that can be of any type.

In buffer the block of data read sequentially from the file is downloaded

blockLen

Size in bytes of each block to be written

nBlock

Number of blocks, of size blockLen, to be written

stru

Variable of type stru_filehnd that contains the handle obtained via the function f_open()

Result

Returns:

Value

Description

0

Failed operation

> 0

The operation was successful.

Returns the number of elements actually read. This number usually coincides with the number of blocks, unless the end of the file is encountered before all specified elements have been read

Validity

Task

Note

If you are using functions regarding compact flash management, it is recommended that bit 14 of the sys_cfg variable (0x00004000) be imposed to 1, to enable the use of safety routines for writing/reading flash

 

  

Keyboard Navigation

F7 for caret browsing
Hold ALT and press letter

This Info: ALT+q
Page Header: ALT+h
Topic Header: ALT+t
Topic Body: ALT+b
Contents: ALT+c
Search: ALT+s
Exit Menu/Up: ESC