HardFOC Vortex V1 HAL
Unified HAL API for the HardFOC Vortex motor-control platform (ESP32-C6, TMC9660)
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
NvsManager Class Reference

Singleton giving access to the Vortex board persistent-storage namespaces. More...

#include <NvsManager.h>

Collaboration diagram for NvsManager:
[legend]

Public Member Functions

 NvsManager (const NvsManager &)=delete
 
NvsManager & operator= (const NvsManager &)=delete
 
 NvsManager (NvsManager &&)=delete
 
NvsManager & operator= (NvsManager &&)=delete
 
bool EnsureInitialized () noexcept
 Initialize NVS flash (once) and open all Vortex namespaces.
 
bool IsInitialized () const noexcept
 
bool Deinitialize () noexcept
 Close namespaces (call after other subsystems if they may persist on shutdown).
 
hf_nvs_err_t GetLastError () const noexcept
 Last NVS error from the most recent failing operation (any region).
 
BaseNvs & App () noexcept
 General application storage (vortex namespace).
 
BaseNvs & Calibration () noexcept
 Calibration and tuning blobs (vortex_cal namespace).
 
BaseNvs & Config () noexcept
 Device configuration (vortex_cfg namespace).
 
void DumpStatistics () const noexcept
 

Static Public Member Functions

static NvsManager & GetInstance () noexcept
 

Private Member Functions

 NvsManager () noexcept
 
 ~NvsManager ()=default
 
void SetLastError (hf_nvs_err_t e) noexcept
 

Private Attributes

BaseNvs & app_
 
BaseNvs & calibration_
 
BaseNvs & config_
 
std::atomic< bool > initialized_ {false}
 
hf_nvs_err_t last_error_ {hf_nvs_err_t::NVS_SUCCESS}
 

Detailed Description

Singleton giving access to the Vortex board persistent-storage namespaces.

Initialization runs before communication managers so calibration or board identity can be read early. Namespaces (≤15 chars per ESP-IDF):

Constructor & Destructor Documentation

◆ NvsManager() [1/3]

NvsManager::NvsManager ( const NvsManager &  )
delete

◆ NvsManager() [2/3]

NvsManager::NvsManager ( NvsManager &&  )
delete

◆ NvsManager() [3/3]

NvsManager::NvsManager ( )
privatenoexcept

◆ ~NvsManager()

NvsManager::~NvsManager ( )
privatedefault

Member Function Documentation

◆ App()

BaseNvs & NvsManager::App ( )
inlinenoexcept

General application storage (vortex namespace).

◆ Calibration()

BaseNvs & NvsManager::Calibration ( )
inlinenoexcept

Calibration and tuning blobs (vortex_cal namespace).

◆ Config()

BaseNvs & NvsManager::Config ( )
inlinenoexcept

Device configuration (vortex_cfg namespace).

◆ Deinitialize()

bool NvsManager::Deinitialize ( )
noexcept

Close namespaces (call after other subsystems if they may persist on shutdown).

Here is the caller graph for this function:

◆ DumpStatistics()

void NvsManager::DumpStatistics ( ) const
noexcept
Here is the caller graph for this function:

◆ EnsureInitialized()

bool NvsManager::EnsureInitialized ( )
noexcept

Initialize NVS flash (once) and open all Vortex namespaces.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetInstance()

NvsManager & NvsManager::GetInstance ( )
staticnoexcept

◆ GetLastError()

hf_nvs_err_t NvsManager::GetLastError ( ) const
inlinenoexcept

Last NVS error from the most recent failing operation (any region).

◆ IsInitialized()

bool NvsManager::IsInitialized ( ) const
inlinenoexcept

◆ operator=() [1/2]

NvsManager & NvsManager::operator= ( const NvsManager &  )
delete

◆ operator=() [2/2]

NvsManager & NvsManager::operator= ( NvsManager &&  )
delete

◆ SetLastError()

void NvsManager::SetLastError ( hf_nvs_err_t  e)
inlineprivatenoexcept
Here is the caller graph for this function:

Member Data Documentation

◆ app_

BaseNvs& NvsManager::app_
private

◆ calibration_

BaseNvs& NvsManager::calibration_
private

◆ config_

BaseNvs& NvsManager::config_
private

◆ initialized_

std::atomic<bool> NvsManager::initialized_ {false}
private

◆ last_error_

hf_nvs_err_t NvsManager::last_error_ {hf_nvs_err_t::NVS_SUCCESS}
private

The documentation for this class was generated from the following files: