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

Singleton owning the Flux board's 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 Flux 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).
 
flux::hal::ManagerError GetManagerError () const noexcept
 Lifecycle / bind error of the last EnsureInitialized() (shared catalog).
 
BaseNvs & App () noexcept
 General application storage (flux namespace).
 
BaseNvs & Calibration () noexcept
 Calibration and tuning blobs (flux_cal namespace).
 
BaseNvs & Config () noexcept
 Device configuration (flux_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_
 flux (binding slot 0)
 
BaseNvs & calibration_
 flux_cal (binding slot 1)
 
BaseNvs & config_
 flux_cfg (binding slot 2)
 
std::atomic< bool > initialized_ {false}
 
hf_nvs_err_t last_error_ {hf_nvs_err_t::NVS_SUCCESS}
 
std::atomic< flux::hal::ManagerError > manager_error_ {flux::hal::ManagerError::NotInitialized}
 

Detailed Description

Singleton owning the Flux board's persistent-storage namespaces.

Initialization runs before communication managers so calibration or board identity can be read early. Namespaces (at most 15 characters):

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 (flux namespace).

◆ Calibration()

BaseNvs & NvsManager::Calibration ( )
inlinenoexcept

Calibration and tuning blobs (flux_cal namespace).

◆ Config()

BaseNvs & NvsManager::Config ( )
inlinenoexcept

Device configuration (flux_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 Flux 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).

◆ GetManagerError()

flux::hal::ManagerError NvsManager::GetManagerError ( ) const
inlinenoexcept

Lifecycle / bind error of the last EnsureInitialized() (shared catalog).

Returns
ManagerError::None when initialised; otherwise why bring-up failed.

◆ 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

flux (binding slot 0)

◆ calibration_

BaseNvs& NvsManager::calibration_
private

flux_cal (binding slot 1)

◆ config_

BaseNvs& NvsManager::config_
private

flux_cfg (binding slot 2)

◆ initialized_

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

◆ last_error_

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

◆ manager_error_

std::atomic<flux::hal::ManagerError> NvsManager::manager_error_ {flux::hal::ManagerError::NotInitialized}
private

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