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:
|
||||||
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 |
Example of use:
|