HF-TMC9660 Driver
Hardware Agnostic C++ Driver for the TMC9660
Loading...
Searching...
No Matches
TMC9660::NvmStorage Struct Reference

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

#include <TMC9660.hpp>

Collaboration diagram for TMC9660::NvmStorage:

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

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()

TMC9660::NvmStorage::NvmStorage ( TMC9660 parent)
inlineexplicitprivatenoexcept

Member Function Documentation

◆ eraseFlashBank()

bool TMC9660::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()

bool TMC9660::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()

bool TMC9660::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

friend class TMC9660
friend

Member Data Documentation

◆ driver

TMC9660& TMC9660::NvmStorage::driver
private

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