From 1e6ed4d17081a25e813e46874b8f834893eefbc7 Mon Sep 17 00:00:00 2001 From: Martin Havlik Date: Mon, 13 Oct 2025 15:59:27 +0200 Subject: [PATCH] docs(examples/storage): Add docs entries for 2 new NVS examples Extend the existing mentions of NVS examples with 2 newly added `nvs_statistics` and `nvs_iteration`. --- docs/en/api-reference/storage/nvs_flash.rst | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/docs/en/api-reference/storage/nvs_flash.rst b/docs/en/api-reference/storage/nvs_flash.rst index 0796b6fd1bc..925884b4dee 100644 --- a/docs/en/api-reference/storage/nvs_flash.rst +++ b/docs/en/api-reference/storage/nvs_flash.rst @@ -149,6 +149,22 @@ You can find code examples in the :example:`storage` directory of ESP-IDF exampl This example does exactly the same as :example:`storage/nvs_rw_value`, except that it uses the C++ NVS handle class. +:example:`storage/nvs_statistics` + + This example demonstrates how to obtain and interpret NVS usage statistics: free/used/available/total number of entries and number of namespaces in given NVS partition. + + Default NVS partition is erased for a clean run of this example. Then mock data string values are written. + + Usage statistics are obtained prior to and post writing, with the differences being compared to expected values of newly used entries. + +:example:`storage/nvs_iteration` + + This example demonstrates how to iterate over entries of specific (or any) NVS data type and how to obtain info about such entries. + + Default NVS partition is erased for a clean run of this example. Then mock data consisting of different NVS integer data types are written. + + After that, iteration is performed over the individual data types, as well as the generic ``NVS_TYPE_ANY``, and relevant entry info gained from iteration is logged. + Internals ---------