Configuration¶
Functions¶
mira_config_get_size¶
mira_size_t mira_config_get_size( void);
Get size of non-volatile configuration memory.
Return
The available size.
mira_config_read¶
mira_status_t mira_config_read( void* dst, mira_size_t size);
Read from non-volatile configuration memory. This is useful to store per-unit configuration and identification parameters, such as product type or network parameters.
Parameters
Parameter | Description |
---|---|
dst |
Pointer to where the read data should be stored. |
size |
Number of bytes to read. |
Return
Status code indicating if the operation was successful.
Value | Description |
---|---|
MIRA_SUCCESS |
The operation was successful. |
MIRA_ERROR_RESOURCE_NOT_AVAILABLE |
Memory controller is busy |
MIRA_ERROR_INVALID_VALUE |
Base + size is out of memory region. |
mira_config_write¶
mira_status_t mira_config_write( void* src, mira_size_t size);
Write to non-volatile configuration memory. This is useful to store per-unit configuration and identification parameters, such as product type or network parameters. Writing will erase any previous data in the non-volatile configuration memory. Writing is non-blocking.
Parameters
Parameter | Description |
---|---|
src |
Pointer to the data to be written. Data on this address must not be changed until configuration memory controller is no longer busy. |
size |
Number of bytes to write. |
Return
Status code indicating if the operation was successful.
Value | Description |
---|---|
MIRA_SUCCESS |
The operation started successfully. |
MIRA_ERROR_INVALID_VALUE |
Base + size is out of memory region. |
mira_config_is_working¶
mira_bool_t mira_config_is_working( );
Check if the non-volatile configuration memory controller is busy. Used to wait for write completion as in the following example:
mira_config_write(...); PROCESS_WAIT_WHILE(mira_config_is_working());
Return
Value | Description |
---|---|
MIRA_TRUE |
Configuration memory controller is busy working. |
MIRA_FALSE |
Configuration memory controller is not busy working. |