IntEEPROM
 
Component IntEEPROM
Internal EEPROM
Component Level: High
Typical Usage:
(Examples of a typical usage of the component in user code. For more information please see the page Component Code Typical Usage.)

Required component name is IEE1 and property 'Wait enabled in initialization code' to be set to yes.

There are the following two typical usage modes:

(1)
The easiest usage of the component is a single byte read and write.

 MAIN.C

byte Data;

void main(void)
{
  /* Write number 28 to address 0x600 */
  IEE1_SetByte(0x0600, 28);
  /* Read contents of EEPROM array at address 0x600 and write it to Data variable */
  IEE1_GetByte(0x0600, &Data);
}
Note: The Address of EEPROM is an absolute address, not an index within the EEPROM area.

(2)
When the property 'Page size' is set up to different number than 0, methods using virtual page are available. The following example reads data content of some EEPROM area, modifies it, and stores it to another location in the EEPROM.

 MAIN.C

void main(void)
{
  /* Fill virtual page with actual data content on address 0x600 */
  IEE1_GetPage(0x0600);
  /* Write number 23 to first cell of page */
  IEE1_SetActBytePage(23);
  /* Write number 0 to second cell */
  IEE1_SetActBytePage(0);
  /* Write number 255 to tenth cell */
  IEE1_SetBytePage(9, 0xFF);
  /* Rest of page fill with ff */
  while (IEE1_SetActBytePage(0xff) == ERR_OK) {}
  /* Store data content of virtual page to EEPROM on address 0x0630 */
  IEE1_SetPage(0x0630);
}
Note: Methods SetBytePage, GetBytePage use index within the range 0 to (PageSize - 1).