IntEEPROM
 
Component IntEEPROM
Internal EEPROM
Component Level: High
Methods:
(Methods are user-callable functions/subroutines intended for the component functions control. Please see the Embedded Components page for more information.)
  • DisableEvent - This method disables all events. This method is available only if the property Interrupt service/event and any event are selected.

      ANSIC prototype: byte DisableEvent(void)
    • Return value:byte - Error code, possible codes:
      • ERR_OK - OK
      • ERR_SPEED - the component does not work in the active speed mode

  • EnableEvent - This method enables all events. This method is available only if the property Interrupt service/event and any event are selected.

      ANSIC prototype: byte EnableEvent(void)
    • Return value:byte - Error code, possible codes:
      • ERR_OK - OK
      • ERR_SPEED - the component does not work in the active speed mode

  • SetByte - This method writes a given byte to a specified address in EEPROM. The method also sets address pointer for SetActByte and GetActByte methods (applicable only if these methods are enabled). The pointer is set to address passed as the parameter.

      ANSIC prototype: byte SetByte(ComponentName_TAddress Addr, byte Data)
    • Addr:ComponentName_TAddress - Address to EEPROM
    • Data:byte - Data to write
    • Return value:byte - Error code, possible codes:
      • ERR_OK - OK
      • ERR_SPEED - the component does not work in the active speed mode
      • ERR_BUSY - device is busy
      • ERR_VALUE - verification of written data failed (read value does not match with written value)
      • ERR_NOTAVAIL - other device-specific error
      • ERR_RANGE - parameter Addr is out of range

  • GetByte - This method reads a byte from a specified EEPROM address. The method also sets address pointer for SetActByte and GetActByte methods (applicable only if these methods are enabled). The pointer is set to address passed as the parameter.

      ANSIC prototype: byte GetByte(ComponentName_TAddress Addr, byte *Data)
    • Addr:ComponentName_TAddress - EEPROM Address
    • Data: Pointer to byte - A pointer to the returned 8-bit data
    • Return value:byte - Error code, possible codes:
      • ERR_OK - OK
      • ERR_BUSY - device is busy
      • ERR_RANGE - parameter Addr is out of range

  • Methods for HC08 derivatives.
    • SetProtection - This method allows to write to the protection EENVR register.
      Warning: Once the bit 4 of the protection register is written to 0, the protection may not be changed.

        ANSIC prototype: void SetProtection(byte Data)
      • Data:byte - 1 in bit 0 - protect area $0800 - $087F
        1 in bit 1 - protect area $0880 - $08FF
        1 in bit 2 - protect area $0900 - $097F
        1 in bit 3 - protect area $0980 - $09FF
        0 in bit 4 - permanent protect $08F0 - $08FF and protection register

  • Methods for HC08 derivatives.
    • SetProtection1 - This method allows to write to the protection EENVR1 register of EEPROM array 1.
      Warning: Once the bit 4 of the protection register is written to 0, the protection may not be changed.

        ANSIC prototype: void SetProtection1(byte Data)
      • Data:byte - 1 in bit 0 - protect area $0800 - $087F
        1 in bit 1 - protect area $0880 - $08FF
        1 in bit 2 - protect area $0900 - $097F
        1 in bit 3 - protect area $0980 - $09FF
        0 in bit 4 - permanent protect $08F0 - $08FF and protection register

    • SetProtection2 - This method allows to write to the protection EENVR2 register of EEPROM array 2.
      Warning: Once the bit 4 of the protection register is written to 0, the protection may not be changed.

        ANSIC prototype: void SetProtection2(byte Data)
      • Data:byte - 1 in bit 0 - protect area $0600 - $067F
        1 in bit 1 - protect area $0680 - $06FF
        1 in bit 2 - protect area $0700 - $077F
        1 in bit 3 - protect area $0780 - $07FF
        0 in bit 4 - permanent protect $06F0 - $06FF and protection register

  • SetWord - This method writes a given word (2 bytes) to the specified address in EEPROM. The method also sets address pointer for SetActByte and GetActByte methods (applicable only if these methods are enabled). The pointer is set to address passed as the parameter + 1.

      ANSIC prototype: byte SetWord(ComponentName_TAddress Addr, word Data)
    • Addr:ComponentName_TAddress - Address to EEPROM
    • Data:word - Data to write
    • Return value:byte - Error code, possible codes:
      • ERR_OK - OK
      • ERR_SPEED - the component does not work in the active speed mode
      • ERR_BUSY - device is busy
      • ERR_VALUE - verification of written data failed (read value does not match with written value)
      • ERR_NOTAVAIL - other device-specific error
      • ERR_RANGE - selected address out of the selected address range

  • GetWord - This method reads a word (2 bytes) from the specified EEPROM address. The method also sets address pointer for SetActByte and GetActByte methods (applicable only if these methods are enabled). The pointer is set to address passed as the parameter + 1.

      ANSIC prototype: byte GetWord(ComponentName_TAddress Addr, word *Data)
    • Addr:ComponentName_TAddress - Address to EEPROM
    • Data: Pointer to word - Pointer to returned 16-bit data
    • Return value:byte - Error code, possible codes:
      • ERR_OK - OK
      • ERR_BUSY - device is busy
      • ERR_RANGE - selected address out of the selected address range

  • SetLong - This method writes a given long word (4 bytes) to the specified address in EEPROM. The method also sets address pointer for SetActByte and GetActByte methods (applicable only if these methods are enabled). The pointer is set to address passed as the parameter + 3.

      ANSIC prototype: byte SetLong(ComponentName_TAddress Addr, dword Data)
    • Addr:ComponentName_TAddress - Address to EEPROM
    • Data:dword - Data to write
    • Return value:byte - Error code, possible codes:
      • ERR_OK - OK
      • ERR_SPEED - the component does not work in the active speed mode
      • ERR_BUSY - device is busy
      • ERR_VALUE - verification of written data failed (read value does not match with written value)
      • ERR_NOTAVAIL - other device-specific error
      • ERR_RANGE - selected address out of the selected address range

  • GetLong - This method reads a long word (4 bytes) from the specified EEPROM address. The method also sets address pointer for SetActByte and GetActByte methods (applicable only if these methods are enabled). The pointer is set to address passed as the parameter + 3.

      ANSIC prototype: byte GetLong(ComponentName_TAddress Addr, dword *Data)
    • Addr:ComponentName_TAddress - Address to EEPROM
    • Data: Pointer to dword - A pointer to the returned 32-bit data
    • Return value:byte - Error code, possible codes:
      • ERR_OK - OK
      • ERR_BUSY - device is busy
      • ERR_RANGE - selected address out of the selected address range

  • SetActByte - This method writes given byte to the current address + 1 (The EEPROM address is pre-incremented) in EEPROM. The address pointer is set by the methods using address as a parameter, such as GetByte, SetByte,etc. - see help of a specific method. Methods GetPage, SetPage set this pointer to the last address of the page.

      ANSIC prototype: byte SetActByte(byte Data)
    • Data:byte - Data to write
    • Return value:byte - Error code, possible codes:
      • ERR_OK - OK
      • ERR_SPEED - the component does not work in the active speed mode
      • ERR_BUSY - device is busy
      • ERR_VALUE - verification of written data failed (read value does not match with written value)
      • ERR_NOTAVAIL - other device-specific error
      • ERR_RANGE - current address pointer is out of range

  • GetActByte - This method reads the current byte +1 (address is pre-incremented) from EEPROM.
    The address pointer is set by the methods using address as a parameter, such as GetByte, SetByte, etc. - see help of a specific method.GetPage, SetPage set this pointer to the last address of the page.

      ANSIC prototype: byte GetActByte(byte *Data)
    • Data: Pointer to byte - A pointer to the returned 8-bit data
    • Return value:byte - Error code, possible codes:
      • ERR_OK - OK
      • ERR_BUSY - device is busy
      • ERR_RANGE - current address pointer is out of range

  • SetBytePage - This method writes a given byte to a virtual page.
    This method is only available when the Page size property is set to a non-zero size of the virtual page.

      ANSIC prototype: byte SetBytePage(word Index, byte Data)
    • Index:word - Index to page within the range 0 to (Page size - 1)
    • Data:byte - Data to write
    • Return value:byte - Error code, possible codes:
      • ERR_OK - OK
      • ERR_RANGE - parameter Index is out of range

  • GetBytePage - This method reads a byte from a virtual page.
    This method is only available when the Page size property is set to a non-zero size of the virtual page.

      ANSIC prototype: byte GetBytePage(word Index, byte *Data)
    • Index:word - Index to page within the range 0 to (Page size - 1)
    • Data: Pointer to byte - A pointer to the returned 8-bit data
    • Return value:byte - Error code, possible codes:
      • ERR_OK - OK
      • ERR_RANGE - parameter Index is out of range

  • SetActBytePage - This method writes a given byte to the current address + 1 (address pointer in page is pre-incremented) in the virtual page. The address pointer to the page is set by SetBytePage or GetBytePage methods.
    This method is only available when the Page size property is set to a non-zero size of the virtual page.

      ANSIC prototype: byte SetActBytePage(byte Data)
    • Data:byte - Data to write
    • Return value:byte - Error code, possible codes:
      • ERR_OK - OK
      • ERR_RANGE - current address pointer is out of range

  • GetActBytePage - This method reads a byte from the current address + 1 (address pointer in page is pre-incremented) in the virtual page. The address pointer to the page is set by SetBytePage or GetBytePage methods.
    This method is only available when the Page size property is set to a non-zero size of the virtual page.

      ANSIC prototype: byte GetActBytePage(byte *Data)
    • Data: Pointer to byte - A pointer to the returned 8-bit data
    • Return value:byte - Error code, possible codes:
      • ERR_OK - OK
      • ERR_RANGE - current address pointer is out of range

  • SetPage - This method writes the virtual page to EEPROM.
    This method is enabled only if the Page size property is set to a non-zero value. The method also sets address pointer for SetActByte and GetActByte methods (applicable only if these methods are enabled). The pointer is set to address passed as the parameter + "Page size" - 1.

      ANSIC prototype: byte SetPage(ComponentName_TAddress Addr)
    • Addr:ComponentName_TAddress - Address in EEPROM
    • Return value:byte - Error code, possible codes:
      • ERR_OK - OK
      • ERR_SPEED - the component does not work in the active speed mode
      • ERR_BUSY - device is busy
      • ERR_VALUE - source value is different from dest. value
      • ERR_NOTAVAIL - other device-specific error
      • ERR_RANGE - selected address out of the selected address range

  • GetPage - This method reads a page at specified EEPROM address to the virtual page in RAM.
    This method is enabled only if the Page size property is set to a non-zero value. The method also sets address pointer for SetActByte and GetActByte methods (applicable only if these methods are enabled). The pointer is set to address passed as the parameter + "Page size" - 1.

      ANSIC prototype: byte GetPage(ComponentName_TAddress Addr)
    • Addr:ComponentName_TAddress - Address in EEPROM
    • Return value:byte - Error code, possible codes:
      • ERR_OK - OK
      • ERR_BUSY - device is busy
      • ERR_RANGE - selected address out of the selected address range

  • Methods for HCS08 family derivatives.
    • SetEEPROMPage - This method selects which EEPROM page is accessed in the memory map - for derivatives, where only half of the EEPROM is in the memory map. The method selects which half of the array can be accessed in foreground while the other half can not be accessed in background.

        ANSIC prototype: byte SetEEPROMPage(byte Page)
      • Page:byte - Page number (start from zero).
      • Return value:byte - Error code, possible codes:
        • ERR_OK - OK
        • ERR_SPEED - the component does not work in the active speed mode
        • ERR_RANGE - parameter Page is out of range

  • SetWait - This method changes the wait behavior of all writing methods.

      ANSIC prototype: void SetWait(bool Wait)
    • Wait:bool -
      true - methods wait till EEPROM write operation is finished, data is verified at the end of writing method
      false - methods do not wait for the end of EEPROM write operation, data is not verified at the end of writing method.

  • Busy - Method returns the status of EEPROM device.

      ANSIC prototype: bool Busy(void)
    • Return value:bool -
      • true if EEPROM is busy
      • false if EEPROM is ready

  • Methods for HCS12, HCS12X, HCS08 derivatives.
    • EraseSector - This method erases the smallest erasable area (sector) of the EEPROM determined by given address. The method also sets address pointer for SetActByte and GetActByte methods (applicable only if these methods are enabled). The pointer is set to address passed as the parameter - 1.

        ANSIC prototype: byte EraseSector(ComponentName_TAddress Addr)
      • Addr:ComponentName_TAddress - Address to EEPROM
      • Return value:byte - Error code, possible codes:
        • ERR_OK - OK
        • ERR_SPEED - the component does not work in the active speed mode
        • ERR_BUSY - device is busy
        • ERR_NOTAVAIL - other device-specific error
        • ERR_RANGE - selected address out of the selected address range

    • EraseEeprom - The method mass erases all EEPROM memory. The method also sets address pointer for SetActByte and GetActByte methods (applicable only if these methods are enabled). The pointer is set to address passed as the parameter - 1.

        ANSIC prototype: byte EraseEeprom(ComponentName_TAddress Addr)
      • Addr:ComponentName_TAddress - Pass any valid EEPROM address. EEPROM module in some CPU families don't require address for mass erase, then the parameter is ignored.
      • Return value:byte - Error code, possible codes:
        • ERR_OK - OK
        • ERR_SPEED - the component does not work in the active speed mode
        • ERR_BUSY - device is busy
        • ERR_NOTAVAIL - other device-specific error


Note: Some methods can be implemented as macros.