SmartGPU2-LCD480X320Touch-CommandSet

SMART GPU 2 3.5” TOUCH
Command Set
Vizic Technologies ©2014 99
2.9.6 Open File 4Fhex ‘O’ ascii
Commands (host)
4 bytes + file name with “.ext” + 1byte(NULL).
1.- 0x46 (hex), F (ascii). *FAT command.
2.- 0x4F (hex), O (ascii). (Open File)
3.- Workspace Block# 0x00(hex) 0x03(hex).
4.- Open Mode:
0x01 (hex)- Read Only
0x02 (hex)- Write Only
0x03 (hex)- Read +Write
5 up to N (file name including extension).
N+1.- 0x00 (hex) NULL ascii.
Responses (device)
1 byte File ACK + 1 byte Command ACK
1.- 0xXX (hex) - Refer to “File ACK List”.
2.- 0x4F (hex), O (ascii) success ACK.
0x46 (hex), F (ascii) fail NAK.
Description
This Command Opens/Allocates a file on the
Workspace Block# parameter, the file access
depends on the “Open Mode” parameter:
- Read Only: Specifies read access to the object,
file data can only be read, not write.
- Write Only: Specifies write access to the object,
file data can only be write, not read.
- Read+Write: Specifies read+write access to the
object, file data can be write or read.
After Open File command is executed and
succeeds(ACK), the file object workspace block
is valid. The file object workspace block is used
for subsequent read/write operations to identify
the file.
Only one file can be open at the same time in
the same Workspace block, always be sure close
a Workspace block file object before opening a
new one in it, if another file is already allocated in
the Workspace block and a call to “Open File” is
executed in that same Workspace block, the old
file is discarded and replaced by the new one,
any unsaved changes on the old file will be lost.
To save changes to file without closing it use “Sync
File”, to save and close an open file object use “Close
File” function. If the modified/written file is not saved or
closed, the file data can be collapsed.