1.3.1.4.1 EMU_EEPROM_Initialize Function
C
SYS_MODULE_OBJ EMU_EEPROM_Initialize(const SYS_MODULE_INDEX drvIndex, const SYS_MODULE_INIT* const init)
Summary
Initializes the EEPROM Emulator library.
Description
Initializes the emulated EEPROM memory space; if the emulated EEPROM memory has not been previously initialized, it will need to be explicitly formatted via EMU_EEPROM_EraseMemory(). The EEPROM memory space will not be automatically erased by the initialization function, so that partial data may be recovered by the user application manually if the service is unable to initialize successfully.
Precondition
None.
Parameters
Param | Description |
---|---|
drvIndex | Identifier for the instance to be initialized. |
init | Pointer to the init data structure containing any data necessary to initialize the driver. |
Returns
If successful, returns a valid handle to a driver instance object. Otherwise, returns SYS_MODULE_OBJ_INVALID.
Example
// The following code snippet shows an example I2C driver initialization. sysObj.libEMULATED_EEPROM0 = EMU_EEPROM_Initialize(EMULATED_EEPROM0, (SYS_MODULE_INIT *)NULL);
Remarks
This routine must be called before any other EEPROM Emulation library routine is called. This routine should only be called once during system initialization.