Functions | Variables
EEPROM_Emulation

Functions

uint16_t EE_Init (void)
 Restore the pages to a known good state in case of page's status corruption after a power loss. More...
 
uint16_t EE_ReadVariable (uint16_t VirtAddress, uint16_t *Data)
 Returns the last stored variable data, if found, which correspond to the passed virtual address. More...
 
uint16_t EE_WriteVariable (uint16_t VirtAddress, uint16_t Data)
 Writes/upadtes variable data in EEPROM. More...
 

Variables

uint16_t DataVar = 0
 
uint16_t VirtAddVarTab [NB_OF_VAR]
 

Detailed Description

Function Documentation

uint16_t EE_Init ( void  )

Restore the pages to a known good state in case of page's status corruption after a power loss.

Parameters
None.
Return values
-Flash error code: on write Flash error
  • FLASH_COMPLETE: on success
uint16_t EE_ReadVariable ( uint16_t  VirtAddress,
uint16_t *  Data 
)

Returns the last stored variable data, if found, which correspond to the passed virtual address.

Parameters
VirtAddressVariable virtual address
DataGlobal variable contains the read variable value
Return values
Successor error status:
  • 0: if variable was found
  • 1: if the variable was not found
  • NO_VALID_PAGE: if no valid page was found.
uint16_t EE_WriteVariable ( uint16_t  VirtAddress,
uint16_t  Data 
)

Writes/upadtes variable data in EEPROM.

Parameters
VirtAddressVariable virtual address
Data16 bit data to be written
Return values
Successor error status:
  • FLASH_COMPLETE: on success
  • PAGE_FULL: if valid page is full
  • NO_VALID_PAGE: if no valid page was found
  • Flash error code: on write Flash error

Variable Documentation

uint16_t DataVar = 0
uint16_t VirtAddVarTab[NB_OF_VAR]