|
WS63 SDK 文档 7021f4f@fbb_ws63
ws63 和 ws63e 解决方案的 SDK 文档
|
结构体 | |
| struct | nv_key_attr_t |
| NV属性 更多... | |
| struct | nv_store_status_t |
| nv存储状态 更多... | |
| struct | nv_restore_mode_t |
| 恢复出厂区域配置,true代表要恢复 更多... | |
| struct | nv_backup_mode_t |
| 备份区域配置,true代表要备份 更多... | |
类型定义 | |
| typedef void(* | nv_storage_completed_callback) (errcode_t result) |
| nv存储回调函数。 | |
| typedef void(* | nv_changed_notify_func) (uint16_t key) |
| nv值更改回调函数。 | |
枚举 | |
| enum | nv_key_id_region_t { KEY_ID_REGION0 , KEY_ID_REGION1 , KEY_ID_REGION2 , KEY_ID_REGION3 , KEY_ID_REGION4 , KEY_ID_REGION5 , KEY_ID_REGION6 , KEY_ID_REGION7 , KEY_ID_REGION8 , KEY_ID_REGION9 , KEY_ID_REGION10 , KEY_ID_REGION11 , KEY_ID_REGION12 , KEY_ID_REGION13 , KEY_ID_REGION14 , KEY_ID_REGION15 , KEY_ID_REGION_MAX_NUM } |
| key_id取值区域 更多... | |
函数 | |
| void | uapi_nv_init (void) |
| 初始化nv模块,必须在使用nv函数之前调用。 | |
| errcode_t | uapi_nv_write (uint16_t key, const uint8_t *kvalue, uint16_t kvalue_length) |
| 写入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_read (uint16_t key, uint16_t kvalue_max_length, uint16_t *kvalue_length, uint8_t *kvalue) |
| 读取指定NV数据项的值 | |
| 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_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键值改变通知的回调函数 | |
Copyright (c) HiSilicon (Shanghai) Technologies Co., Ltd. 2018-2022. All rights reserved.
Description: NV STORAGE INTERFACE
History:
2022-02-25, fix comments.
2018-08-08, Create file.
| typedef void(* nv_changed_notify_func) (uint16_t key) |
nv值更改回调函数。
| typedef void(* nv_storage_completed_callback) (errcode_t result) |
nv存储回调函数。
| enum nv_key_id_region_t |
key_id取值区域
| errcode_t uapi_nv_backup | ( | const nv_backup_mode_t * | backup_mode | ) |
执行NV备份
| errcode_t uapi_nv_flush | ( | void | ) |
确保NV数据从Ram上同步到Falsh
| errcode_t uapi_nv_get_store_status | ( | nv_store_status_t * | status | ) |
获取NV存储的空间使用情况
| void uapi_nv_init | ( | void | ) |
初始化nv模块,必须在使用nv函数之前调用。
| 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_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_register_change_notify_proc | ( | uint16_t | min_key, |
| uint16_t | max_key, | ||
| nv_changed_notify_func | func | ||
| ) |
注册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_write | ( | uint16_t | key, |
| const uint8_t * | kvalue, | ||
| uint16_t | kvalue_length | ||
| ) |
写入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数据项,并根据业务需求配置属性及回调函数