Instructions

329 C-Control Pro IDE
© 2013 Conrad Electronic
Description
Closes a previously opened file.
Parameter
fil_ramaddr address of the FILE buffer
Return Parameter
Success of the called SDC function. See SDC Return Values.
5.21.4 SDC_FOpen
SDCard Functions
Syntax
byte SDC_FOpen(byte fil_ramaddr[], char path[], byte mode);
Sub SDC_FOpen(ByRef fil_ramaddr As Byte, ByRef path As Char,
mode As Byte) As Byte;
Description
Opens a file. For each open file a FILE buffer has to be created. For this we define a byte array of size 32.
The user-provided RAM buffer must be reserved during the access to the SD card. Since local vari-
ables will be released after leaving the function, it usually makes sense to declare the buffer as a global
variable.
Parameter
fil_ramaddr address of the FILE buffer
path file path
mode file mode
Return Parameter
Success of the called SDC function. See SDC Return Values.
mode parameter:
The individual parameters are ORed like e.g.:
FA_CREATE_NEW | FA_WRITE // CompactC
FA_CREATE_NEW Or FA_WRITE ' BASIC