Swadge 2024 2.0.0
APIs to develop games for the Magfest Swadge
|
Functions | |
bool | initNvs (bool firstTry) |
Initialize the nonvolatile storage. | |
bool | deinitNvs (void) |
Deinitialize NVS. | |
bool | eraseNvs (void) |
Erase and re-initialize the nonvolatile storage. | |
bool | readNvs32 (const char *key, int32_t *outVal) |
Read a 32 bit value from NVS with a given string key. | |
bool | writeNvs32 (const char *key, int32_t val) |
Write a 32 bit value to NVS with a given string key. | |
bool | readNamespaceNvs32 (const char *namespace, const char *key, int32_t *outVal) |
Read a 32 bit value from NVS with a given string key. | |
bool | writeNamespaceNvs32 (const char *namespace, const char *key, int32_t val) |
Write a 32 bit value to NVS with a given string key. | |
bool | readNvsBlob (const char *key, void *out_value, size_t *length) |
Read a blob from NVS with a given string key. Typically, this should be called once with NULL passed for out_value, to get the value for length, then memory for out_value should be allocated, then this should be called again. | |
bool | writeNvsBlob (const char *key, const void *value, size_t length) |
Write a blob to NVS with a given string key. | |
bool | readNamespaceNvsBlob (const char *namespace, const char *key, void *out_value, size_t *length) |
Read a blob from NVS with a given string key. Typically, this should be called once with NULL passed for out_value, to get the value for length, then memory for out_value should be allocated, then this should be called again. | |
bool | writeNamespaceNvsBlob (const char *namespace, const char *key, const void *value, size_t length) |
Write a blob to NVS with a given string key. | |
bool | eraseNvsKey (const char *key) |
Delete the value with the given key from NVS. | |
bool | eraseNamespaceNvsKey (const char *namespace, const char *key) |
Delete the value with the given key from NVS. | |
bool | readNvsStats (nvs_stats_t *outStats) |
Read info about used memory in NVS. | |
bool | readAllNvsEntryInfos (nvs_stats_t *outStats, nvs_entry_info_t *outEntryInfos, size_t *numEntryInfos) |
Read info about each used entry in the default NVS namespace. Typically, this should be called once with NULL passed for outEntryInfos, to get the value for numEntryInfos, then memory for outEntryInfos should be allocated, then this should be called again. | |
bool | readNamespaceNvsEntryInfos (const char *namespace, nvs_stats_t *outStats, nvs_entry_info_t *outEntryInfos, size_t *numEntryInfos) |
Read info about each used entry in a specific NVS namespace. Typically, this should be called once with NULL passed for outEntryInfos, to get the value for numEntryInfos, then memory for outEntryInfos should be allocated, then this should be called again. | |
bool | nvsNamespaceInUse (const char *namespace) |
Quickly return whether or not any entries exist in a given NVS namespace. | |
bool initNvs | ( | bool | firstTry | ) |
Initialize the nonvolatile storage.
firstTry | true if this is the first time NVS is initialized this boot, false otherwise |
bool deinitNvs | ( | void | ) |
Deinitialize NVS.
bool eraseNvs | ( | void | ) |
Erase and re-initialize the nonvolatile storage.
bool readNvs32 | ( | const char * | key, |
int32_t * | outVal ) |
Read a 32 bit value from NVS with a given string key.
key | The key for the value to read |
outVal | The value that was read |
bool writeNvs32 | ( | const char * | key, |
int32_t | val ) |
Write a 32 bit value to NVS with a given string key.
key | The key for the value to write |
val | The value to write |
bool readNamespaceNvs32 | ( | const char * | namespace, |
const char * | key, | ||
int32_t * | outVal ) |
Read a 32 bit value from NVS with a given string key.
namespace | The NVS namespace to use |
key | The key for the value to read |
outVal | The value that was read |
bool writeNamespaceNvs32 | ( | const char * | namespace, |
const char * | key, | ||
int32_t | val ) |
Write a 32 bit value to NVS with a given string key.
namespace | The NVS namespace to use |
key | The key for the value to write |
val | The value to write |
bool readNvsBlob | ( | const char * | key, |
void * | out_value, | ||
size_t * | length ) |
Read a blob from NVS with a given string key. Typically, this should be called once with NULL passed for out_value, to get the value for length, then memory for out_value should be allocated, then this should be called again.
key | The key for the value to read |
out_value | The value will be written to this memory. It must be allocated before calling readNvsBlob() |
length | If out_value is NULL , this will be set to the length of the given key. Otherwise, it is the length of the blob to read. |
bool writeNvsBlob | ( | const char * | key, |
const void * | value, | ||
size_t | length ) |
Write a blob to NVS with a given string key.
key | The key for the value to write |
value | The blob value to write |
length | The length of the blob |
bool readNamespaceNvsBlob | ( | const char * | namespace, |
const char * | key, | ||
void * | out_value, | ||
size_t * | length ) |
Read a blob from NVS with a given string key. Typically, this should be called once with NULL passed for out_value, to get the value for length, then memory for out_value should be allocated, then this should be called again.
namespace | The NVS namespace to use |
key | The key for the value to read |
out_value | The value will be written to this memory. It must be allocated before calling readNvsBlob() |
length | If out_value is NULL , this will be set to the length of the given key. Otherwise, it is the length of the blob to read. |
bool writeNamespaceNvsBlob | ( | const char * | namespace, |
const char * | key, | ||
const void * | value, | ||
size_t | length ) |
Write a blob to NVS with a given string key.
namespace | The NVS namespace to use |
key | The key for the value to write |
value | The blob value to write |
length | The length of the blob |
bool eraseNvsKey | ( | const char * | key | ) |
Delete the value with the given key from NVS.
key | The NVS key to be deleted |
bool eraseNamespaceNvsKey | ( | const char * | namespace, |
const char * | key ) |
Delete the value with the given key from NVS.
namespace | The NVS namespace to use |
key | The NVS key to be deleted |
bool readNvsStats | ( | nvs_stats_t * | outStats | ) |
Read info about used memory in NVS.
outStats | The NVS stats struct will be written to this memory. It must be allocated before calling readNvsStats() |
bool readAllNvsEntryInfos | ( | nvs_stats_t * | outStats, |
nvs_entry_info_t * | outEntryInfos, | ||
size_t * | numEntryInfos ) |
Read info about each used entry in the default NVS namespace. Typically, this should be called once with NULL passed for outEntryInfos, to get the value for numEntryInfos, then memory for outEntryInfos should be allocated, then this should be called again.
outStats | If not NULL , the NVS stats struct will be written to this memory. It must be allocated before calling readAllNvsEntryInfos() |
outEntryInfos | A pointer to an array of NVS entry info structs will be written to this memory |
numEntryInfos | If outEntryInfos is NULL , this will be set to the length of the given key. Otherwise, it is the number of entry infos to read |
bool readNamespaceNvsEntryInfos | ( | const char * | namespace, |
nvs_stats_t * | outStats, | ||
nvs_entry_info_t * | outEntryInfos, | ||
size_t * | numEntryInfos ) |
Read info about each used entry in a specific NVS namespace. Typically, this should be called once with NULL passed for outEntryInfos, to get the value for numEntryInfos, then memory for outEntryInfos should be allocated, then this should be called again.
namespace | The name of the NVS namespace to use |
outStats | If not NULL , the NVS stats struct will be written to this memory. It must be allocated before calling readAllNvsEntryInfos() |
outEntryInfos | A pointer to an array of NVS entry info structs will be written to this memory |
numEntryInfos | If outEntryInfos is NULL , this will be set to the length of the given key. Otherwise, it is the number of entry infos to read |
bool nvsNamespaceInUse | ( | const char * | namespace | ) |
Quickly return whether or not any entries exist in a given NVS namespace.
namespace | The namespace to check for any entries |