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

Subsystem for reading various telemetry and status information from the driver. More...

#include <tmc9660.hpp>

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

Public Member Functions

bool getGeneralStatusFlags (uint32_t &flags) noexcept
 Read the GENERAL_STATUS_FLAGS register.
 
float getSupplyVoltage () noexcept
 Read the current supply (bus) voltage.
 
float getChipTemperature () noexcept
 Read the internal chip temperature.
 
int16_t getMotorCurrent () noexcept
 Read the current motor current (torque current).
 
int32_t getActualVelocity () noexcept
 Read the measured actual velocity of the motor.
 
int32_t getActualPosition () noexcept
 Read the measured actual position of the motor.
 
bool getGeneralErrorFlags (uint32_t &flags) noexcept
 Read the GENERAL_ERROR_FLAGS register.
 
bool getGateDriverErrorFlags (uint32_t &flags) noexcept
 Read the GDRV_ERROR_FLAGS register.
 
bool clearGeneralErrorFlags (uint32_t mask) noexcept
 Clear bits in the GENERAL_ERROR_FLAGS register.
 
bool clearGateDriverErrorFlags (uint32_t mask) noexcept
 Clear bits in the GDRV_ERROR_FLAGS register.
 
bool getADCStatusFlags (uint32_t &flags) noexcept
 Read the ADC_STATUS_FLAGS register (clipped ADC channels).
 
bool clearADCStatusFlags (uint32_t mask) noexcept
 Clear bits in the ADC_STATUS_FLAGS register (write-1-to-clear).
 
uint16_t getExternalTemperature () noexcept
 Read the external temperature sensor raw value.
 

Private Member Functions

 Telemetry (TMC9660 &parent) noexcept
 

Private Attributes

TMC9660driver
 

Friends

class TMC9660
 

Detailed Description

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

Subsystem for reading various telemetry and status information from the driver.

Constructor & Destructor Documentation

◆ Telemetry()

template<typename CommType >
tmc9660::TMC9660< CommType >::Telemetry::Telemetry ( TMC9660 & parent)
explicitprivatenoexcept

Member Function Documentation

◆ clearADCStatusFlags()

template<typename CommType >
bool tmc9660::TMC9660< CommType >::Telemetry::clearADCStatusFlags ( uint32_t mask)
noexcept

Clear bits in the ADC_STATUS_FLAGS register (write-1-to-clear).

Parameters
maskBit mask of clipping flags to clear.
Returns
true if the mask was written successfully.

◆ clearGateDriverErrorFlags()

template<typename CommType >
bool tmc9660::TMC9660< CommType >::Telemetry::clearGateDriverErrorFlags ( uint32_t mask)
noexcept

Clear bits in the GDRV_ERROR_FLAGS register.

Parameters
maskBit mask of flags to clear (write-1-to-clear).
Returns
true if the mask was written successfully.

◆ clearGeneralErrorFlags()

template<typename CommType >
bool tmc9660::TMC9660< CommType >::Telemetry::clearGeneralErrorFlags ( uint32_t mask)
noexcept

Clear bits in the GENERAL_ERROR_FLAGS register.

Parameters
maskBit mask of flags to clear (write-1-to-clear).
Returns
true if the mask was written successfully.

◆ getActualPosition()

template<typename CommType >
int32_t tmc9660::TMC9660< CommType >::Telemetry::getActualPosition ( )
noexcept

Read the measured actual position of the motor.

Returns
The actual position in internal units. Returns 0 if not available.

◆ getActualVelocity()

template<typename CommType >
int32_t tmc9660::TMC9660< CommType >::Telemetry::getActualVelocity ( )
noexcept

Read the measured actual velocity of the motor.

Returns
The actual velocity in internal units. Returns 0 if not available.

◆ getADCStatusFlags()

template<typename CommType >
bool tmc9660::TMC9660< CommType >::Telemetry::getADCStatusFlags ( uint32_t & flags)
noexcept

Read the ADC_STATUS_FLAGS register (clipped ADC channels).

Parameters
[out]flagsBit mask of clipping status.
Returns
true if read successfully.

◆ getChipTemperature()

template<typename CommType >
float tmc9660::TMC9660< CommType >::Telemetry::getChipTemperature ( )
noexcept

Read the internal chip temperature.

Returns
Chip temperature in degrees Celsius. Returns a negative value (e.g. -273) on read error. Formula: T(°C) = raw * 0.01615 - 268.15

◆ getExternalTemperature()

template<typename CommType >
uint16_t tmc9660::TMC9660< CommType >::Telemetry::getExternalTemperature ( )
noexcept

Read the external temperature sensor raw value.

Returns
Raw external temperature. Returns 0 if unable to read.

◆ getGateDriverErrorFlags()

template<typename CommType >
bool tmc9660::TMC9660< CommType >::Telemetry::getGateDriverErrorFlags ( uint32_t & flags)
noexcept

Read the GDRV_ERROR_FLAGS register.

Parameters
[out]flagsBit mask of current gate driver error flags.
Returns
true if the flags were read successfully.

◆ getGeneralErrorFlags()

template<typename CommType >
bool tmc9660::TMC9660< CommType >::Telemetry::getGeneralErrorFlags ( uint32_t & flags)
noexcept

Read the GENERAL_ERROR_FLAGS register.

Parameters
[out]flagsBit mask of current error flags.
Returns
true if the flags were read successfully.

◆ getGeneralStatusFlags()

template<typename CommType >
bool tmc9660::TMC9660< CommType >::Telemetry::getGeneralStatusFlags ( uint32_t & flags)
noexcept

Read the GENERAL_STATUS_FLAGS register.

Parameters
[out]flagsBit mask of current status flags.
Returns
true if the flags were read successfully.

◆ getMotorCurrent()

template<typename CommType >
int16_t tmc9660::TMC9660< CommType >::Telemetry::getMotorCurrent ( )
noexcept

Read the current motor current (torque current).

Returns
Motor current in milliamps (m_a). Returns 0 if unable to read.

◆ getSupplyVoltage()

template<typename CommType >
float tmc9660::TMC9660< CommType >::Telemetry::getSupplyVoltage ( )
noexcept

Read the current supply (bus) voltage.

Returns
Supply voltage in volts. Returns a negative value if unable to read.

Friends And Related Symbol Documentation

◆ TMC9660

template<typename CommType >
friend class TMC9660
friend

Member Data Documentation

◆ driver

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

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