Zephyr API Documentation
2.7.0-rc2
A Scalable Open Source RTOS
|
Non-volatile Storage APIs. More...
Functions | |
int | nvs_init (struct nvs_fs *fs, const char *dev_name) |
nvs_init More... | |
int | nvs_clear (struct nvs_fs *fs) |
nvs_clear More... | |
ssize_t | nvs_write (struct nvs_fs *fs, uint16_t id, const void *data, size_t len) |
nvs_write More... | |
int | nvs_delete (struct nvs_fs *fs, uint16_t id) |
nvs_delete More... | |
ssize_t | nvs_read (struct nvs_fs *fs, uint16_t id, void *data, size_t len) |
nvs_read More... | |
ssize_t | nvs_read_hist (struct nvs_fs *fs, uint16_t id, void *data, size_t len, uint16_t cnt) |
nvs_read_hist More... | |
ssize_t | nvs_calc_free_space (struct nvs_fs *fs) |
nvs_calc_free_space More... | |
Non-volatile Storage APIs.
#include <include/fs/nvs.h>
nvs_calc_free_space
Calculate the available free space in the file system.
fs | Pointer to file system |
int nvs_clear | ( | struct nvs_fs * | fs | ) |
#include <include/fs/nvs.h>
nvs_clear
Clears the NVS file system from flash.
fs | Pointer to file system |
0 | Success |
-ERRNO | errno code if error |
#include <include/fs/nvs.h>
nvs_delete
Delete an entry from the file system
fs | Pointer to file system |
id | Id of the entry to be deleted |
0 | Success |
-ERRNO | errno code if error |
int nvs_init | ( | struct nvs_fs * | fs, |
const char * | dev_name | ||
) |
#include <include/fs/nvs.h>
nvs_init
Initializes a NVS file system in flash.
fs | Pointer to file system |
dev_name | Pointer to flash device name |
0 | Success |
-ERRNO | errno code if error |
#include <include/fs/nvs.h>
nvs_read
Read an entry from the file system.
fs | Pointer to file system |
id | Id of the entry to be read |
data | Pointer to data buffer |
len | Number of bytes to be read |
#include <include/fs/nvs.h>
nvs_read_hist
Read a history entry from the file system.
fs | Pointer to file system |
id | Id of the entry to be read |
data | Pointer to data buffer |
len | Number of bytes to be read |
cnt | History counter: 0: latest entry, 1:one before latest ... |
#include <include/fs/nvs.h>
nvs_write
Write an entry to the file system.
fs | Pointer to file system |
id | Id of the entry to be written |
data | Pointer to the data to be written |
len | Number of bytes to be written |