Zephyr API Documentation
3.0.0
A Scalable Open Source RTOS
3.0.0
Toggle main menu visibility
Main Page
Related Pages
Modules
Data Structures
Data Structures
Data Structure Index
Data Fields
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
Variables
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerator
Files
File List
Globals
All
$
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
$
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Macros
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
•
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Modules
Pages
nvs.h
Go to the documentation of this file.
1
/* NVS: non volatile storage in flash
2
*
3
* Copyright (c) 2018 Laczen
4
*
5
* SPDX-License-Identifier: Apache-2.0
6
*/
7
#ifndef ZEPHYR_INCLUDE_FS_NVS_H_
8
#define ZEPHYR_INCLUDE_FS_NVS_H_
9
10
#include <
sys/types.h
>
11
#include <kernel.h>
12
#include <device.h>
13
14
#ifdef __cplusplus
15
extern
"C"
{
16
#endif
17
47
struct
nvs_fs
{
48
off_t
offset
;
49
uint32_t
ate_wra
;
50
uint32_t
data_wra
;
51
uint16_t
sector_size
;
52
uint16_t
sector_count
;
53
bool
ready
;
54
struct
k_mutex
nvs_lock
;
55
const
struct
device
*
flash_device
;
56
const
struct
flash_parameters
*
flash_parameters
;
57
};
58
80
int
nvs_init
(
struct
nvs_fs
*fs,
const
char
*dev_name);
81
90
int
nvs_clear
(
struct
nvs_fs
*fs);
91
106
ssize_t
nvs_write
(
struct
nvs_fs
*fs,
uint16_t
id
,
const
void
*
data
,
size_t
len);
107
118
int
nvs_delete
(
struct
nvs_fs
*fs,
uint16_t
id
);
119
135
ssize_t
nvs_read
(
struct
nvs_fs
*fs,
uint16_t
id
,
void
*
data
,
size_t
len);
136
153
ssize_t
nvs_read_hist
(
struct
nvs_fs
*fs,
uint16_t
id
,
void
*
data
,
size_t
len,
uint16_t
cnt);
154
166
ssize_t
nvs_calc_free_space
(
struct
nvs_fs
*fs);
167
172
#ifdef __cplusplus
173
}
174
#endif
175
176
#endif
/* ZEPHYR_INCLUDE_FS_NVS_H_ */
nvs_init
int nvs_init(struct nvs_fs *fs, const char *dev_name)
nvs_init
nvs_read
ssize_t nvs_read(struct nvs_fs *fs, uint16_t id, void *data, size_t len)
nvs_read
nvs_write
ssize_t nvs_write(struct nvs_fs *fs, uint16_t id, const void *data, size_t len)
nvs_write
nvs_calc_free_space
ssize_t nvs_calc_free_space(struct nvs_fs *fs)
nvs_calc_free_space
nvs_clear
int nvs_clear(struct nvs_fs *fs)
nvs_clear
nvs_delete
int nvs_delete(struct nvs_fs *fs, uint16_t id)
nvs_delete
nvs_read_hist
ssize_t nvs_read_hist(struct nvs_fs *fs, uint16_t id, void *data, size_t len, uint16_t cnt)
nvs_read_hist
types.h
ssize_t
__SIZE_TYPE__ ssize_t
Definition:
types.h:28
uint32_t
__UINT32_TYPE__ uint32_t
Definition:
stdint.h:60
uint16_t
__UINT16_TYPE__ uint16_t
Definition:
stdint.h:59
device
Runtime device structure (in ROM) per driver instance.
Definition:
device.h:450
flash_parameters
Definition:
flash.h:55
k_mutex
Definition:
kernel.h:2629
nvs_fs
Non-volatile Storage File system structure.
Definition:
nvs.h:47
nvs_fs::flash_device
const struct device * flash_device
Definition:
nvs.h:55
nvs_fs::sector_size
uint16_t sector_size
Definition:
nvs.h:51
nvs_fs::ready
bool ready
Definition:
nvs.h:53
nvs_fs::flash_parameters
const struct flash_parameters * flash_parameters
Definition:
nvs.h:56
nvs_fs::nvs_lock
struct k_mutex nvs_lock
Definition:
nvs.h:54
nvs_fs::offset
off_t offset
Definition:
nvs.h:48
nvs_fs::ate_wra
uint32_t ate_wra
Definition:
nvs.h:49
nvs_fs::sector_count
uint16_t sector_count
Definition:
nvs.h:52
nvs_fs::data_wra
uint32_t data_wra
Definition:
nvs.h:50
data
static fdata_t data[2]
Definition:
test_fifo_contexts.c:15
include
fs
nvs.h
Generated on Mon Feb 21 2022 22:43:01 for Zephyr API Documentation by
1.9.2