HF-TMC9660 Driver 0.1.0-dev
Hardware Agnostic C++ Driver for the TMC9660
Loading...
Searching...
No Matches
tmc9660::TMC9660< CommType >::NvmStorage Struct Reference

Subsystem for storing and recalling parameters from nonvolatile flash. More...

#include <tmc9660.hpp>

Collaboration diagram for tmc9660::TMC9660< CommType >::NvmStorage:
[legend]

Public Member Functions

bool storeToFlash () noexcept
 Store all writable parameters to flash or EEPROM.
 
bool recallFromFlash () noexcept
 Restore parameters previously saved to NVM.
 
bool eraseFlashBank (uint8_t n) noexcept
 Erase a configuration bank from external memory.
 

Private Member Functions

 NvmStorage (TMC9660 &parent) noexcept
 

Private Attributes

TMC9660driver
 

Friends

class TMC9660
 

Detailed Description

template<typename CommType>
struct tmc9660::TMC9660< CommType >::NvmStorage

Subsystem for storing and recalling parameters from nonvolatile flash.

This API wraps STAP (0xFFF) and FactoryDefault commands. Use it to persist all RWE parameters across power cycles, matching the functionality of the “Save to Flash” button in GUI tools.

WARNING: Requires that external memory is configured via BOOT_CONFIG. Refer to the "Storing System Settings" section in the datasheet (see page 15).

Constructor & Destructor Documentation

◆ NvmStorage()

template<typename CommType >
tmc9660::TMC9660< CommType >::NvmStorage::NvmStorage ( TMC9660 & parent)
inlineexplicitprivatenoexcept

Member Function Documentation

◆ eraseFlashBank()

template<typename CommType >
bool tmc9660::TMC9660< CommType >::NvmStorage::eraseFlashBank ( uint8_t n)
noexcept

Erase a configuration bank from external memory.

Parameters
nIndex of the flash bank to erase (typically 0)
Returns
true if erase command sent successfully.

Use before re-storing to flash if stale config causes issues.

◆ recallFromFlash()

template<typename CommType >
bool tmc9660::TMC9660< CommType >::NvmStorage::recallFromFlash ( )
noexcept

Restore parameters previously saved to NVM.

Returns
true if configuration was successfully recalled.

Sets CONFIG_LOADED flag in GENERAL_STATUS_FLAGS if success.

◆ storeToFlash()

template<typename CommType >
bool tmc9660::TMC9660< CommType >::NvmStorage::storeToFlash ( )
noexcept

Store all writable parameters to flash or EEPROM.

Returns
true if the operation completed without error.

Internally sends STAP (type=0xFFF) to save parameters.

Friends And Related Symbol Documentation

◆ TMC9660

template<typename CommType >
friend class TMC9660
friend

Member Data Documentation

◆ driver

template<typename CommType >
TMC9660& tmc9660::TMC9660< CommType >::NvmStorage::driver
private

The documentation for this struct was generated from the following file: