Skip to content

Configuration

Functions

mira_config_get_size

mira_size_t mira_config_get_size(void);

Get size of non-volatile configuration memory.

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

Name Description
dst Pointer to where the read data should be stored.
size Number of bytes to read.

Return value

Name 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_read_partition

mira_status_t mira_config_read_partition(void *dst, mira_size_t data_size, mira_size_t partition_start);

Read from a partition within non-volatile configuration memory.

This is useful to read configuration parameters which have been stored at a specific place in config memory.

Parameters

Name Description
dst Pointer to where the read data should be stored.
data_size Number of bytes to read.
partition_start Offset within the configuration memory where the partition starts.

Return value

Name Description
MIRA_SUCCESS The operation was successful.
MIRA_ERROR_RESOURCE_NOT_AVAILABLE Memory controller is busy.
MIRA_ERROR_INVALID_VALUE Offset + 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

Name 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 value

Name Description
MIRA_SUCCESS The operation started successfully.
MIRA_ERROR_INVALID_VALUE Base + size is out of memory region.

mira_config_write_partition

mira_status_t mira_config_write_partition(mira_size_t partition_start, mira_size_t partition_size, void *src, mira_size_t data_size);

Write to an application defined partition in user config.

This is useful to write configuration data to a specific place in config memory while retaining previous config outside of the specified partition. Writing is non-blocking.

Parameters

Name Description
partition_start Offset within the configuration memory where the partition starts.
partition_size Size of partition.
src Pointer to the data to be written. Data on this address must not be changed until configuration memory controller is no longer busy.
data_size Number of bytes to write.

Return value

Name 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

Name Description
MIRA_TRUE Configuration memory controller is busy working.
MIRA_FALSE Configuration memory controller is not busy working.