Common Token Manager Defines#
This module provides defines for the Common Token Manager (CTM).
The defines in this module are used for creating 32-bit token identifier to identify static device tokens, static secure tokens and dynamic tokens in the CTM.
Note
For more information on tokens and CTM refer to silabs application note 'AN1154: Using Tokens for Non-Volatile Data Storage'
Modules#
Macros#
Helper MACRO to get the size of a predefined token.
Helper MACRO to create a new static device token in 32-bit identifier format, the tokens created are stored in secure memory region and are mass erase protected, this MACRO can be used with sl_token_get_data() or sl_token_set_data() functions, for more information `sl_token_manager_defines.h`.
Helper MACRO to create a new static secure token in 32-bit identifier format, the tokens created are stored in dedicated flash region, with additional security measures and are not protected by mass/device erase, this MACRO can be used with sl_token_get_data() or sl_token_set_data() functions, for more information `sl_token_manager_defines.h`.
Helper MACRO to create dynamic token, user has to take care of providing the unique token for each NVM3 token created, the tokens created are stored in NVM3 region and are not protected by mass/device/nvm3 erase, this MACRO can be used with sl_token_get_data() or sl_token_set_data() functions, for more information `sl_token_manager_defines.h`.
Helper MACRO to create dynamic token for NVM3 secondary instance, user has to take care of providing the unique token for each NVM3 token created, the tokens created are stored in NVM3 region and are not protected by mass/device/nvm3 erase, this MACRO can be used with sl_token_get_data() or sl_token_set_data() functions, for more information `sl_token_manager_defines.h`.
Helper MACRO to create a NVM3 override key for static token, this MACRO can be used with sl_token_get_data() or sl_token_set_data() functions, the range for NVM3 Domain region for a static token override key is predefined for more information `sl_token_manager_defines.h`.
Macro Definition Documentation#
SL_TOKEN_GET_STATIC_TOKEN_SIZE#
#define SL_TOKEN_GET_STATIC_TOKEN_SIZEValue:
(token_name)
Helper MACRO to get the size of a predefined token.
Note
The size MACRO's should be predefined to use this helper macro.
SL_TOKEN_GET_STATIC_DEVICE_TOKEN#
#define SL_TOKEN_GET_STATIC_DEVICE_TOKENValue:
Helper MACRO to create a new static device token in 32-bit identifier format, the tokens created are stored in secure memory region and are mass erase protected, this MACRO can be used with sl_token_get_data() or sl_token_set_data() functions, for more information `sl_token_manager_defines.h`.
type : Static Token.
static token type : 0 - Static device token region (secure memory region)
key : 16-bit unique key.
SL_TOKEN_GET_STATIC_SECURE_TOKEN#
#define SL_TOKEN_GET_STATIC_SECURE_TOKENValue:
Helper MACRO to create a new static secure token in 32-bit identifier format, the tokens created are stored in dedicated flash region, with additional security measures and are not protected by mass/device erase, this MACRO can be used with sl_token_get_data() or sl_token_set_data() functions, for more information `sl_token_manager_defines.h`.
type : Static Token.
static token type : 1 - Static secure token region (dedicated flash region)
key : 16-bit unique key.
SL_TOKEN_GET_DYNAMIC_TOKEN#
#define SL_TOKEN_GET_DYNAMIC_TOKENValue:
Helper MACRO to create dynamic token, user has to take care of providing the unique token for each NVM3 token created, the tokens created are stored in NVM3 region and are not protected by mass/device/nvm3 erase, this MACRO can be used with sl_token_get_data() or sl_token_set_data() functions, for more information `sl_token_manager_defines.h`.
Key format :
31:27 | 26:21 | 20 | 19:16 | 15:0 |
|---|---|---|---|---|
type | reserved | NVM3 object type | NVM3 domain | NVM3 key |
NVM3 object type : 0 - Data object 1 - Counter object
NVM3 domain : NVM3 Default Instance Key Space Regions NVM3 key space regions key space regions
NVM3 key : 16-bit unique key.
SL_TOKEN_GET_DYNAMIC_SECONDARY_INSTANCE_TOKEN#
#define SL_TOKEN_GET_DYNAMIC_SECONDARY_INSTANCE_TOKENValue:
Helper MACRO to create dynamic token for NVM3 secondary instance, user has to take care of providing the unique token for each NVM3 token created, the tokens created are stored in NVM3 region and are not protected by mass/device/nvm3 erase, this MACRO can be used with sl_token_get_data() or sl_token_set_data() functions, for more information `sl_token_manager_defines.h`.
Note
This is specifically used for Z-Wave usage, where the secondary instance of NVM3 is utilized.
SL_TOKEN_GET_DYNAMIC_OVER_RIDE_TOKEN#
#define SL_TOKEN_GET_DYNAMIC_OVER_RIDE_TOKENValue:
Helper MACRO to create a NVM3 override key for static token, this MACRO can be used with sl_token_get_data() or sl_token_set_data() functions, the range for NVM3 Domain region for a static token override key is predefined for more information `sl_token_manager_defines.h`.
type : NVM3 Override Token.
NVM3 region : The region 0x80000 is used for static override tokens.
NVM3 key (high nibble): Most significant 4 bits of the NVM3 key. 0xE000 for static device tokens. 0xF000 for static secure tokens.
NVM3 key (low 12 bits): Least significant 12 bits of the NVM3 key. The static token key is a 16-bit unique value. For override tokens, the high nibble identifies the key type(NVM3 key (high nibble)), and the remaining 12 bits are reused.