![]() |
MT7687 API Reference
LinkIt SDK v4
|
This section introduces the NVDM APIs including terms and acronyms, supported features, software architecture, details on how to use the NVDM, enums, structures, typedefs and functions. More...
This section introduces the NVDM APIs including terms and acronyms, supported features, software architecture, details on how to use the NVDM, enums, structures, typedefs and functions.
| Terms | Details |
|---|---|
| NVDM | Non-volatile Data Management is a middleware used to store user data. |
Functions | |
| nvdm_status_t | nvdm_init (void) |
| This function initializes the NVDM module to enable the NVDM services. More... | |
| nvdm_status_t | nvdm_write_data_item (const char *group_name, const char *data_item_name, nvdm_data_item_type_t type, const uint8_t *buffer, uint32_t size) |
| This function is used to write or update a data item to flash. More... | |
| nvdm_status_t | nvdm_read_data_item (const char *group_name, const char *data_item_name, uint8_t *buffer, uint32_t *size) |
| This function is used to read the data item from flash. More... | |
| nvdm_status_t | nvdm_delete_data_item (const char *group_name, const char *data_item_name) |
| nvdm_status_t | nvdm_delete_group (const char *group_name) |
| nvdm_status_t | nvdm_delete_all (void) |
| nvdm_status_t | nvdm_query_begin (void) |
| nvdm_status_t | nvdm_query_end (void) |
| nvdm_status_t | nvdm_query_next_group_name (char *group_name) |
| This function is used to enumerate all available group names. More... | |
| nvdm_status_t | nvdm_query_next_data_item_name (char *data_item_name) |
| This function is used to enumerate all available data item names from the group returned by nvdm_query_next_group_name(). More... | |
Modules | |
| Enum | |
| nvdm_status_t nvdm_init | ( | void | ) |
This function initializes the NVDM module to enable the NVDM services.
User should not call nvdm_read_data_item() or nvdm_write_data_item() before nvdm_init(). Call nvdm_init() only once during the initialization.
| nvdm_status_t nvdm_query_next_data_item_name | ( | char * | data_item_name | ) |
This function is used to enumerate all available data item names from the group returned by nvdm_query_next_group_name().
The next available data item name is returned each time user calls this API. If the user calls the API after all available data item names are returned, the return value will be NVDM_STATUS_ITEM_NOT_FOUND.
| [out] | data_item_name | return the name of next data item belonging the specifc group. |
| nvdm_status_t nvdm_query_next_group_name | ( | char * | group_name | ) |
This function is used to enumerate all available group names.
The next available group name is returned each time user calls this API. If the user calls the API after all available group names are returned, the return value will be NVDM_STATUS_ITEM_NOT_FOUND.
| [out] | group_name | return the name of the next group available. |
| nvdm_status_t nvdm_read_data_item | ( | const char * | group_name, |
| const char * | data_item_name, | ||
| uint8_t * | buffer, | ||
| uint32_t * | size | ||
| ) |
This function is used to read the data item from flash.
If there is no such data item, it returns NVDM_STATUS_ITEM_NOT_FOUND. User should check the return status to verify whether the data read from the flash is correct.
| [in] | group_name | is the group name of the data item, such as "Bluetooth". |
| [in] | data_item_name | is the name of the data item, such as an "address" of "Bluetooth". |
| [out] | buffer | is a pointer to the user buffer, that stores the data item content read from the flash. |
| [in,out] | size | is the user buffer size when used as an input and is the size of actual data item's content read out when used as an output. |
| nvdm_status_t nvdm_write_data_item | ( | const char * | group_name, |
| const char * | data_item_name, | ||
| nvdm_data_item_type_t | type, | ||
| const uint8_t * | buffer, | ||
| uint32_t | size | ||
| ) |
This function is used to write or update a data item to flash.
If there are existing data items on the flash, the NVDM invalidates old values and replaces with new ones. No other operation is performed while the data is being written to the flash. This function returns after the data is completely written to the flash. User should check the return status to verify whether the data is written to flash successfully.
| [in] | type | is the data item type, which defines how the value is displayed. |
| [in] | group_name | is the group name of the data item, such as "Bluetooth". |
| [in] | data_item_name | is the name of the data item, such as "address" of the "Bluetooth". |
| [in] | buffer | is a pointer to the data item's content. |
| [in] | size | is the size of the data item's content. |