WS63 SDK 文档 7021f4f@fbb_ws63
ws63 和 ws63e 解决方案的 SDK 文档
载入中...
搜索中...
未找到
nv_store.h
浏览该文件的文档.
1/*
2 * Copyright (c) HiSilicon (Shanghai) Technologies Co., Ltd. 2019-2022. All rights reserved.
3 * Description: KV Storage Library store access interface
4 */
5
6#ifndef NV_STORE_H
7#define NV_STORE_H
8
9#include "nv_page.h"
10#include "platform_types.h"
11#include "nv.h"
12#include "errcode.h"
13
14#ifdef __cplusplus
15#if __cplusplus
16extern "C" {
17#endif /* __cplusplus */
18#endif /* __cplusplus */
19
21#define KV_STORE_ID_SCPU 0xCB7E
22#define KV_STORE_ID_ACPU 0x254D
23#define KV_STORE_ID_BACKUP 0x34B2
24
29
30typedef struct {
33 uint8_t *kvalue;
35
38uint16_t kv_store_get_id(kv_store_t store);
40errcode_t kv_store_get_page_handle(kv_store_t store, uint32_t page_index, kv_page_handle_t *page);
43 kv_page_location page_location);
44errcode_t kv_store_get_key_attr(kv_store_t store, kv_key_id key_id, uint16_t *len, kv_attributes_t *attributes);
46 kv_attributes_t *attributes);
48errcode_t kv_store_find_write_page(kv_store_t store, uint32_t required_space, kv_page_handle_t *page,
49 kv_page_status_t *page_status);
52 kv_attributes_t *attributes, kv_key_handle_t *backup_key);
53
54#ifdef __cplusplus
55#if __cplusplus
56}
57#endif /* __cplusplus */
58#endif /* __cplusplus */
59
60#endif /* NV_STORE_H_ */
cores_t
Generic enum to specify the required core. By using an enum, type safety can be enforced at compile t...
Definition platform_types.h:21
uint32_t errcode_t
Definition of error code.
Definition errcode.h:30
uint16_t kv_key_id
Definition nv_key.h:66
kv_attributes_t
Definition nv_key.h:54
const void * kv_page_location
Definition nv_page.h:20
errcode_t kv_store_get_backup_key(kv_key_id key_id, kv_store_key_data_t *key_data, kv_attributes_t *attributes, kv_page_location page_location)
Definition nv_store.c:217
cores_t kv_store_to_core(kv_store_t store)
errcode_t kv_store_get_status(kv_store_t store, nv_store_status_t *store_status)
Definition nv_store.c:242
uint16_t kv_store_get_id(kv_store_t store)
Definition nv_store.c:38
errcode_t kv_store_get_key_attr(kv_store_t store, kv_key_id key_id, uint16_t *len, kv_attributes_t *attributes)
Definition nv_store.c:112
errcode_t kv_store_read_backup_key(kv_key_id key_id, kv_store_key_data_t *key_data, kv_attributes_t *attributes)
Definition nv_store.c:164
errcode_t kv_store_get_page_handle(kv_store_t store, uint32_t page_index, kv_page_handle_t *page)
Definition nv_store.c:54
uint8_t kv_store_get_page_count(kv_store_t store)
Definition nv_store.c:46
kv_store_t kv_store_from_core(cores_t core)
errcode_t kv_store_find_write_page(kv_store_t store, uint32_t required_space, kv_page_handle_t *page, kv_page_status_t *page_status)
Definition nv_store.c:271
errcode_t kv_store_find_valid_key(kv_store_t store, kv_key_id key_id, kv_key_handle_t *key)
Definition nv_store.c:71
errcode_t kv_store_get_backup_key_attr(kv_key_id key_id, uint16_t *len, kv_attributes_t *attributes, kv_key_handle_t *backup_key)
Definition nv_store.c:128
kv_store_t
Definition nv_store.h:25
@ KV_STORE_MAX_NUM
Definition nv_store.h:27
@ KV_STORE_APPLICATION
Definition nv_store.h:26
errcode_t kv_store_get_key(kv_store_t store, kv_key_id key_id, kv_store_key_data_t *key_data, kv_attributes_t *attributes)
Definition nv_store.c:192
Definition nv_key.h:96
Definition nv_page.h:36
Definition nv_page.h:41
Definition nv_store.h:30
uint16_t kvalue_max_length
Definition nv_store.h:31
uint8_t * kvalue
Definition nv_store.h:33
uint16_t kvalue_actual_length
Definition nv_store.h:32
nv存储状态
Definition nv.h:73