WS63 SDK 文档 7021f4f@fbb_ws63
ws63 和 ws63e 解决方案的 SDK 文档
载入中...
搜索中...
未找到
soc_nv_storage.c 文件参考
#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"
soc_nv_storage.c 的引用(Include)关系图:

函数

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键值改变通知的回调函数
 

函数说明

◆ uapi_nv_delete_key()

errcode_t uapi_nv_delete_key ( uint16_t  key)

Erase an stored value given its key

参数
keykey of the key to erase
返回
SOC_ERR_SUCCESS or an error code

◆ uapi_nv_get_key_attr()

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

参数
keykey of the value to get
lengthlength of the current key
attrThe storage attributes of a key.
返回
SOC_ERR_SUCCESS or an error code

◆ uapi_nv_is_stored()

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

描述:
Check whether NV data has been stored. If the stored data is the same as the input parameter data,a success message is returned. CNcomment:检查NV数据是否已存储。如果存储的数据与入参数据相同,则返回成功 CNend
注意
None.
参数
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
返回值
trueSuccess
falseFailure
依赖:
参见
None

◆ uapi_nv_update_key_attr()

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.

参数
keykey to associate make permanent
attrSets the storage attributes of a key.
返回
SOC_ERR_SUCCESS or an error code
注解
This key can not then be deleted or overwitten, and there is no mechanism to undo this

◆ uapi_nv_write_force()

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.

参数
keykey to associate kvalue to
kvaluevalue to store
kvalue_lengthlength in bytes of kvalue
返回
SOC_ERR_SUCCESS or an error code