User`s manual

PK2100
5-10 s Software Reference
void lc_wait()
Waits for the LCD to become free (i.e., not busy).
EEPROM Read / Write
int ee_rd( int address )
Reads EEPROM at specified address and returns result in lower byte.
Returns 1 if EEPROM is not functioning.
int ee_wr( int address, char data )
Writes character data at address in EEPROM. Returns 1 if EEPROM
is not functioning.
int eei_rd( int address )
Reads EEPROM integer (2 bytes, least significant byte first) at address
specified. Does not return a distinct error code if EEPROM fails.
Flash EPROM Write
int WriteFlash( ulong addr, char* buf,
int num )
Writes num bytes from buf to flash EPROM, starting at addr. The
term addr is an absolute physical address.
To do this with Dynamic C, allocate flash data in Dynamic C by
declaring initialized variables or arrays, or initialized xdata. The data
name for xdata must be passed directly to the function
xdata my_data { 0, 0xFF, 0x08 };
. . .
WriteFlash { my_data, my_buffer, my_count };
For normal data, pass the physical address of the data to the function
char xxx[ ] = { 0, 0xFF, 0x08 };
. . .
WriteFlash { phy_adr(xxx), my_buffer, my_count };
The function returns
0 if the operation is successful,
-1 if no flash EPROM is present,
-2 if a physical address is within the BIOS area,
-3 if a physical address is within the symbol table, or
-4 if the write times out.