Instructions
330Libraries
© 2013 Conrad Electronic
Mode
Value (Hex)
Description
FA_OPEN_EXISTING
00
Opens file. If file does not exist, then error
FA_READ
01
File reading allowed
FA_WRITE
02
File writing allowed
FA_CREATE_NEW
04
Creates file, if file already exists, then error
FA_CREATE_ALWAYS
08
Creates file, if file already exists, then file is truncated
FA_OPEN_ALWAYS
10
Opens file. If file does not exist, then file is created
5.21.5 SDC_FRead
SDCard Functions
Syntax
byte SDC_FRead(byte fil_ramaddr[], byte buf[], word btr, word br[]);
Sub SDC_FRead(ByRef fil_ramaddr As Byte, ByRef buf As Byte, btr As Word,
ByRef br As Word) As Byte
Description
Reads data from an open file. The data is written at the reading position from the file into the buffer buf.
The number of bytes to read is btr, the number of bytes that were actually read is copied in the first element
of br. The reading position can be determined with SDC_FSeek.
Parameter
fil_ramaddr address of the FILE buffer
buf RAM address to where the bytes a read from the SD card
btr number of bytes to read
br actual number of bytes read
Return Parameter
Success of the called SDC function. See SDC Return Values.
5.21.6 SDC_FSeek
SDCard Functions
Syntax
byte SDC_FSeek(byte fil_ramaddr[], dword pos);
Sub SDC_FSeek(ByRef fil_ramaddr As Byte, pos As ULong) As Byte
Description
Sets the read / write position of the opened file. The position pos is always counted from the beginning of
the file.