7#ifndef ZEPHYR_INCLUDE_FS_NVS_H_
8#define ZEPHYR_INCLUDE_FS_NVS_H_
62#if CONFIG_NVS_LOOKUP_CACHE
63 uint32_t lookup_cache[CONFIG_NVS_LOOKUP_CACHE_SIZE];
ssize_t nvs_read(struct nvs_fs *fs, uint16_t id, void *data, size_t len)
Read an entry from the file system.
ssize_t nvs_write(struct nvs_fs *fs, uint16_t id, const void *data, size_t len)
Write an entry to the file system.
ssize_t nvs_calc_free_space(struct nvs_fs *fs)
Calculate the available free space in the file system.
int nvs_clear(struct nvs_fs *fs)
Clear the NVS file system from flash.
int nvs_sector_use_next(struct nvs_fs *fs)
Close the currently active sector and switch to the next one.
int nvs_delete(struct nvs_fs *fs, uint16_t id)
Delete an entry from the file system.
size_t nvs_sector_max_data_size(struct nvs_fs *fs)
Tell how many contiguous free space remains in the currently active NVS sector.
ssize_t nvs_read_hist(struct nvs_fs *fs, uint16_t id, void *data, size_t len, uint16_t cnt)
Read a history entry from the file system.
int nvs_mount(struct nvs_fs *fs)
Mount an NVS file system onto the flash device specified in fs.
__SIZE_TYPE__ ssize_t
Definition types.h:28
__INTPTR_TYPE__ off_t
Definition types.h:36
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
__UINT16_TYPE__ uint16_t
Definition stdint.h:89
Runtime device structure (in ROM) per driver instance.
Definition device.h:412
Flash memory parameters.
Definition flash.h:59
Mutex Structure.
Definition kernel.h:2994
Non-volatile Storage File system structure.
Definition nvs.h:39
const struct device * flash_device
Flash device runtime structure.
Definition nvs.h:59
uint16_t sector_size
File system is split into sectors, each sector must be multiple of erase-block-size.
Definition nvs.h:51
bool ready
Flag indicating if the file system is initialized.
Definition nvs.h:55
const struct flash_parameters * flash_parameters
Flash memory parameters structure.
Definition nvs.h:61
struct k_mutex nvs_lock
Mutex.
Definition nvs.h:57
off_t offset
File system offset in flash.
Definition nvs.h:41
uint32_t ate_wra
Allocation table entry write address.
Definition nvs.h:47
uint16_t sector_count
Number of sectors in the file system.
Definition nvs.h:53
uint32_t data_wra
Data write address.
Definition nvs.h:49