![](https://pdfstore-manualsonline.prod.a.ki/pdfasset/4/44/44414c02-d064-4424-ae12-8acc58561d02/44414c02-d064-4424-ae12-8acc58561d02-bg7a.png)
iVIEW-100 Series user’s Manual, 2006, v2.0 ----- 122
EnableEEP()
Func.: Enable EEPROM to write-enable mode
Syntax:
void EnableEEP(void);
Header: #include ”iVIEW.h”
Description:
Enable EEPROM to write-enable mode
EEPROM is default in write-protect mode, must call EnableEEP() before
writing data to EEPROM.
Example:
(eep.c)
#include <iVIEW.H>
#include <mmi100.H>
void main()
{
Int data=55, data2;
InitLib();
EnableEEP();
WriteEEP(1,10,data);
ProtectEEP();
data2=ReadEEP(1,10);
Print("data=%d, Data2=%d",data,data2);
}
WriteEEP()
Func.: Write data to EEPROM
Syntax:
int WriteEEP(int block, int addr, int data);
Header: #include ”iVIEW.h”
Description:
Write one byte data to EEPROM.
block: 0 to 7 (total 8 blocks).
addr: 0 to 255 (every block has 256 bytes).
data: 0 to 255 (8-bit data).
Return Value: On success return NoError.
On fail return Error code. BlockError(-10) or AddrError(-9) or WriteError(-11).
Example: Please refer to “EnableEEP()” for example.
ProtectEEP()
Func.: Set EEPROM to write-protect mode
Syntax:
void ProtectEEP(void);
Header: #include ”iVIEW.h”
Description:
Set EEPROM back to write-protect mode. EEPROM is default in write-
mode. Before writing data to EEPROM, user have to call EnableEEP().
writing data, user had better call ProtectEEP() to set back to write-
mode.
Example: Please refer to “EnableEEP()” for example.