This function is used to write a block of data to a file that has been opened in binary write mode.
Syntax |
i32 f_write (buff, i32 blockLen, i32 nBlock, stru_filehnd stru) |
||||||
---|---|---|---|---|---|---|---|
buff |
Is a local or global variable. It can be of type string or any other type as long as array. In buff is contained the block of data to be written sequentially in the file |
||||||
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 f_open() function |
||||||
Result |
Returns:
|
||||||
Validity |
Task |
||||||
Note |
If functions regarding compact flash management are used, it is recommended that bit 14 of the sys_cfg variable (0x00004000) be imposed to 1, to enable the use of safety routines for flash write/read |
NOTE: If I use a non-empty file, the contents of the file prior to using the function are deleted.
Example of use:
|