HF-TMC51x0 Driver (TMC5130 & TMC5160) 0.1.0-dev
Hardware Agnostic C++ Driver for the TMC51x0 (TMC5130 & TMC5160)
Loading...
Searching...
No Matches
tmc51x0::TMC51x0< CommType >::MotorCurrentDebugInfo Struct Reference

Snapshot of motor-current related calculated/cached values. More...

#include <tmc51x0.hpp>

Collaboration diagram for tmc51x0::TMC51x0< CommType >::MotorCurrentDebugInfo:
[legend]

Public Attributes

bool initialized {false}
 True if Initialize() has completed successfully.
 
uint32_t f_clk_hz {0}
 Effective clock used for calculations.
 
MotorSpec motor_spec {}
 MotorSpec used for calculations.
 
uint8_t calculated_irun {0}
 Last calculated IRUN (0..31)
 
uint8_t calculated_ihold {0}
 Last calculated IHOLD (0..31)
 
uint16_t calculated_global_scaler {0}
 Last calculated GLOBAL_SCALER (32..256)
 
uint16_t cached_global_scaler {0}
 Cached write-only GLOBAL_SCALER value.
 
uint32_t cached_ihold_irun {0}
 Cached write-only IHOLD_IRUN raw register value.
 

Detailed Description

template<typename CommType>
struct tmc51x0::TMC51x0< CommType >::MotorCurrentDebugInfo

Snapshot of motor-current related calculated/cached values.

The TMC5160 has several write-only registers (notably GLOBAL_SCALER and IHOLD_IRUN). This driver maintains an internal cache of those values and also stores the most recent calculated values from motor-current configuration (IRUN/IHOLD/GLOBAL_SCALER).

This struct exposes those values for application-level logging without duplicating the calculation logic in the application.

Member Data Documentation

◆ cached_global_scaler

template<typename CommType >
uint16_t tmc51x0::TMC51x0< CommType >::MotorCurrentDebugInfo::cached_global_scaler {0}

Cached write-only GLOBAL_SCALER value.

◆ cached_ihold_irun

template<typename CommType >
uint32_t tmc51x0::TMC51x0< CommType >::MotorCurrentDebugInfo::cached_ihold_irun {0}

Cached write-only IHOLD_IRUN raw register value.

◆ calculated_global_scaler

template<typename CommType >
uint16_t tmc51x0::TMC51x0< CommType >::MotorCurrentDebugInfo::calculated_global_scaler {0}

Last calculated GLOBAL_SCALER (32..256)

◆ calculated_ihold

template<typename CommType >
uint8_t tmc51x0::TMC51x0< CommType >::MotorCurrentDebugInfo::calculated_ihold {0}

Last calculated IHOLD (0..31)

◆ calculated_irun

template<typename CommType >
uint8_t tmc51x0::TMC51x0< CommType >::MotorCurrentDebugInfo::calculated_irun {0}

Last calculated IRUN (0..31)

◆ f_clk_hz

template<typename CommType >
uint32_t tmc51x0::TMC51x0< CommType >::MotorCurrentDebugInfo::f_clk_hz {0}

Effective clock used for calculations.

◆ initialized

template<typename CommType >
bool tmc51x0::TMC51x0< CommType >::MotorCurrentDebugInfo::initialized {false}

True if Initialize() has completed successfully.

◆ motor_spec

template<typename CommType >
MotorSpec tmc51x0::TMC51x0< CommType >::MotorCurrentDebugInfo::motor_spec {}

MotorSpec used for calculations.


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