|
WS63 SDK 文档 7021f4f@fbb_ws63
ws63 和 ws63e 解决方案的 SDK 文档
|
#include "nv.h"#include "nv_storage.h"#include "nv_store.h"#include "nv_reset.h"#include "securec.h"#include "nv_porting.h"#include "common_def.h"#include "nv_config.h"#include "systick.h"#include "nv_async_store.h"#include "nv_update.h"#include "nv_notify.h"#include "nv_task_adapt.h"#include "nv_storage_handle.h"
函数 | |
| void | uapi_nv_init (void) |
| 初始化nv模块,必须在使用nv函数之前调用。 | |
| errcode_t | uapi_nv_write_with_attr (uint16_t key, const uint8_t *kvalue, uint16_t kvalue_length, nv_key_attr_t *attr, nv_storage_completed_callback func) |
| 写入NV数据项,并根据业务需求配置属性及回调函数 | |
| errcode_t | uapi_nv_write (uint16_t key, const uint8_t *kvalue, uint16_t kvalue_length) |
| 写入NV数据项 | |
| errcode_t | uapi_nv_write_force (uint16_t key, const uint8_t *kvalue, uint16_t kvalue_length) |
| errcode_t | uapi_nv_update_key_attr (uint16_t key, nv_key_attr_t *attr, nv_storage_completed_callback func) |
| errcode_t | uapi_nv_get_key_attr (uint16_t key, uint16_t *length, nv_key_attr_t *attr) |
| errcode_t | uapi_nv_read_with_attr (uint16_t key, uint16_t kvalue_max_length, uint16_t *kvalue_length, uint8_t *kvalue, nv_key_attr_t *attr) |
| 读取指定NV数据项的值,同时获取key的属性值 | |
| errcode_t | uapi_nv_read (uint16_t key, uint16_t kvalue_max_length, uint16_t *kvalue_length, uint8_t *kvalue) |
| 读取指定NV数据项的值 | |
| errcode_t | uapi_nv_delete_key (uint16_t key) |
| bool | uapi_nv_is_stored (uint16_t key, uint16_t kvalue_length, const uint8_t *kvalue) |
| compare a value associated with a specific key. CNcomment:检验特定NV的值 CNend | |
| errcode_t | uapi_nv_get_store_status (nv_store_status_t *status) |
| 获取NV存储的空间使用情况 | |
| errcode_t | uapi_nv_backup (const nv_backup_mode_t *backup_mode) |
| 执行NV备份 | |
| errcode_t | uapi_nv_set_restore_mode_all (void) |
| 设置NV全量恢复标志 | |
| errcode_t | uapi_nv_set_restore_mode_partitial (const nv_restore_mode_t *restore_mode) |
| 设置NV部分恢复标志 | |
| errcode_t | uapi_nv_flush (void) |
| 确保NV数据从Ram上同步到Falsh | |
| errcode_t | uapi_nv_register_change_notify_proc (uint16_t min_key, uint16_t max_key, nv_changed_notify_func func) |
| 注册nv键值改变通知的回调函数 | |
| errcode_t uapi_nv_delete_key | ( | uint16_t | key | ) |
Erase an stored value given its key
| key | key of the key to erase |
| errcode_t uapi_nv_get_key_attr | ( | uint16_t | key, |
| uint16_t * | length, | ||
| nv_key_attr_t * | attr | ||
| ) |
Get key information associated with a specific key
| key | key of the value to get |
| length | length of the current key |
| attr | The storage attributes of a key. |
| bool uapi_nv_is_stored | ( | uint16_t | key, |
| uint16_t | kvalue_length, | ||
| const uint8_t * | kvalue | ||
| ) |
compare a value associated with a specific key. CNcomment:检验特定NV的值 CNend
| key | [IN] The key to which the kvalue is associated. CNcomment:要检验的NV ID CNend |
| kvalue_length | [IN] Length of kvalue in bytes. CNcomment:要检验的NV长度 CNend |
| kvalue | [IN] The value to store.CNcomment:待进行对比的NV值 CNend |
| errcode_t uapi_nv_update_key_attr | ( | uint16_t | key, |
| nv_key_attr_t * | attr, | ||
| nv_storage_completed_callback | func | ||
| ) |
Update the attributes of an existing key.
| key | key to associate make permanent |
| attr | Sets the storage attributes of a key. |
| errcode_t uapi_nv_write_force | ( | uint16_t | key, |
| const uint8_t * | kvalue, | ||
| uint16_t | kvalue_length | ||
| ) |
Force store a key value pair, even if the key has been set to permanent.
| key | key to associate kvalue to |
| kvalue | value to store |
| kvalue_length | length in bytes of kvalue |