VSF Documented
Data Structures | Macros | Typedefs | Functions
nvs_flash_port.c File Reference
#include "../vsf_espidf_cfg.h"
#include <stdint.h>
#include <stdbool.h>
#include <string.h>
#include <stdlib.h>
#include "hal/vsf_hal.h"
#include "service/heap/vsf_heap.h"
#include "../include/esp_err.h"
#include "../include/esp_partition.h"
#include "../include/nvs.h"
#include "../include/nvs_flash.h"

Data Structures

struct  __nvs_disk_header_t
 
struct  __nvs_disk_entry_t
 
struct  __nvs_kv_t
 
struct  __nvs_store_t
 
struct  __nvs_handle_ctx_t
 
struct  nvs_opaque_iterator_t
 

Macros

#define __NVS_MAX_STORES   4
 
#define __NVS_MAX_HANDLES   16
 
#define __NVS_MAX_SERIAL_SIZE   (64u * 1024u)
 
#define __NVS_MAGIC   0x3153564Eu
 
#define __NVS_VERSION   1u
 
#define __NVS_HEADER_SIZE   20u
 
#define __NVS_DEF_SET_INT(__suffix, __ctype, __nvs_type)
 
#define __NVS_DEF_GET_INT(__suffix, __ctype, __nvs_type)
 

Typedefs

typedef struct __nvs_disk_header_t __nvs_disk_header_t
 
typedef struct __nvs_disk_entry_t __nvs_disk_entry_t
 
typedef struct __nvs_kv_t __nvs_kv_t
 
typedef struct __nvs_store_t __nvs_store_t
 
typedef struct __nvs_handle_ctx_t __nvs_handle_ctx_t
 
typedef struct nvs_opaque_iterator_t nvs_opaque_iterator_t
 

Functions

esp_err_t nvs_flash_init (void)
 Initialize the default NVS partition (label "nvs").
 
esp_err_t nvs_flash_init_partition (const char *partition_label)
 Initialize NVS storage for a named partition.
 
esp_err_t nvs_flash_init_partition_ptr (const esp_partition_t *partition)
 Initialize NVS storage from an esp_partition_t pointer.
 
esp_err_t nvs_flash_deinit (void)
 Deinitialize the default NVS partition.
 
esp_err_t nvs_flash_deinit_partition (const char *partition_label)
 Deinitialize NVS storage for a named partition.
 
esp_err_t nvs_flash_erase (void)
 Erase the default NVS partition (label "nvs").
 
esp_err_t nvs_flash_erase_partition (const char *part_name)
 Erase a named NVS partition.
 
esp_err_t nvs_flash_erase_partition_ptr (const esp_partition_t *partition)
 Erase a partition identified by pointer.
 
esp_err_t nvs_open (const char *namespace_name, nvs_open_mode_t open_mode, nvs_handle_t *out_handle)
 
esp_err_t nvs_open_from_partition (const char *part_name, const char *namespace_name, nvs_open_mode_t open_mode, nvs_handle_t *out_handle)
 
void nvs_close (nvs_handle_t handle)
 
esp_err_t nvs_commit (nvs_handle_t handle)
 
esp_err_t nvs_set_str (nvs_handle_t handle, const char *key, const char *value)
 
esp_err_t nvs_set_blob (nvs_handle_t handle, const char *key, const void *value, size_t length)
 
esp_err_t nvs_get_str (nvs_handle_t handle, const char *key, char *out_value, size_t *length)
 
esp_err_t nvs_get_blob (nvs_handle_t handle, const char *key, void *out_value, size_t *length)
 
esp_err_t nvs_erase_key (nvs_handle_t handle, const char *key)
 
esp_err_t nvs_erase_all (nvs_handle_t handle)
 
esp_err_t nvs_get_stats (const char *part_name, nvs_stats_t *nvs_stats)
 
esp_err_t nvs_get_used_entry_count (nvs_handle_t handle, size_t *used_entries)
 
esp_err_t nvs_entry_find (const char *part_name, const char *namespace_name, nvs_type_t type, nvs_iterator_t *output_iterator)
 
esp_err_t nvs_entry_next (nvs_iterator_t *iterator)
 
esp_err_t nvs_entry_info (const nvs_iterator_t iterator, nvs_entry_info_t *out_info)
 
void nvs_release_iterator (nvs_iterator_t iterator)
 

Macro Definition Documentation

◆ __NVS_MAX_STORES

#define __NVS_MAX_STORES   4

◆ __NVS_MAX_HANDLES

#define __NVS_MAX_HANDLES   16

◆ __NVS_MAX_SERIAL_SIZE

#define __NVS_MAX_SERIAL_SIZE   (64u * 1024u)

◆ __NVS_MAGIC

#define __NVS_MAGIC   0x3153564Eu

◆ __NVS_VERSION

#define __NVS_VERSION   1u

◆ __NVS_HEADER_SIZE

#define __NVS_HEADER_SIZE   20u

◆ __NVS_DEF_SET_INT

#define __NVS_DEF_SET_INT (   __suffix,
  __ctype,
  __nvs_type 
)
Value:
esp_err_t nvs_set_##__suffix(nvs_handle_t handle, const char *key, \
__ctype value) \
{ \
return __nvs_set_typed(handle, key, __nvs_type, &value, sizeof(value)); \
}
int esp_err_t
Definition esp_err.h:41
uint32_t nvs_handle_t
Definition nvs.h:64
vk_av_control_value_t value
Definition vsf_audio.h:171

◆ __NVS_DEF_GET_INT

#define __NVS_DEF_GET_INT (   __suffix,
  __ctype,
  __nvs_type 
)
Value:
esp_err_t nvs_get_##__suffix(nvs_handle_t handle, const char *key, \
__ctype *out_value) \
{ \
return __nvs_get_typed(handle, key, __nvs_type, out_value, NULL); \
}
#define NULL
Definition lvgl.h:26

Typedef Documentation

◆ __nvs_disk_header_t

◆ __nvs_disk_entry_t

◆ __nvs_kv_t

typedef struct __nvs_kv_t __nvs_kv_t

◆ __nvs_store_t

typedef struct __nvs_store_t __nvs_store_t

◆ __nvs_handle_ctx_t

◆ nvs_opaque_iterator_t

Function Documentation

◆ nvs_flash_init()

esp_err_t nvs_flash_init ( void  )

Initialize the default NVS partition (label "nvs").

◆ nvs_flash_init_partition()

esp_err_t nvs_flash_init_partition ( const char *  partition_label)

Initialize NVS storage for a named partition.

Parameters
partition_labelLabel of the partition (max 16 chars).

◆ nvs_flash_init_partition_ptr()

esp_err_t nvs_flash_init_partition_ptr ( const esp_partition_t partition)

Initialize NVS storage from an esp_partition_t pointer.

Parameters
partitionPartition descriptor obtained from esp_partition API.

◆ nvs_flash_deinit()

esp_err_t nvs_flash_deinit ( void  )

Deinitialize the default NVS partition.

◆ nvs_flash_deinit_partition()

esp_err_t nvs_flash_deinit_partition ( const char *  partition_label)

Deinitialize NVS storage for a named partition.

◆ nvs_flash_erase()

esp_err_t nvs_flash_erase ( void  )

Erase the default NVS partition (label "nvs").

If the partition is initialised, it is first deinitialised.

◆ nvs_flash_erase_partition()

esp_err_t nvs_flash_erase_partition ( const char *  part_name)

Erase a named NVS partition.

If the partition is initialised, it is first deinitialised.

◆ nvs_flash_erase_partition_ptr()

esp_err_t nvs_flash_erase_partition_ptr ( const esp_partition_t partition)

Erase a partition identified by pointer.

If the partition is initialised, it is first deinitialised.

◆ nvs_open()

esp_err_t nvs_open ( const char *  namespace_name,
nvs_open_mode_t  open_mode,
nvs_handle_t out_handle 
)

◆ nvs_open_from_partition()

esp_err_t nvs_open_from_partition ( const char *  part_name,
const char *  namespace_name,
nvs_open_mode_t  open_mode,
nvs_handle_t out_handle 
)

◆ nvs_close()

void nvs_close ( nvs_handle_t  handle)

◆ nvs_commit()

esp_err_t nvs_commit ( nvs_handle_t  handle)

◆ nvs_set_str()

esp_err_t nvs_set_str ( nvs_handle_t  handle,
const char *  key,
const char *  value 
)

◆ nvs_set_blob()

esp_err_t nvs_set_blob ( nvs_handle_t  handle,
const char *  key,
const void *  value,
size_t  length 
)

◆ nvs_get_str()

esp_err_t nvs_get_str ( nvs_handle_t  handle,
const char *  key,
char *  out_value,
size_t length 
)

◆ nvs_get_blob()

esp_err_t nvs_get_blob ( nvs_handle_t  handle,
const char *  key,
void *  out_value,
size_t length 
)

◆ nvs_erase_key()

esp_err_t nvs_erase_key ( nvs_handle_t  handle,
const char *  key 
)

◆ nvs_erase_all()

esp_err_t nvs_erase_all ( nvs_handle_t  handle)

◆ nvs_get_stats()

esp_err_t nvs_get_stats ( const char *  part_name,
nvs_stats_t nvs_stats 
)

◆ nvs_get_used_entry_count()

esp_err_t nvs_get_used_entry_count ( nvs_handle_t  handle,
size_t used_entries 
)

◆ nvs_entry_find()

esp_err_t nvs_entry_find ( const char *  part_name,
const char *  namespace_name,
nvs_type_t  type,
nvs_iterator_t output_iterator 
)

◆ nvs_entry_next()

esp_err_t nvs_entry_next ( nvs_iterator_t iterator)

◆ nvs_entry_info()

esp_err_t nvs_entry_info ( const nvs_iterator_t  iterator,
nvs_entry_info_t out_info 
)

◆ nvs_release_iterator()

void nvs_release_iterator ( nvs_iterator_t  iterator)
Generated from commit: vsfteam/vsf@015f4d1