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

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

#include <TMC9660.hpp>

Collaboration diagram for TMC9660::Telemetry:

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

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

Constructor & Destructor Documentation

◆ Telemetry()

TMC9660::Telemetry::Telemetry ( TMC9660 parent)
explicitprivatenoexcept

Member Function Documentation

◆ clearADCStatusFlags()

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

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

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

int32_t TMC9660::Telemetry::getActualPosition ( )
noexcept

Read the measured actual position of the motor.

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

◆ getActualVelocity()

int32_t TMC9660::Telemetry::getActualVelocity ( )
noexcept

Read the measured actual velocity of the motor.

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

◆ getADCStatusFlags()

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

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

uint16_t TMC9660::Telemetry::getExternalTemperature ( )
noexcept

Read the external temperature sensor raw value.

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

◆ getGateDriverErrorFlags()

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

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

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

int16_t TMC9660::Telemetry::getMotorCurrent ( )
noexcept

Read the current motor current (torque current).

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

◆ getSupplyVoltage()

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

friend class TMC9660
friend

Member Data Documentation

◆ driver

TMC9660& TMC9660::Telemetry::driver
private

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