|
HF-TMC9660 Driver
Hardware Agnostic C++ Driver for the TMC9660
|
Main class representing a TMC9660 motor driver in Parameter Mode. Provides high-level functions to configure and control the TMC9660's features. The class uses a TMC9660CommInterface for communication, making it agnostic to the physical layer. More...
#include <TMC9660.hpp>

Public Types | |
| enum class | BootloaderInitResult { Success , NoConfig , Failure } |
| Bootloader initialization result codes. More... | |
| using | GlobalParamBankVariant = std::variant< uint8_t, tmc9660::tmcl::GlobalParamBank0, tmc9660::tmcl::GlobalParamBank2, tmc9660::tmcl::GlobalParamBank3 > |
Public Member Functions | |
| TMC9660 (TMC9660CommInterface &comm, uint8_t address=0, const tmc9660::BootloaderConfig *bootCfg=nullptr) noexcept | |
| Construct a TMC9660 driver instance. | |
| ~TMC9660 () noexcept | |
| Destructor for TMC9660, cleans up resources. | |
| TMC9660CommInterface & | comm () noexcept |
| Get the communication interface used by this TMC9660 instance. | |
| TMC9660::BootloaderInitResult | bootloaderInit (const tmc9660::BootloaderConfig *cfg=nullptr) noexcept |
| Bootloader initialization. | |
| bool | writeParameter (tmc9660::tmcl::Parameters id, uint32_t value, uint8_t motorIndex=0) noexcept |
| Set (write) an axis (motor-specific) parameter on the TMC9660. | |
| bool | readParameter (tmc9660::tmcl::Parameters id, uint32_t &value, uint8_t motorIndex=0) noexcept |
| Read an axis (motor-specific) parameter from the TMC9660. | |
| bool | writeGlobalParameter (GlobalParamBankVariant id, uint8_t bank, uint32_t value) noexcept |
| Set (write) a global parameter on the TMC9660. | |
| bool | readGlobalParameter (GlobalParamBankVariant id, uint8_t bank, uint32_t &value) noexcept |
| Read a global parameter from the TMC9660. | |
| bool | sendCommand (tmc9660::tmcl::Op opcode, uint16_t type=0, uint8_t motor=0, uint32_t value=0, uint32_t *reply=nullptr) noexcept |
| Send a TMCL command. Optionally return the 32-bit reply value. | |
Public Attributes | |
| struct TMC9660::MotorConfig * | this |
| struct TMC9660::CurrentSensing * | this |
| struct TMC9660::GateDriver * | this |
| struct TMC9660::FeedbackSense * | this |
| struct TMC9660::FOCControl * | this |
| struct TMC9660::Ramp * | this |
| struct TMC9660::StepDir * | this |
| struct TMC9660::ReferenceSearch * | this |
| struct TMC9660::Brake * | this |
| struct TMC9660::IIT * | this |
| struct TMC9660::Telemetry * | this |
| struct TMC9660::StopEvents * | this |
| struct TMC9660::Protection * | this |
| struct TMC9660::Script * | this |
| struct TMC9660::RamDebug * | this |
| struct TMC9660::NvmStorage * | this |
| struct TMC9660::Heartbeat * | this |
| struct TMC9660::Globals * | this |
| struct TMC9660::GPIO * | this |
| struct TMC9660::Power * | this |
Private Attributes | |
| TMC9660CommInterface & | comm_ |
| uint8_t | address_ |
| tmc9660::TMC9660Bootloader | bootloader_ |
| Bootloader helper. | |
| const tmc9660::BootloaderConfig * | bootCfg_ |
| const uint8_t | tmcCRCTable_Poly7Reflected [256] |
Main class representing a TMC9660 motor driver in Parameter Mode. Provides high-level functions to configure and control the TMC9660's features. The class uses a TMC9660CommInterface for communication, making it agnostic to the physical layer.
All configuration and control is done by sending TMCL commands (Set/Get Parameter, etc.) and reading/writing parameter values. The library covers motor type setup, FOC control tuning, gate driver settings, sensor feedback configuration, protection (voltage, temperature, current) settings, executing scripts on the device's microcontroller, and reading telemetry data like temperature, current, and voltage.
| using TMC9660::GlobalParamBankVariant = std::variant<uint8_t, tmc9660::tmcl::GlobalParamBank0, tmc9660::tmcl::GlobalParamBank2, tmc9660::tmcl::GlobalParamBank3> |
|
strong |
|
noexcept |
|
noexcept |
Destructor for TMC9660, cleans up resources.
|
noexcept |
Bootloader initialization.
This method initializes the bootloader mode of the TMC9660 device, allowing firmware updates or configuration changes.
| cfg | Optional configuration for the bootloader. If not provided, \ default settings will be used. |
|
inlinenoexcept |
Get the communication interface used by this TMC9660 instance.
|
noexcept |
Read a global parameter from the TMC9660.
| id | Global parameter ID number. | |
| bank | Bank number or index associated with the parameter (can be Bank1, Bank2, or Bank3 enum). | |
| [out] | value | Reference to store the read 32-bit value. |
|
noexcept |
Read an axis (motor-specific) parameter from the TMC9660.
| id | Parameter ID number to read. | |
| [out] | value | Reference to store the 32-bit parameter value read. |
| motorIndex | Index of the motor/axis (0 or 1). |
|
noexcept |
Send a TMCL command. Optionally return the 32-bit reply value.
|
noexcept |
Set (write) a global parameter on the TMC9660.
| id | Global parameter ID number. |
| bank | Bank number for global parameter (can be Bank1, Bank2, or Bank3 enum). |
| value | 32-bit value to write. |
|
noexcept |
Set (write) an axis (motor-specific) parameter on the TMC9660.
| id | Parameter ID number (see TMC9660 documentation for the full list). |
| value | 32-bit value to write to the parameter. |
| motorIndex | Index of the motor/axis (0 or 1). Typically 0 unless the device controls multiple axes. |
|
private |
Module address (0-127). Used primarily for UART multi-drop addressing.
|
private |
|
private |
Bootloader helper.
|
private |
Communication interface (transport) for sending/receiving data.
| struct TMC9660::MotorConfig* TMC9660::this |
| struct TMC9660::CurrentSensing* TMC9660::this |
| struct TMC9660::GateDriver* TMC9660::this |
| struct TMC9660::FeedbackSense* TMC9660::this |
| struct TMC9660::FOCControl* TMC9660::this |
| struct TMC9660::Ramp* TMC9660::this |
| struct TMC9660::StepDir* TMC9660::this |
| struct TMC9660::ReferenceSearch* TMC9660::this |
| struct TMC9660::Brake* TMC9660::this |
| struct TMC9660::IIT* TMC9660::this |
| struct TMC9660::Telemetry* TMC9660::this |
| struct TMC9660::StopEvents* TMC9660::this |
| struct TMC9660::Protection* TMC9660::this |
| struct TMC9660::Script* TMC9660::this |
| struct TMC9660::RamDebug* TMC9660::this |
| struct TMC9660::NvmStorage* TMC9660::this |
| struct TMC9660::Heartbeat* TMC9660::this |
| struct TMC9660::Globals* TMC9660::this |
| struct TMC9660::GPIO* TMC9660::this |
| struct TMC9660::Power* TMC9660::this |
|
private |