oveRTOS C API
Embedded RTOS framework — build system, configuration, and portable C API
Loading...
Searching...
No Matches
nvs.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2026 Kamil Lulko <kamil.lulko@gmail.com>
3 *
4 * SPDX-License-Identifier: GPL-3.0-or-later
5 *
6 * This file is part of oveRTOS.
7 */
8
27#ifndef OVE_NVS_H
28#define OVE_NVS_H
29
30#include "ove/types.h"
31#include "ove_config.h"
32
33#ifdef __cplusplus
34extern "C" {
35#endif
36
37#ifdef CONFIG_OVE_NVS
38
48int ove_nvs_init(void);
49
59void ove_nvs_deinit(void);
60
78int ove_nvs_read(const char *key, void *buf, size_t buf_len, size_t *out_len);
79
93int ove_nvs_write(const char *key, const void *data, size_t len);
94
105int ove_nvs_erase(const char *key);
106
107#else /* !CONFIG_OVE_NVS */
108
109static inline int ove_nvs_init(void)
110{
112}
113static inline void ove_nvs_deinit(void)
114{
115}
116static inline int ove_nvs_read(const char *key, void *buf, size_t buf_len, size_t *out_len)
117{
118 (void)key;
119 (void)buf;
120 (void)buf_len;
121 (void)out_len;
123}
124static inline int ove_nvs_write(const char *key, const void *data, size_t len)
125{
126 (void)key;
127 (void)data;
128 (void)len;
130}
131static inline int ove_nvs_erase(const char *key)
132{
133 (void)key;
135}
136
137#endif /* CONFIG_OVE_NVS */
138
139#ifdef __cplusplus
140}
141#endif
142
/* end of ove_nvs group */
144
145#endif /* OVE_NVS_H */
int ove_nvs_write(const char *key, const void *data, size_t len)
Write or update a value in non-volatile storage.
int ove_nvs_read(const char *key, void *buf, size_t buf_len, size_t *out_len)
Read a value from non-volatile storage by key.
int ove_nvs_erase(const char *key)
Delete a key-value pair from non-volatile storage.
void ove_nvs_deinit(void)
Deinitialise the non-volatile storage subsystem.
int ove_nvs_init(void)
Initialise the non-volatile storage subsystem.
@ OVE_ERR_NOT_SUPPORTED
Definition types.h:98