User`s manual

OP7100 Software
55
Display
Flash EPROM
The WriteFlash function in the Dynamic C DRIVERS.LIB library is
used to write data to the program flash EPROM.
int WriteFlash( unsigned long physical_addr,
char *buf, int count )
Writes count number of bytes pointed to by buf to the program flash
EPROM absolute data location physical
_
adr. Allocate data location
by declaring the byte arrays as initialized arrays or declare an initial-
ized xdata array. If byte array is declared, conert logical memory to
physical memory with phy
_
adr(array). For initialized xdata, you
can pass the array name directly.
PARAMETERS: physical
_
adr is the absolute data location in the
flash EPROM.
*buf is a pointer to the bytes to write.
count is the number of bytes to write.
RETURN VALUES:
0 if WriteFlash is okay.
-1 if the program flash EPROM is not in used.
-2 if physical
_
addr is inside the BIOS area.
-3 if physical
_
addr is within the symbol area or the simulated
EEPROM area.
-4 if WriteFlash times out.
The WriteFlash function writes to the program flash
EPROM. See the SYS.LIB section later in this chapter for the
functions associated with the second flash EPROM.