Macros
Settings specific macros. More...
Macros |
|
#define | GOS_NVM_KEY (type, subtype) _GOS_NVM_ENTRY_KEY(type, subtype) |
#define | GOS_NVM_DEFINE_TYPE (type, value) _GOS_NVM_DEFINE_ENTRY_TYPE(type, value) |
#define | GOS_NVM_DEFINE_SUBTYPE (type, subtype, value) _GOS_NVM_DEFINE_ENTRY_SUBTYPE(type, subtype, value) |
#define | GOS_NVM_DEFINE_ENTRY (type, subtype, subtype_value, length) |
#define | GOS_NVM_CREATE_DEFAULT_ENTRY (type, subtype, data_type, default_value) |
#define | GOS_NVM_CREATE_DEFAULT_ARRAY (type, subtype, array_type, array_length, default_value) |
#define | GOS_NVM_GET (type, subtype, value_ptr) _GOS_NVM_GET_ENTRY(type, subtype, value_ptr) |
#define | GOS_NVM_UPDATE (type, subtype, value) _GOS_NVM_UPDATE(type, subtype, value) |
#define | GOS_NVM_UPDATE_FORCED (type, subtype, value) _GOS_NVM_UPDATE_FORCED(type, subtype, value) |
Detailed Description
Settings specific macros.
Macro Definition Documentation
◆ GOS_NVM_CREATE_DEFAULT_ARRAY
#define GOS_NVM_CREATE_DEFAULT_ARRAY | ( |
type,
|
|
subtype,
|
|||
array_type,
|
|||
array_length,
|
|||
default_value
|
|||
) |
Create a default value array for a given NVM entry
- Parameters
-
type
name of NVM entry type subtype
name of NVM entry subtype array_type
The data type of each array element array_length
Number of element in array default_value
The default value of the array
- Examples:
- system/application_nvm/nvm_defaults.c , and system/custom_commands/nvm_defaults.c .
◆ GOS_NVM_CREATE_DEFAULT_ENTRY
#define GOS_NVM_CREATE_DEFAULT_ENTRY | ( |
type,
|
|
subtype,
|
|||
data_type,
|
|||
default_value
|
|||
) |
Create a default value for a given NVM entry
- Parameters
-
type
name of NVM entry type subtype
name of NVM entry subtype data_type
The data type of the NVM entry default_value
The default value of the NVM entry
◆ GOS_NVM_DEFINE_ENTRY
#define GOS_NVM_DEFINE_ENTRY | ( |
type,
|
|
subtype,
|
|||
subtype_value,
|
|||
length
|
|||
) |
Define a NVM entry
- Parameters
-
type
name of NVM entry type subtype
name of NVM entry subtype subtype_value
numeric value of NVM entry subtype (0-127) length
Maximum length of the entry's data
◆ GOS_NVM_DEFINE_SUBTYPE
#define GOS_NVM_DEFINE_SUBTYPE | ( |
type,
|
|
subtype,
|
|||
value
|
|||
) | _GOS_NVM_DEFINE_ENTRY_SUBTYPE(type, subtype, value) |
Define a NVM entry 'subtype' for a given 'type'
- Parameters
-
type
name of type this subtype belongs subtype
name of the subtype value
Numeric value of NVM subtype (0-127)
◆ GOS_NVM_DEFINE_TYPE
#define GOS_NVM_DEFINE_TYPE | ( |
type,
|
|
value
|
|||
) | _GOS_NVM_DEFINE_ENTRY_TYPE(type, value) |
Define a NVM entry 'type'
- Parameters
-
type
name of the NVM entry value
Numeric value of NVM entry (0-31)
◆ GOS_NVM_GET
#define GOS_NVM_GET | ( |
type,
|
|
subtype,
|
|||
value_ptr
|
|||
) | _GOS_NVM_GET_ENTRY(type, subtype, value_ptr) |
Retrieve a pointer to a NVM cached entry
This is helper macro for gos_nvm_retrieve() See gos_nvm_retrieve() for more information.
- Parameters
-
type
name of NVM entry type subtype
name of NVM entry subtype value_ptr
Pointer to hold reference to NVM cache entry
- Returns
- gos_result_t , the result of retrieving a refernce to the NVM cache entry
◆ GOS_NVM_KEY
#define GOS_NVM_KEY | ( |
type,
|
|
subtype
|
|||
) | _GOS_NVM_ENTRY_KEY(type, subtype) |
A key to lookup a value in the NVM
- Parameters
-
type
The NVM entry 'type' subtype
The NVM entry 'subtype'
◆ GOS_NVM_UPDATE
#define GOS_NVM_UPDATE | ( |
type,
|
|
subtype,
|
|||
value
|
|||
) | _GOS_NVM_UPDATE(type, subtype, value) |
Attempt to update an existing NVM entry in cache
This is a helper macro for gos_nvm_update() See gos_nvm_update() for more information
- Parameters
-
type
name of NVM entry type subtype
name of NVM entry subtype value
Pointer to buffer containing new NVM entry value
- Returns
- gos_result_t , the result of updating
◆ GOS_NVM_UPDATE_FORCED
#define GOS_NVM_UPDATE_FORCED | ( |
type,
|
|
subtype,
|
|||
value
|
|||
) | _GOS_NVM_UPDATE_FORCED(type, subtype, value) |
Attempt to update an existing NVM entry in cache, if the entry does not exist, create a new entry with the given value.
This is a helper macro for gos_nvm_update() See gos_nvm_update() for more information
- Parameters
-
type
name of NVM entry type subtype
name of NVM entry subtype value
Pointer to buffer containing new NVM entry value
- Returns
- gos_result_t , the result of updating