name=Simulated EEPROM version 2 Library
description=This library simulates an EEPROM within the internal flash of the chip to maximize the lifetime of flash pages and reduce write cycles.  The simulated EEPROM extends the lifetime of flash by wear leveling writes across the flash.  It is used for persistent storage of tokens for the network and application layers.  The network tokens are automatically managed by the network stack.  The application may add its own tokens.  SimEE1 and SimEE2 share the same fundamental limits on maximum number of tokens, maximum token or element size, and maximum number of elements in an indexed token. Maximum sum total of all token sizes is 2 kB in version 1 and 8 kB in version 2.  Version 2 is designed to reduce the time needed when an application writes a token, at the expense of consuming more flash.  Therefore SimEE2 is more appropriate when writing an element within a large set of tokens during time critical operations.  For example setting a binding within a 100 entry binding table.  Page erasure is under application control, via a callback, due to requiring the chip to disable interrupts during the erasure.  See Application note AN703 for more information.  This library requires the Simulated EEPROM version 1 to version 2 upgrade stub library or upgrade library.  The upgrade stub library is recommended since the stub adds minimal code space.  The full upgrade library should only be used when there are existing units in the field using SimEE1 that are meant to be upgraded.
category=HAL
quality=production

architecture=efr32~series[1],em346,em355,em3555,em357,em3581,em3582,em3585,em3586,em3587,em3588,em3591,em3592,em3595,em3596,em3597,em3598,simulation

providedApis=sim-eeprom, token-storage
api.sim-eeprom.header=$HAL/plugin/sim-eeprom/sim-eeprom.h

requiredApis=sim-eeprom2-1to2-upgrade

libraryFiles=$FRAMEWORK/../../build/sim-eeprom2-library-{platformDirectorySuffix}/sim-eeprom2-library.a
(~simulation):$HAL/plugin/sim-eeprom2/sim-eeprom2.c

options=password
conditions=verify

password.name=Password
password.description=The Simulated EEPROM 2 Library requires a password with which the user can access the data.
password.type=STRING
password.default=

verify.expression=password.equals("!spoon")
verify.message=Invalid password specified in the plugin options.  Please see Application Note AN703 to obtain the password and for more information on choosing SimEE2.

setup(macros) {
  -DUSE_SIMEE2
}

setup(template) {
  simeepromSize=36864
}
