94 TMC9660::BootloaderInitResult
110 [[nodiscard]]
bool writeParameter(
tmc9660::tmcl::Parameters
id, uint32_t value,
111 uint8_t motorIndex = 0) noexcept;
120 [[nodiscard]]
bool readParameter(
tmc9660::tmcl::Parameters
id, uint32_t &value,
121 uint8_t motorIndex = 0) noexcept;
125 std::variant<uint8_t,
tmc9660::tmcl::GlobalParamBank0,
tmc9660::tmcl::GlobalParamBank2,
126 tmc9660::tmcl::GlobalParamBank3>;
135 uint32_t value) noexcept;
145 uint32_t &value) noexcept;
148 bool sendCommand(
tmc9660::tmcl::Op opcode, uint16_t type = 0, uint8_t motor = 0,
149 uint32_t value = 0, uint32_t *reply =
nullptr) noexcept;
186 bool setPWMFrequency(uint32_t frequencyHz)
noexcept;
228 bool setOutputVoltageLimit(uint16_t limit)
noexcept;
240 bool setMaxTorqueCurrent(uint16_t milliamps)
noexcept;
253 bool setMaxFluxCurrent(uint16_t milliamps)
noexcept;
346 bool setIdleMotorPWMBehavior(
348 tmc9660::tmcl::IdleMotorPwmBehavior::PWM_OFF_WHEN_MOTOR_IDLE)
noexcept;
354 } motorConfig{*
this};
382 bool readRaw(int16_t &adc0, int16_t &adc1, int16_t &adc2, int16_t &adc3)
noexcept;
461 uint16_t scale3)
noexcept;
472 uint16_t &scale3)
noexcept;
505 bool setOffsets(int16_t offset0, int16_t offset1, int16_t offset2, int16_t offset3)
noexcept;
515 bool getOffsets(int16_t &offset0, int16_t &offset1, int16_t &offset2,
516 int16_t &offset3)
noexcept;
526 bool readScaledAndOffset(int16_t &adc0, int16_t &adc1, int16_t &adc2, int16_t &adc3)
noexcept;
539 bool calibrateOffsets(
bool waitForCompletion =
false, uint32_t timeoutMs = 1000)
noexcept;
552 } currentSensing{*
this};
588 uint8_t highSideY2)
noexcept;
612 uint8_t sourceTimeY2)
noexcept;
857 uint8_t filterLength = 0)
noexcept;
875 int16_t offset120 = 21845, int16_t offset180 = -32768,
876 int16_t offset240 = -21846, int16_t offset300 = -10923,
877 int16_t globalOffset = 0)
noexcept;
905 tmc9660::tmcl::EnableDisable::DISABLED)
noexcept;
925 tmc9660::tmcl::AbnInitMethod::FORCED_PHI_E_ZERO_WITH_ACTIVE_SWING,
926 uint16_t initDelay = 1000, int32_t initVelocity = 5, int16_t nChannelOffset = 0)
noexcept;
961 tmc9660::tmcl::AbnNChannelFiltering::FILTERING_OFF,
963 tmc9660::tmcl::EnableDisable::DISABLED)
noexcept;
981 uint32_t countsPerRev,
983 uint8_t gearRatio = 1)
noexcept;
1033 uint8_t csIdleTimeUs)
noexcept;
1046 uint32_t positionMask, uint8_t positionShift = 0,
1070 int16_t offset = 0)
noexcept;
1082 int8_t shiftFactor = 0)
noexcept;
1132 int16_t &offset)
noexcept;
1158 } feedbackSense{*
this};
1181 bool stop()
noexcept;
1236 bool setCurrentLoopGains(uint16_t p, uint16_t i,
bool separate =
false, uint16_t fluxP = 0,
1237 uint16_t fluxI = 0)
noexcept;
1738 } focControl{*
this};
1764 bool enable(
bool on)
noexcept;
1771 bool setAcceleration(uint32_t a1, uint32_t a2, uint32_t aMax)
noexcept;
1778 bool setDeceleration(uint32_t d1, uint32_t d2, uint32_t dMax)
noexcept;
1787 bool setVelocities(uint32_t vStart, uint32_t vStop, uint32_t v1, uint32_t v2,
1788 uint32_t vMax)
noexcept;
1794 bool setTiming(uint16_t tVmaxCycles, uint16_t tZeroWaitCycles)
noexcept;
1808 bool enableFeedForward(
bool enableVelFF,
bool enableAccelFF, uint16_t accelFFGain,
1924 bool start()
noexcept;
1926 bool stop()
noexcept;
1934 } referenceSearch{*
this};
2028 bool configure(uint16_t timeConstant1_ms,
float continuousCurrent1_A, uint16_t timeConstant2_ms,
2029 float continuousCurrent2_A)
noexcept;
2047 bool setLimit1(uint32_t limit)
noexcept;
2050 bool getLimit1(uint32_t &limit)
noexcept;
2063 bool setLimit2(uint32_t limit)
noexcept;
2066 bool getLimit2(uint32_t &limit)
noexcept;
2076 bool getSum1(uint32_t &sum)
noexcept;
2081 bool getSum2(uint32_t &sum)
noexcept;
2200 uint32_t maxVelError, uint32_t maxPosError,
2201 bool softStop =
true)
noexcept;
2222 bool swapLR)
noexcept;
2239 } stopEvents{*
this};
2254 bool configureVoltage(uint16_t overVoltThreshold, uint16_t underVoltThreshold)
noexcept;
2287 bool configureI2t(uint16_t timeConstant1_ms,
float continuousCurrent1_A,
2288 uint16_t timeConstant2_ms,
float continuousCurrent2_A)
noexcept;
2299 } protection{*
this};
2317 bool upload(
const std::vector<uint32_t> &scriptData)
noexcept;
2324 bool start(uint16_t address = 0)
noexcept;
2329 bool stop()
noexcept;
2336 bool step()
noexcept;
2343 bool reset()
noexcept;
2349 bool getStatus(uint32_t &status)
noexcept;
2356 bool readMemory(uint16_t address, uint32_t &value)
noexcept;
2400 bool init(uint32_t sampleCount)
noexcept;
2412 bool readData(uint32_t index, uint32_t &data)
noexcept;
2419 bool getStatus(
bool &isRunning)
noexcept;
2472 } nvmStorage{*
this};
2550 uint32_t timeout_ms)
noexcept;
2554 uint32_t &timeout_ms)
noexcept;
2596 bool getTimerPeriod(uint8_t timer, uint32_t &period_ms)
noexcept;
2632 bool setMode(uint8_t pin,
bool output,
bool pullEnable =
false,
bool pullUp =
true)
noexcept;
2639 bool writePin(uint8_t pin,
bool value)
noexcept;
2646 bool readDigital(uint8_t pin,
bool &value)
noexcept;
2655 bool readAnalog(uint8_t pin, uint16_t &value)
noexcept;
2710#ifdef TMC_API_EXTERNAL_CRC_TABLE
2713 const uint8_t tmcCRCTable_Poly7Reflected[256] = {
2714 0x00, 0x91, 0xE3, 0x72, 0x07, 0x96, 0xE4, 0x75, 0x0E, 0x9F, 0xED, 0x7C, 0x09, 0x98, 0xEA,
2715 0x7B, 0x1C, 0x8D, 0xFF, 0x6E, 0x1B, 0x8A, 0xF8, 0x69, 0x12, 0x83, 0xF1, 0x60, 0x15, 0x84,
2716 0xF6, 0x67, 0x38, 0xA9, 0xDB, 0x4A, 0x3F, 0xAE, 0xDC, 0x4D, 0x36, 0xA7, 0xD5, 0x44, 0x31,
2717 0xA0, 0xD2, 0x43, 0x24, 0xB5, 0xC7, 0x56, 0x23, 0xB2, 0xC0, 0x51, 0x2A, 0xBB, 0xC9, 0x58,
2718 0x2D, 0xBC, 0xCE, 0x5F, 0x70, 0xE1, 0x93, 0x02, 0x77, 0xE6, 0x94, 0x05, 0x7E, 0xEF, 0x9D,
2719 0x0C, 0x79, 0xE8, 0x9A, 0x0B, 0x6C, 0xFD, 0x8F, 0x1E, 0x6B, 0xFA, 0x88, 0x19, 0x62, 0xF3,
2720 0x81, 0x10, 0x65, 0xF4, 0x86, 0x17, 0x48, 0xD9, 0xAB, 0x3A, 0x4F, 0xDE, 0xAC, 0x3D, 0x46,
2721 0xD7, 0xA5, 0x34, 0x41, 0xD0, 0xA2, 0x33, 0x54, 0xC5, 0xB7, 0x26, 0x53, 0xC2, 0xB0, 0x21,
2722 0x5A, 0xCB, 0xB9, 0x28, 0x5D, 0xCC, 0xBE, 0x2F, 0xE0, 0x71, 0x03, 0x92, 0xE7, 0x76, 0x04,
2723 0x95, 0xEE, 0x7F, 0x0D, 0x9C, 0xE9, 0x78, 0x0A, 0x9B, 0xFC, 0x6D, 0x1F, 0x8E, 0xFB, 0x6A,
2724 0x18, 0x89, 0xF2, 0x63, 0x11, 0x80, 0xF5, 0x64, 0x16, 0x87, 0xD8, 0x49, 0x3B, 0xAA, 0xDF,
2725 0x4E, 0x3C, 0xAD, 0xD6, 0x47, 0x35, 0xA4, 0xD1, 0x40, 0x32, 0xA3, 0xC4, 0x55, 0x27, 0xB6,
2726 0xC3, 0x52, 0x20, 0xB1, 0xCA, 0x5B, 0x29, 0xB8, 0xCD, 0x5C, 0x2E, 0xBF, 0x90, 0x01, 0x73,
2727 0xE2, 0x97, 0x06, 0x74, 0xE5, 0x9E, 0x0F, 0x7D, 0xEC, 0x99, 0x08, 0x7A, 0xEB, 0x8C, 0x1D,
2728 0x6F, 0xFE, 0x8B, 0x1A, 0x68, 0xF9, 0x82, 0x13, 0x61, 0xF0, 0x85, 0x14, 0x66, 0xF7, 0xA8,
2729 0x39, 0x4B, 0xDA, 0xAF, 0x3E, 0x4C, 0xDD, 0xA6, 0x37, 0x45, 0xD4, 0xA1, 0x30, 0x42, 0xD3,
2730 0xB4, 0x25, 0x57, 0xC6, 0xB3, 0x22, 0x50, 0xC1, 0xBA, 0x2B, 0x59, 0xC8, 0xBD, 0x2C, 0x5E,
Helper for configuring the TMC9660 bootloader registers.
Communication interfaces for TMC9660 Parameter Mode devices using TMCL protocol over SPI and UART.
SPI status codes as per TMC9660 Parameter Mode.
Definition TMC9660CommInterface.hpp:224
const tmc9660::BootloaderConfig * bootCfg_
Definition TMC9660.hpp:2708
BootloaderInitResult
Bootloader initialization result codes.
Definition TMC9660.hpp:67
uint8_t address_
Definition TMC9660.hpp:2705
TMC9660CommInterface & comm_
Definition TMC9660.hpp:2703
std::variant< uint8_t, tmc9660::tmcl::GlobalParamBank0, tmc9660::tmcl::GlobalParamBank2, tmc9660::tmcl::GlobalParamBank3 > GlobalParamBankVariant
Definition TMC9660.hpp:126
tmc9660::TMC9660Bootloader bootloader_
Bootloader helper.
Definition TMC9660.hpp:2707
const uint8_t tmcCRCTable_Poly7Reflected[256]
Definition TMC9660.hpp:2713
TMC9660CommInterface & comm() noexcept
Get the communication interface used by this TMC9660 instance.
Definition TMC9660.hpp:56
Convenience wrapper around the bootloader TMCL commands.
Definition TMC9660Bootloader.hpp:210
Definition tmc9660_adc.hpp:12
UndervoltageEnable
Definition tmc9660_param_mode_tmcl.hpp:1274
AbnInitState
Definition tmc9660_param_mode_tmcl.hpp:2309
GateCurrentSource
Definition tmc9660_param_mode_tmcl.hpp:838
GateCurrentSink
Definition tmc9660_param_mode_tmcl.hpp:778
OvercurrentTiming
Definition tmc9660_param_mode_tmcl.hpp:1096
ReferenceSearchStatus
Definition tmc9660_param_mode_tmcl.hpp:4359
AdcMapping
Definition tmc9660_param_mode_tmcl.hpp:2009
OvercurrentThreshold
Definition tmc9660_param_mode_tmcl.hpp:1052
VgsShortEnable
Definition tmc9660_param_mode_tmcl.hpp:1357
PowerDownTimeout
Definition tmc9660_param_mode_tmcl.hpp:4601
CommutationMode
Definition tmc9660_param_mode_tmcl.hpp:1726
StepDirStepDividerShift
Definition tmc9660_param_mode_tmcl.hpp:4483
VelocityPiNorm
Definition tmc9660_param_mode_tmcl.hpp:2907
MotorDirection
Definition tmc9660_param_mode_tmcl.hpp:1573
VgsBlankingTime
Definition tmc9660_param_mode_tmcl.hpp:1393
DriveFaultBehaviour
Definition tmc9660_param_mode_tmcl.hpp:3735
Direction
Definition tmc9660_param_mode_tmcl.hpp:2519
BootstrapCurrentLimit
Definition tmc9660_param_mode_tmcl.hpp:882
VdsUsage
Definition tmc9660_param_mode_tmcl.hpp:1128
GdrvRetryBehaviour
Definition tmc9660_param_mode_tmcl.hpp:3696
CsaFilter
Definition tmc9660_param_mode_tmcl.hpp:1973
PwmSwitchingScheme
Definition tmc9660_param_mode_tmcl.hpp:1607
EnableDisable
Definition tmc9660_param_mode_tmcl.hpp:2487
VelocityMeterMode
Definition tmc9660_param_mode_tmcl.hpp:2944
AdcShuntType
Definition tmc9660_param_mode_tmcl.hpp:1899
CurrentPiNormalization
Definition tmc9660_param_mode_tmcl.hpp:2693
PwmOutputPolarity
Definition tmc9660_param_mode_tmcl.hpp:718
SpiInitMethod
Definition tmc9660_param_mode_tmcl.hpp:2455
AdcInversion
Definition tmc9660_param_mode_tmcl.hpp:2041
GlobalParamBank3
Definition tmc9660_param_mode_tmcl.hpp:538
GlobalParamBank0
Definition tmc9660_param_mode_tmcl.hpp:449
TorqueFluxPiSeparation
Definition tmc9660_param_mode_tmcl.hpp:2658
OvercurrentEnable
Definition tmc9660_param_mode_tmcl.hpp:992
CsaGain
Definition tmc9660_param_mode_tmcl.hpp:1937
VelocitySensorSelection
Definition tmc9660_param_mode_tmcl.hpp:2868
MotorType
Definition tmc9660_param_mode_tmcl.hpp:1541
VgsDeglitchTime
Definition tmc9660_param_mode_tmcl.hpp:1437
HeartbeatMonitoringConfig
Definition tmc9660_param_mode_tmcl.hpp:3998
AbnNChannelFiltering
Definition tmc9660_param_mode_tmcl.hpp:2347
HallSectorOffset
Definition tmc9660_param_mode_tmcl.hpp:2387
PositionSensorSelection
Definition tmc9660_param_mode_tmcl.hpp:3116
UndervoltageLevel
Definition tmc9660_param_mode_tmcl.hpp:1242
TriggerTransition
Definition tmc9660_param_mode_tmcl.hpp:581
AbnInitMethod
Definition tmc9660_param_mode_tmcl.hpp:2273
GlobalParamBank2
Definition tmc9660_param_mode_tmcl.hpp:489
AccelerationFFShift
Definition tmc9660_param_mode_tmcl.hpp:2989
IdleMotorPwmBehavior
Definition tmc9660_param_mode_tmcl.hpp:1761
Definition tmc9660_param_mode_tmcl.hpp:14
Subsystem controlling the brake chopper and mechanical brake features.
Definition TMC9660.hpp:1943
bool release() noexcept
Trigger a release of the mechanical brake.
Definition TMC9660.cpp:1997
TMC9660 & driver
Definition TMC9660.hpp:1999
bool setReleasingDutyCycle(uint8_t percent) noexcept
Set the PWM duty cycle for releasing the brake.
Definition TMC9660.cpp:2005
bool setHysteresis(float voltage) noexcept
Set the hysteresis for the brake chopper threshold.
Definition TMC9660.cpp:1992
bool setHoldingDutyCycle(uint8_t percent) noexcept
Set the PWM duty cycle for holding the brake released.
Definition TMC9660.cpp:2011
bool engage() noexcept
Engage (lock) the mechanical brake.
Definition TMC9660.cpp:2001
Brake(TMC9660 &parent) noexcept
Definition TMC9660.hpp:1998
bool enableChopper(bool enable) noexcept
Enable or disable the brake chopper functionality.
Definition TMC9660.cpp:1983
bool setReleasingDuration(uint16_t milliseconds) noexcept
Set the duration of the brake release initial phase.
Definition TMC9660.cpp:2017
bool invertOutput(bool invert) noexcept
Invert or normalize the brake output signal polarity.
Definition TMC9660.cpp:2021
bool setVoltageLimit(float voltage) noexcept
Set the overvoltage threshold for the brake chopper.
Definition TMC9660.cpp:1987
Subsystem for configuring ADC-based current measurement.
Definition TMC9660.hpp:362
bool getShuntType(tmc9660::tmcl::AdcShuntType &shuntType) noexcept
Get the ADC shunt type (Parameter 12: ADC_SHUNT_TYPE).
Definition TMC9660.cpp:130
bool setCSAFilter(tmc9660::tmcl::CsaFilter filter012, tmc9660::tmcl::CsaFilter filter3) noexcept
Set current sense amplifier filter (Parameters 19/20: CSA_FILTER_ADC_I0_TO_ADC_I2,...
Definition TMC9660.cpp:178
TMC9660 & driver
Definition TMC9660.hpp:551
bool getPhaseAdcMapping(tmc9660::tmcl::AdcMapping &ux1, tmc9660::tmcl::AdcMapping &vx2, tmc9660::tmcl::AdcMapping &wy1, tmc9660::tmcl::AdcMapping &y2) noexcept
Get ADC mapping for each phase (Parameters 22-25: PHASE_UX1_ADC_MAPPING ... PHASE_Y2_ADC_MAPPING).
Definition TMC9660.cpp:228
bool setCSAGain(tmc9660::tmcl::CsaGain gain012, tmc9660::tmcl::CsaGain gain3) noexcept
Set current sense amplifier gain (Parameters 17/18: CSA_GAIN_ADC_I0_TO_ADC_I2, CSA_GAIN_ADC_I3).
Definition TMC9660.cpp:156
bool getOffsets(int16_t &offset0, int16_t &offset1, int16_t &offset2, int16_t &offset3) noexcept
Get ADC offset (Parameters 34-37: ADC_I0_OFFSET ... ADC_I3_OFFSET).
Definition TMC9660.cpp:326
bool getCSAFilter(tmc9660::tmcl::CsaFilter &filter012, tmc9660::tmcl::CsaFilter &filter3) noexcept
Get current sense amplifier filter (Parameters 19/20: CSA_FILTER_ADC_I0_TO_ADC_I2,...
Definition TMC9660.cpp:188
bool getScalingFactors(uint16_t &scale0, uint16_t &scale1, uint16_t &scale2, uint16_t &scale3) noexcept
Get individual ADC scaling factors (Parameters 26-29: ADC_I0_SCALE ... ADC_I3_SCALE).
Definition TMC9660.cpp:258
bool readRaw(int16_t &adc0, int16_t &adc1, int16_t &adc2, int16_t &adc3) noexcept
Read raw ADC values (Parameters 13-16: ADC_I0_RAW ... ADC_I3_RAW).
Definition TMC9660.cpp:138
bool setShuntType(tmc9660::tmcl::AdcShuntType shuntType) noexcept
Set the ADC shunt type (Parameter 12: ADC_SHUNT_TYPE).
Definition TMC9660.cpp:125
CurrentSensing(TMC9660 &parent) noexcept
Definition TMC9660.hpp:550
bool getInversion(tmc9660::tmcl::AdcInversion &inv0, tmc9660::tmcl::AdcInversion &inv1, tmc9660::tmcl::AdcInversion &inv2, tmc9660::tmcl::AdcInversion &inv3) noexcept
Get ADC inversion (Parameters 30-33: ADC_I0_INVERTED ... ADC_I3_INVERTED).
Definition TMC9660.cpp:292
bool getCSAGain(tmc9660::tmcl::CsaGain &gain012, tmc9660::tmcl::CsaGain &gain3) noexcept
Get current sense amplifier gain (Parameters 17/18: CSA_GAIN_ADC_I0_TO_ADC_I2, CSA_GAIN_ADC_I3).
Definition TMC9660.cpp:166
bool readScaledAndOffset(int16_t &adc0, int16_t &adc1, int16_t &adc2, int16_t &adc3) noexcept
Read scaled and offset-compensated ADC values (Parameters 38-41: ADC_I0 ... ADC_I3).
Definition TMC9660.cpp:344
bool setPhaseAdcMapping(tmc9660::tmcl::AdcMapping ux1, tmc9660::tmcl::AdcMapping vx2, tmc9660::tmcl::AdcMapping wy1, tmc9660::tmcl::AdcMapping y2) noexcept
Set ADC mapping for each phase (Parameters 22-25: PHASE_UX1_ADC_MAPPING ... PHASE_Y2_ADC_MAPPING).
Definition TMC9660.cpp:212
bool setInversion(tmc9660::tmcl::AdcInversion inv0, tmc9660::tmcl::AdcInversion inv1, tmc9660::tmcl::AdcInversion inv2, tmc9660::tmcl::AdcInversion inv3) noexcept
Set ADC inversion (Parameters 30-33: ADC_I0_INVERTED ... ADC_I3_INVERTED).
Definition TMC9660.cpp:276
bool setScalingFactor(uint16_t scalingFactor) noexcept
Set current scaling factor (Parameter 21: CURRENT_SCALING_FACTOR).
Definition TMC9660.cpp:200
bool calibrateOffsets(bool waitForCompletion=false, uint32_t timeoutMs=1000) noexcept
Calibrate the ADC offsets for current measurement.
Definition TMC9660.cpp:362
bool getScalingFactor(uint16_t &scalingFactor) noexcept
Get current scaling factor (Parameter 21: CURRENT_SCALING_FACTOR).
Definition TMC9660.cpp:204
bool getCalibrationStatus(bool &isCalibrated) noexcept
Check if ADC offset calibration has been completed.
Definition TMC9660.cpp:387
bool setOffsets(int16_t offset0, int16_t offset1, int16_t offset2, int16_t offset3) noexcept
Set ADC offset (Parameters 34-37: ADC_I0_OFFSET ... ADC_I3_OFFSET).
Definition TMC9660.cpp:312
bool setScalingFactors(uint16_t scale0, uint16_t scale1, uint16_t scale2, uint16_t scale3) noexcept
Set individual ADC scaling factors (Parameters 26-29: ADC_I0_SCALE ... ADC_I3_SCALE).
Definition TMC9660.cpp:248
Subsystem for FOC control: torque/flux, velocity, position loops, open‐loop support,...
Definition TMC9660.hpp:1174
bool setPositionReachedThreshold(uint32_t threshold) noexcept
Set position reached threshold.
Definition TMC9660.cpp:1391
bool getVelocityMeterSwitchHysteresis(uint16_t &hysteresis) noexcept
Read velocity meter hysteresis.
Definition TMC9660.cpp:1239
bool setTargetFlux(int16_t milliamps) noexcept
Set desired flux current.
Definition TMC9660.cpp:996
bool getActualFlux(int32_t &milliamps) noexcept
Read actual flux current.
Definition TMC9660.cpp:1001
bool getReferenceSwitchPolaritySwap(tmc9660::tmcl::ReferenceSwitchPolaritySwap &config) noexcept
Read switch polarity/swap config.
Definition TMC9660.cpp:1464
bool getReferenceSwitchEnable(tmc9660::tmcl::ReferenceSwitchEnable &enable) noexcept
Read reference switch enable mask.
Definition TMC9660.cpp:1449
bool getTorqueFluxCombinedTargetValues(uint32_t &value) noexcept
Definition TMC9660.cpp:1824
bool getTorqueOffset(int16_t &milliamps) noexcept
Read torque offset.
Definition TMC9660.cpp:1014
bool setPositionLimitHigh(int32_t limit) noexcept
Set high position limit.
Definition TMC9660.cpp:1378
bool setTargetTorqueBiquadFilterACoeff1(int32_t coeff) noexcept
Definition TMC9660.cpp:1681
bool getFluxPiError(int32_t &error) noexcept
Read flux PI error.
Definition TMC9660.cpp:1076
bool setReferenceSwitchPolaritySwap(tmc9660::tmcl::ReferenceSwitchPolaritySwap config) noexcept
Configure switch polarity and swap.
Definition TMC9660.cpp:1458
bool setStopOnVelocityDeviation(uint32_t maxError, bool softStop=true) noexcept
Configure stop-on-velocity-deviation.
Definition TMC9660.cpp:1186
bool setTargetTorqueBiquadFilterBCoeff0(int32_t coeff) noexcept
Definition TMC9660.cpp:1707
bool getEventStopSettings(tmc9660::tmcl::EventStopSettings &settings) noexcept
Read event-stop settings.
Definition TMC9660.cpp:1493
bool setReferenceSwitchEnable(tmc9660::tmcl::ReferenceSwitchEnable enable) noexcept
Enable/disable reference switch stops.
Definition TMC9660.cpp:1443
bool getOpenloopVoltage(uint16_t &voltage) noexcept
Read open-loop voltage.
Definition TMC9660.cpp:1431
bool getIntegratedActualTorqueValue(uint32_t &value) noexcept
Definition TMC9660.cpp:1836
bool setTargetTorque(int16_t milliamps) noexcept
Set desired torque.
Definition TMC9660.cpp:983
bool getVoltageDqCombinedActualValues(uint32_t &value) noexcept
Definition TMC9660.cpp:1832
bool getVelocityOffset(int32_t &offset) noexcept
Read velocity offset.
Definition TMC9660.cpp:1133
bool getActualVelocityBiquadFilterBCoeff1(int32_t &coeff) noexcept
Definition TMC9660.cpp:1803
bool setVelocityOffset(int32_t offset) noexcept
Set velocity offset.
Definition TMC9660.cpp:1129
bool getOpenloopCurrent(uint16_t &milliamps) noexcept
Read open-loop current.
Definition TMC9660.cpp:1419
bool getReferenceSwitchSearchSpeed(int32_t &speed) noexcept
Read reference search speed.
Definition TMC9660.cpp:1522
bool getPositionLimitHigh(int32_t &limit) noexcept
Read high position limit.
Definition TMC9660.cpp:1383
bool getReferenceSwitchLatchSettings(tmc9660::tmcl::ReferenceSwitchLatchSettings &setting) noexcept
Read switch latch settings.
Definition TMC9660.cpp:1479
bool getOpenloopAngle(int16_t &angle) noexcept
Read open-loop angle.
Definition TMC9660.cpp:1407
bool getRightLimitSwitchPosition(int32_t &position) noexcept
Read right-limit-switch position.
Definition TMC9660.cpp:1543
bool getPositionScalingFactor(uint16_t &factor) noexcept
Read position scaling factor.
Definition TMC9660.cpp:1289
bool getReferenceSwitchSpeed(int32_t &speed) noexcept
Read reference positioning speed.
Definition TMC9660.cpp:1535
bool getTargetTorqueBiquadFilterEnable(bool &enable) noexcept
Definition TMC9660.cpp:1673
bool getStopOnPositionDeviation(uint32_t &maxError, bool &softStop) noexcept
Read stop-on-position-deviation settings.
Definition TMC9660.cpp:1340
bool getFieldWeakeningVoltageThreshold(uint16_t &voltage) noexcept
Definition TMC9660.cpp:1628
bool getFocVoltageV(int16_t &voltage) noexcept
Definition TMC9660.cpp:1595
TMC9660 & driver
Definition TMC9660.hpp:1737
bool getFluxPiIntegrator(int32_t &integrator) noexcept
Read flux-PI integrator state.
Definition TMC9660.cpp:1092
bool setPositionScalingFactor(uint16_t factor) noexcept
Set position scaling factor.
Definition TMC9660.cpp:1285
bool getFieldWeakeningI(uint16_t &milliamps) noexcept
Definition TMC9660.cpp:1615
bool setVelocityReachedThreshold(uint32_t threshold) noexcept
Set velocity reached threshold.
bool getPositionLimitLow(int32_t &limit) noexcept
Read low position limit.
Definition TMC9660.cpp:1370
bool setStopOnPositionDeviation(uint32_t maxError, bool softStop=true) noexcept
Configure stop-on-position-deviation.
Definition TMC9660.cpp:1330
bool getActualPosition(int32_t &position) noexcept
Read actual position.
Definition TMC9660.cpp:1277
bool getPositionSensor(tmc9660::tmcl::PositionSensorSelection &sel) noexcept
Read position feedback sensor.
Definition TMC9660.cpp:1264
bool setVelocityScalingFactor(uint16_t factor) noexcept
Set velocity scaling factor.
Definition TMC9660.cpp:1174
bool setTargetTorqueBiquadFilterACoeff2(int32_t coeff) noexcept
Definition TMC9660.cpp:1694
bool setVelocitySensor(tmc9660::tmcl::VelocitySensorSelection sel) noexcept
Select velocity feedback sensor.
Definition TMC9660.cpp:1104
bool setPositionSensor(tmc9660::tmcl::PositionSensorSelection sel) noexcept
Select position feedback sensor.
Definition TMC9660.cpp:1259
bool getTorquePiIntegrator(int32_t &integrator) noexcept
Read torque-PI integrator state.
Definition TMC9660.cpp:1084
bool setVelocityNormalization(tmc9660::tmcl::VelocityPiNorm pNorm, tmc9660::tmcl::VelocityPiNorm iNorm) noexcept
Set velocity PI normalization.
Definition TMC9660.cpp:1148
bool setTargetPosition(int32_t position) noexcept
Set target position.
Definition TMC9660.cpp:1272
bool getStopOnVelocityDeviation(uint32_t &maxError, bool &softStop) noexcept
Read stop-on-velocity-deviation settings.
Definition TMC9660.cpp:1196
bool setFluxOffset(int16_t milliamps) noexcept
Set flux offset (feed-forward).
Definition TMC9660.cpp:1022
bool setActualVelocityBiquadFilterACoeff2(int32_t coeff) noexcept
Definition TMC9660.cpp:1772
bool setActualVelocityBiquadFilterACoeff1(int32_t coeff) noexcept
Definition TMC9660.cpp:1759
bool getActualTorque(int16_t &milliamps) noexcept
Read actual torque.
Definition TMC9660.cpp:988
bool getFluxOffset(int16_t &milliamps) noexcept
Read flux offset.
Definition TMC9660.cpp:1027
bool getHomeSwitchPosition(int32_t &position) noexcept
Read home-switch position.
Definition TMC9660.cpp:1551
bool getPositionPiIntegrator(int32_t &integrator) noexcept
Read position-PI integrator.
Definition TMC9660.cpp:1314
bool getActualVelocityBiquadFilterACoeff2(int32_t &coeff) noexcept
Definition TMC9660.cpp:1777
bool getPositionReachedThreshold(uint32_t &threshold) noexcept
Read position reached threshold.
Definition TMC9660.cpp:1395
bool getTorqueFluxCombinedActualValues(uint32_t &value) noexcept
Definition TMC9660.cpp:1828
bool getMccInputsRaw(uint16_t &inputs) noexcept
Definition TMC9660.cpp:1571
bool getVelocitySensor(tmc9660::tmcl::VelocitySensorSelection &sel) noexcept
Read velocity feedback sensor.
Definition TMC9660.cpp:1109
bool getFocVoltageUx(int16_t &voltage) noexcept
Definition TMC9660.cpp:1579
bool setTorqueOffset(int16_t milliamps) noexcept
Set torque offset (feed-forward).
Definition TMC9660.cpp:1009
bool setActualVelocityBiquadFilterBCoeff1(int32_t coeff) noexcept
Definition TMC9660.cpp:1798
bool setTargetTorqueBiquadFilterEnable(bool enable) noexcept
Definition TMC9660.cpp:1668
bool setPositionLoopDownsampling(uint8_t divider) noexcept
Set position loop downsampling.
Definition TMC9660.cpp:1353
bool getTargetTorqueBiquadFilterBCoeff0(int32_t &coeff) noexcept
Definition TMC9660.cpp:1712
bool getVelocityPiIntegrator(int32_t &integrator) noexcept
Read velocity-PI integrator.
Definition TMC9660.cpp:1158
bool setTargetVelocity(int32_t velocity) noexcept
Set target velocity.
Definition TMC9660.cpp:1116
bool getActualVelocityBiquadFilterBCoeff0(int32_t &coeff) noexcept
Definition TMC9660.cpp:1790
bool getFocCurrentV(int16_t &milliamps) noexcept
Definition TMC9660.cpp:1644
bool setVelocityMeterSwitchThreshold(uint32_t threshold) noexcept
Set velocity meter switch threshold.
Definition TMC9660.cpp:1221
bool setPositionLoopGains(uint16_t p, uint16_t i) noexcept
Configure position PI gains.
Definition TMC9660.cpp:1297
bool setPositionLimitLow(int32_t limit) noexcept
Set low position limit.
Definition TMC9660.cpp:1365
bool setReferenceSwitchSearchSpeed(int32_t speed) noexcept
Set reference search speed.
Definition TMC9660.cpp:1517
bool setOpenloopCurrent(uint16_t milliamps) noexcept
Set open-loop current.
Definition TMC9660.cpp:1415
bool getVelocityMeterSwitchThreshold(uint32_t &threshold) noexcept
Read velocity meter switch threshold.
Definition TMC9660.cpp:1226
bool setEventStopSettings(tmc9660::tmcl::EventStopSettings settings) noexcept
Configure event-stop settings.
Definition TMC9660.cpp:1488
bool getLastReferencePosition(int32_t &position) noexcept
Read last reference position.
Definition TMC9660.cpp:1559
bool getPositionPiError(int32_t &error) noexcept
Read position-PI error.
Definition TMC9660.cpp:1322
bool getVelocityMeterMode(tmc9660::tmcl::VelocityMeterMode &mode) noexcept
Read current velocity meter mode.
Definition TMC9660.cpp:1247
bool getVelocityReachedThreshold(uint32_t &threshold) noexcept
Read velocity reached threshold.
bool getActualVelocity(int32_t &velocity) noexcept
Read actual velocity.
Definition TMC9660.cpp:1121
bool getVelocityPiError(int32_t &error) noexcept
Read velocity-PI error.
Definition TMC9660.cpp:1166
bool getVelocityScalingFactor(uint16_t &factor) noexcept
Read velocity scaling factor.
Definition TMC9660.cpp:1178
bool getActualVelocityBiquadFilterACoeff1(int32_t &coeff) noexcept
Definition TMC9660.cpp:1764
bool getFocCurrentIq(int16_t &milliamps) noexcept
Definition TMC9660.cpp:1660
bool setReferenceSwitchLatchSettings(tmc9660::tmcl::ReferenceSwitchLatchSettings setting) noexcept
Configure switch latch settings.
Definition TMC9660.cpp:1473
bool setCurrentLoopGains(uint16_t p, uint16_t i, bool separate=false, uint16_t fluxP=0, uint16_t fluxI=0) noexcept
Configure current-loop PI gains.
Definition TMC9660.cpp:1035
bool setOpenloopVoltage(uint16_t voltage) noexcept
Set open-loop voltage.
Definition TMC9660.cpp:1427
bool setActualVelocityBiquadFilterBCoeff0(int32_t coeff) noexcept
Definition TMC9660.cpp:1785
bool setVelocityMeterSwitchHysteresis(uint16_t hysteresis) noexcept
Set velocity meter hysteresis.
Definition TMC9660.cpp:1234
bool getIntegratedActualVelocityValue(uint32_t &value) noexcept
Definition TMC9660.cpp:1840
bool setTorqueFluxPiSeparation(tmc9660::tmcl::TorqueFluxPiSeparation sep) noexcept
Select combined or separate torque/flux PI parameters.
Definition TMC9660.cpp:1051
bool setPositionNormalization(tmc9660::tmcl::VelocityPiNorm pNorm, tmc9660::tmcl::VelocityPiNorm iNorm) noexcept
Set position PI normalization.
Definition TMC9660.cpp:1304
bool getPositionLoopDownsampling(uint8_t ÷r) noexcept
Read position loop downsampling.
Definition TMC9660.cpp:1357
bool getFocCurrentUx(int16_t &milliamps) noexcept
Definition TMC9660.cpp:1636
bool setVelocityLoopGains(uint16_t p, uint16_t i) noexcept
Configure velocity PI gains.
Definition TMC9660.cpp:1141
bool setVelocityLoopDownsampling(uint8_t divider) noexcept
Set velocity loop downsampling.
Definition TMC9660.cpp:1209
bool getActualVelocityBiquadFilterBCoeff2(int32_t &coeff) noexcept
Definition TMC9660.cpp:1816
bool getFocVoltageUq(int16_t &voltage) noexcept
Definition TMC9660.cpp:1603
bool getReferenceSwitchSearchMode(tmc9660::tmcl::ReferenceSwitchSearchMode &mode) noexcept
Read reference search mode.
Definition TMC9660.cpp:1508
bool getTargetTorqueBiquadFilterACoeff1(int32_t &coeff) noexcept
Definition TMC9660.cpp:1686
bool setTargetTorqueBiquadFilterBCoeff2(int32_t coeff) noexcept
Definition TMC9660.cpp:1733
bool getActualVelocityBiquadFilterEnable(bool &enable) noexcept
Definition TMC9660.cpp:1751
bool setTargetTorqueBiquadFilterBCoeff1(int32_t coeff) noexcept
Definition TMC9660.cpp:1720
bool getTargetTorqueBiquadFilterACoeff2(int32_t &coeff) noexcept
Definition TMC9660.cpp:1699
bool getFocCurrentWy(int16_t &milliamps) noexcept
Definition TMC9660.cpp:1652
bool getTorquePiError(int32_t &error) noexcept
Read torque PI error.
Definition TMC9660.cpp:1068
bool getTargetTorqueBiquadFilterBCoeff1(int32_t &coeff) noexcept
Definition TMC9660.cpp:1725
bool getVelocityLoopDownsampling(uint8_t ÷r) noexcept
Read velocity loop downsampling.
Definition TMC9660.cpp:1213
bool setCurrentNormalization(tmc9660::tmcl::CurrentPiNormalization pNorm, tmc9660::tmcl::CurrentPiNormalization iNorm) noexcept
Set normalization for current-PI outputs.
Definition TMC9660.cpp:1057
bool setFieldWeakeningI(uint16_t milliamps) noexcept
Definition TMC9660.cpp:1611
bool getTargetTorqueBiquadFilterBCoeff2(int32_t &coeff) noexcept
Definition TMC9660.cpp:1738
bool setReferenceSwitchSpeed(int32_t speed) noexcept
Set reference positioning speed.
Definition TMC9660.cpp:1530
bool setReferenceSwitchSearchMode(tmc9660::tmcl::ReferenceSwitchSearchMode mode) noexcept
Set reference search mode.
Definition TMC9660.cpp:1502
bool setActualVelocityBiquadFilterEnable(bool enable) noexcept
Definition TMC9660.cpp:1746
bool setFieldWeakeningVoltageThreshold(uint16_t voltage) noexcept
Definition TMC9660.cpp:1623
bool stop() noexcept
Stop torque/flux control (SYSTEM_OFF).
Definition TMC9660.cpp:979
bool getFocVoltageWy(int16_t &voltage) noexcept
Definition TMC9660.cpp:1587
bool setActualVelocityBiquadFilterBCoeff2(int32_t coeff) noexcept
Definition TMC9660.cpp:1811
Subsystem for feedback sensor configuration.
Definition TMC9660.hpp:832
bool getABNInitializationState(tmc9660::tmcl::AbnInitState &state) noexcept
Read the current state of ABN encoder initialization.
Definition TMC9660.cpp:716
bool configureABNInitialization(tmc9660::tmcl::AbnInitMethod initMethod=tmc9660::tmcl::AbnInitMethod::FORCED_PHI_E_ZERO_WITH_ACTIVE_SWING, uint16_t initDelay=1000, int32_t initVelocity=5, int16_t nChannelOffset=0) noexcept
Configure ABN encoder initialization method.
Definition TMC9660.cpp:702
bool getSecondaryABNEncoderValue(uint32_t &value) noexcept
Read the raw ABN2 encoder internal counter value.
Definition TMC9660.cpp:790
bool setSecondaryABNEncoderEnabled(bool enable) noexcept
Enable or disable the secondary ABN encoder.
Definition TMC9660.cpp:786
bool configureSPIEncoderDataFormat(uint32_t positionMask, uint8_t positionShift=0, tmc9660::tmcl::Direction invertDirection=tmc9660::tmcl::Direction::NOT_INVERTED) noexcept
Configure SPI encoder data format and processing.
Definition TMC9660.cpp:809
bool getSPIEncoderPositionValue(uint32_t &value) noexcept
Read SPI_ENCODER_POSITION_COUNTER_VALUE.
Definition TMC9660.cpp:919
bool configureSPIEncoder(uint8_t cmdSize, uint16_t csSettleTimeNs, uint8_t csIdleTimeUs) noexcept
Configure a SPI-based encoder for feedback.
Definition TMC9660.cpp:797
bool getSPIEncoderDirection(tmc9660::tmcl::Direction &dir) noexcept
Read SPI_ENCODER_DIRECTION.
Definition TMC9660.cpp:943
bool getSPIEncoderInitialization(tmc9660::tmcl::SpiInitMethod &method, int16_t &offset) noexcept
Read SPI_ENCODER_INITIALIZATION_METHOD and SPI_ENCODER_OFFSET.
Definition TMC9660.cpp:931
bool setSPIEncoderLUTCorrection(tmc9660::tmcl::EnableDisable enable, int8_t shiftFactor=0) noexcept
Enable or disable SPI encoder lookup table correction.
Definition TMC9660.cpp:857
bool getSPIEncoderCSIdleDelay(uint8_t &timeUs) noexcept
Read SPI_ENCODER_CS_IDLE_DELAY_TIME (0…102 µs).
Definition TMC9660.cpp:883
bool setHallPositionOffsets(int16_t offset0=0, int16_t offset60=10922, int16_t offset120=21845, int16_t offset180=-32768, int16_t offset240=-21846, int16_t offset300=-10923, int16_t globalOffset=0) noexcept
Set Hall sensor position offsets for improved accuracy.
Definition TMC9660.cpp:653
bool getSPIEncoderCSSettleDelay(uint16_t &timeNs) noexcept
Read SPI_ENCODE_CS_SETTLE_DELAY_TIME (0…6375 ns).
Definition TMC9660.cpp:875
bool getSPIEncoderLUTAddress(uint8_t &address) noexcept
Read SPI_LUT_ADDRESS_SELECT.
Definition TMC9660.cpp:951
bool getSecondaryABNCountsPerRev(uint32_t &counts) noexcept
Read ABN_2_STEPS (encoder steps per rotation, 0…16777215).
Definition TMC9660.cpp:766
bool getABNRawValue(uint32_t &value) noexcept
Read the raw ABN encoder internal counter value.
Definition TMC9660.cpp:733
bool getSecondaryABNDirection(tmc9660::tmcl::Direction &dir) noexcept
Read ABN_2_DIRECTION (normal/inverted).
Definition TMC9660.cpp:770
bool getSPIEncoderCommutationAngle(int16_t &angle) noexcept
Read SPI_ENCODER_COMMUTATION_ANGLE (-32768…32767).
Definition TMC9660.cpp:923
bool uploadSPIEncoderLUTEntry(uint8_t index, int8_t value) noexcept
Upload a single entry to the SPI encoder correction lookup table.
Definition TMC9660.cpp:867
bool getSPIEncoderPositionShift(uint8_t &shift) noexcept
Read SPI_ENCODER_POSITION_COUNTER_SHIFT.
Definition TMC9660.cpp:911
TMC9660 & driver
Definition TMC9660.hpp:1157
bool getABNPhiE(int16_t &phiE) noexcept
Read the electrical angle (phi_e) calculated from ABN feedback.
Definition TMC9660.cpp:725
bool getSPIEncoderLUTShiftFactor(int8_t &shiftFactor) noexcept
Read SPI_LUT_COMMON_SHIFT_FACTOR.
Definition TMC9660.cpp:967
bool configureHall(tmc9660::tmcl::HallSectorOffset sectorOffset=tmc9660::tmcl::HallSectorOffset::DEG_0, tmc9660::tmcl::Direction inverted=tmc9660::tmcl::Direction::NOT_INVERTED, tmc9660::tmcl::EnableDisable enableExtrapolation=tmc9660::tmcl::EnableDisable::DISABLED, uint8_t filterLength=0) noexcept
Configure digital Hall sensors for BLDC commutation.
Definition TMC9660.cpp:636
bool getSecondaryABNGearRatio(uint8_t &ratio) noexcept
Read ABN_2_GEAR_RATIO (1…255).
Definition TMC9660.cpp:778
bool getSPIEncoderMainCmdSize(uint8_t &size) noexcept
Read SPI_ENCODER_MAIN_TRANSFER_CMD_SIZE (1…16 bytes).
Definition TMC9660.cpp:891
bool getSPIEncoderSecondaryCmdSize(uint8_t &size) noexcept
Read SPI_ENCODER_SECONDARY_TRANSFER_CMD_SIZE (0…15 bytes).
Definition TMC9660.cpp:899
bool configureABNEncoder(uint32_t countsPerRev, tmc9660::tmcl::Direction inverted=tmc9660::tmcl::Direction::NOT_INVERTED, tmc9660::tmcl::EnableDisable nChannelInverted=tmc9660::tmcl::EnableDisable::DISABLED) noexcept
Configure an ABN incremental encoder for feedback.
Definition TMC9660.cpp:687
bool getHallPhiE(int16_t &phiE) noexcept
Read the electrical angle (phi_e) calculated from Hall feedback.
Definition TMC9660.cpp:675
bool setSPIEncoderRequestData(const uint8_t *requestData, uint8_t size) noexcept
Set up SPI encoder request data for continuous transfer mode.
Definition TMC9660.cpp:822
bool getSPIEncoderLUTData(int8_t &data) noexcept
Read SPI_LUT_DATA.
Definition TMC9660.cpp:959
FeedbackSense(TMC9660 &parent) noexcept
Definition TMC9660.hpp:1156
bool configureSPIEncoderInitialization(tmc9660::tmcl::SpiInitMethod initMethod, int16_t offset=0) noexcept
Configure SPI encoder initialization method.
Definition TMC9660.cpp:847
bool configureABNNChannel(tmc9660::tmcl::AbnNChannelFiltering filterMode=tmc9660::tmcl::AbnNChannelFiltering::FILTERING_OFF, tmc9660::tmcl::EnableDisable clearOnNextNull=tmc9660::tmcl::EnableDisable::DISABLED) noexcept
Configure N-channel filtering for ABN encoder.
Definition TMC9660.cpp:737
bool configureSecondaryABNEncoder(uint32_t countsPerRev, tmc9660::tmcl::Direction inverted=tmc9660::tmcl::Direction::NOT_INVERTED, uint8_t gearRatio=1) noexcept
Configure the secondary ABN encoder input.
Definition TMC9660.cpp:748
bool getSPIEncoderPositionMask(uint32_t &mask) noexcept
Read SPI_ENCODER_POSITION_COUNTER_MASK.
Definition TMC9660.cpp:907
Subsystem for configuring general-purpose IOs (GPIOs).
Definition TMC9660.hpp:2623
bool setMode(uint8_t pin, bool output, bool pullEnable=false, bool pullUp=true) noexcept
Configure a GPIO pin as input or output.
Definition TMC9660.cpp:2610
bool readAnalog(uint8_t pin, uint16_t &value) noexcept
Read an analog input (e.g. external temperature or potentiometer).
Definition TMC9660.cpp:2651
GPIO(TMC9660 &parent) noexcept
Definition TMC9660.hpp:2659
TMC9660 & driver
Definition TMC9660.hpp:2660
bool writePin(uint8_t pin, bool value) noexcept
Write a digital value to a configured output pin.
Definition TMC9660.cpp:2635
bool readDigital(uint8_t pin, bool &value) noexcept
Read a digital input pin.
Definition TMC9660.cpp:2641
Subsystem for configuring the MOSFET gate driver.
Definition TMC9660.hpp:560
bool setRetryBehavior(tmc9660::tmcl::GdrvRetryBehaviour retryBehavior) noexcept
Configure fault retry behavior.
Definition TMC9660.cpp:612
bool configureVgsShortProtectionUVW(tmc9660::tmcl::VgsShortEnable enableLowSideOn, tmc9660::tmcl::VgsShortEnable enableLowSideOff, tmc9660::tmcl::VgsShortEnable enableHighSideOn, tmc9660::tmcl::VgsShortEnable enableHighSideOff) noexcept
Configure gate-to-source short protection for UVW phases.
Definition TMC9660.cpp:560
TMC9660 & driver
Definition TMC9660.hpp:823
bool setFaultHandlerRetries(uint8_t retries) noexcept
Set the maximum number of retries for fault handling.
Definition TMC9660.cpp:624
bool setOvercurrentDeglitch(tmc9660::tmcl::OvercurrentTiming uvwLowSideTime, tmc9660::tmcl::OvercurrentTiming uvwHighSideTime, tmc9660::tmcl::OvercurrentTiming y2LowSideTime, tmc9660::tmcl::OvercurrentTiming y2HighSideTime) noexcept
Configure the overcurrent protection deglitch time for UVW and Y2 phases.
Definition TMC9660.cpp:533
bool configureBootstrapCurrentLimit(tmc9660::tmcl::BootstrapCurrentLimit limit) noexcept
Configure bootstrap current limit.
Definition TMC9660.cpp:460
bool configureVgsShortProtectionY2(tmc9660::tmcl::VgsShortEnable enableLowSideOn, tmc9660::tmcl::VgsShortEnable enableLowSideOff, tmc9660::tmcl::VgsShortEnable enableHighSideOn, tmc9660::tmcl::VgsShortEnable enableHighSideOff) noexcept
Configure gate-to-source short protection for Y2 phase.
Definition TMC9660.cpp:576
bool setOvercurrentBlanking(tmc9660::tmcl::OvercurrentTiming uvwLowSideTime, tmc9660::tmcl::OvercurrentTiming uvwHighSideTime, tmc9660::tmcl::OvercurrentTiming y2LowSideTime, tmc9660::tmcl::OvercurrentTiming y2HighSideTime) noexcept
Configure the overcurrent protection blanking time for UVW and Y2 phases.
Definition TMC9660.cpp:516
bool setVgsShortBlankingTime(tmc9660::tmcl::VgsBlankingTime uvwTime, tmc9660::tmcl::VgsBlankingTime y2Time) noexcept
Set gate-to-source short protection blanking time.
Definition TMC9660.cpp:592
bool configureCurrentLimits(tmc9660::tmcl::GateCurrentSink sinkCurrentUVW, tmc9660::tmcl::GateCurrentSource sourceCurrentUVW, tmc9660::tmcl::GateCurrentSink sinkCurrentY2, tmc9660::tmcl::GateCurrentSource sourceCurrentY2) noexcept
Configure gate driver current limits for UVW and Y2 phases.
Definition TMC9660.cpp:444
bool setVgsShortDeglitchTime(tmc9660::tmcl::VgsDeglitchTime uvwTime, tmc9660::tmcl::VgsDeglitchTime y2Time) noexcept
Set gate-to-source short protection deglitch time.
Definition TMC9660.cpp:602
bool setOvercurrentThresholds(tmc9660::tmcl::OvercurrentThreshold uvwLowSideThreshold, tmc9660::tmcl::OvercurrentThreshold uvwHighSideThreshold, tmc9660::tmcl::OvercurrentThreshold y2LowSideThreshold, tmc9660::tmcl::OvercurrentThreshold y2HighSideThreshold) noexcept
Configure overcurrent protection thresholds for UVW and Y2 phases.
Definition TMC9660.cpp:499
bool enableOvercurrentProtection(tmc9660::tmcl::OvercurrentEnable enableUVWLowSide, tmc9660::tmcl::OvercurrentEnable enableUVWHighSide, tmc9660::tmcl::OvercurrentEnable enableY2LowSide, tmc9660::tmcl::OvercurrentEnable enableY2HighSide) noexcept
Enable or disable overcurrent protection for UVW and Y2 phases.
Definition TMC9660.cpp:482
bool configureBreakBeforeMakeTiming(uint8_t lowSideUVW, uint8_t highSideUVW, uint8_t lowSideY2, uint8_t highSideY2) noexcept
Configure the break-before-make timing for the gate driver.
Definition TMC9660.cpp:411
bool configureUndervoltageProtection(tmc9660::tmcl::UndervoltageLevel supplyLevel, tmc9660::tmcl::UndervoltageEnable enableVdrv, tmc9660::tmcl::UndervoltageEnable enableBstUVW, tmc9660::tmcl::UndervoltageEnable enableBstY2) noexcept
Configure undervoltage protection settings.
Definition TMC9660.cpp:466
bool enableAdaptiveDriveTime(bool enableUVW, bool enableY2) noexcept
Enable or disable adaptive drive time for UVW and Y2 phases.
Definition TMC9660.cpp:425
bool configureDriveTimes(uint8_t sinkTimeUVW, uint8_t sourceTimeUVW, uint8_t sinkTimeY2, uint8_t sourceTimeY2) noexcept
Configure drive times for UVW and Y2 phases.
Definition TMC9660.cpp:434
bool setOutputPolarity(tmc9660::tmcl::PwmOutputPolarity lowSide, tmc9660::tmcl::PwmOutputPolarity highSide) noexcept
Set the gate driver output polarity.
Definition TMC9660.cpp:401
GateDriver(TMC9660 &parent) noexcept
Definition TMC9660.hpp:822
bool setDriveFaultBehavior(tmc9660::tmcl::DriveFaultBehaviour faultBehavior) noexcept
Configure drive fault behavior.
Definition TMC9660.cpp:618
bool enableVdsMonitoringLow(tmc9660::tmcl::VdsUsage uvwEnable, tmc9660::tmcl::VdsUsage y2Enable) noexcept
Enable or disable VDS monitoring for overcurrent protection on UVW and Y2 low sides.
Definition TMC9660.cpp:550
Convenience helpers for reading and writing global parameters.
Definition TMC9660.hpp:2516
bool getIODirectionMask(uint32_t &mask) noexcept
Get GPIO direction mask (bank0:IO_DIRECTION_MASK).
Definition TMC9660.cpp:2512
bool setTimerPeriod(uint8_t timer, uint32_t period_ms) noexcept
Set interrupt timer period (bank3).
Definition TMC9660.cpp:2570
Globals(TMC9660 &parent) noexcept
Definition TMC9660.hpp:2606
bool setSerialAddress(uint8_t address) noexcept
Set module serial address (bank0:SERIAL_ADDRESS).
Definition TMC9660.cpp:2467
bool getPullEnableMask(uint32_t &mask) noexcept
Get pull-up/down enable mask.
Definition TMC9660.cpp:2520
bool readBank2(tmc9660::tmcl::GlobalParamBank2 param, int32_t &value) noexcept
Read a signed user variable from bank 2.
Definition TMC9660.cpp:2447
bool setInputTrigger(uint8_t index, tmc9660::tmcl::TriggerTransition transition) noexcept
Set trigger transition for digital input n (bank3 INPUT_n_TRIGGER_TRANSITION).
Definition TMC9660.cpp:2584
bool setPullDirectionMask(uint32_t mask) noexcept
Set pull direction mask (bank0:IO_INPUT_PULLUP_PULLDOWN_DIRECTION_MASK).
Definition TMC9660.cpp:2524
bool readBank0(tmc9660::tmcl::GlobalParamBank0 param, uint32_t &value) noexcept
Read a value from bank 0 (system settings).
Definition TMC9660.cpp:2439
bool getUserVariable(uint8_t index, int32_t &value) noexcept
Read user variable by index (bank2).
Definition TMC9660.cpp:2563
bool getClearUserVariables(bool &clear) noexcept
Get clear-user-variable flag.
Definition TMC9660.cpp:2548
TMC9660 & driver
Definition TMC9660.hpp:2607
bool setClearUserVariables(bool clear) noexcept
Configure clearing of user variables on startup (bank0:CLEAR_USER_VARIABLES).
Definition TMC9660.cpp:2544
bool setPullEnableMask(uint32_t mask) noexcept
Set pull-up/down enable mask (bank0:IO_INPUT_PULLUP_PULLDOWN_ENABLE_MASK).
Definition TMC9660.cpp:2516
bool setUserVariable(uint8_t index, int32_t value) noexcept
Set user variable by index (bank2).
Definition TMC9660.cpp:2556
bool writeBank2(tmc9660::tmcl::GlobalParamBank2 param, int32_t value) noexcept
Write a signed user variable in bank 2.
Definition TMC9660.cpp:2443
bool readBank3(tmc9660::tmcl::GlobalParamBank3 param, uint32_t &value) noexcept
Read a value from bank 3 (interrupt configuration).
Definition TMC9660.cpp:2459
bool configureHeartbeat(tmc9660::tmcl::HeartbeatMonitoringConfig iface, uint32_t timeout_ms) noexcept
Configure heartbeat monitoring interface and timeout.
Definition TMC9660.cpp:2491
bool getTimerPeriod(uint8_t timer, uint32_t &period_ms) noexcept
Get interrupt timer period (bank3).
Definition TMC9660.cpp:2577
bool setHostAddress(uint8_t address) noexcept
Set host serial address (bank0:SERIAL_HOST_ADDRESS).
Definition TMC9660.cpp:2479
bool getHostAddress(uint8_t &address) noexcept
Get host serial address (bank0:SERIAL_HOST_ADDRESS).
Definition TMC9660.cpp:2483
bool writeBank3(tmc9660::tmcl::GlobalParamBank3 param, uint32_t value) noexcept
Write a value to bank 3 (interrupt configuration).
Definition TMC9660.cpp:2455
bool getInputTrigger(uint8_t index, tmc9660::tmcl::TriggerTransition &transition) noexcept
Get trigger transition for digital input n.
Definition TMC9660.cpp:2593
bool setIODirectionMask(uint32_t mask) noexcept
Set GPIO direction mask (bank0:IO_DIRECTION_MASK).
Definition TMC9660.cpp:2508
bool setAutoStart(bool enable) noexcept
Enable or disable auto-start of stored program (bank0:AUTO_START_ENABLE).
Definition TMC9660.cpp:2532
bool getHeartbeat(tmc9660::tmcl::HeartbeatMonitoringConfig &iface, uint32_t &timeout_ms) noexcept
Read heartbeat monitoring configuration.
Definition TMC9660.cpp:2499
bool getSerialAddress(uint8_t &address) noexcept
Get module serial address (bank0:SERIAL_ADDRESS).
Definition TMC9660.cpp:2471
bool writeBank0(tmc9660::tmcl::GlobalParamBank0 param, uint32_t value) noexcept
Write a value to bank 0 (system settings).
Definition TMC9660.cpp:2435
bool getAutoStart(bool &enable) noexcept
Read auto-start enable flag.
Definition TMC9660.cpp:2536
bool getPullDirectionMask(uint32_t &mask) noexcept
Get pull direction mask.
Definition TMC9660.cpp:2528
Subsystem for configuring the communication watchdog (heartbeat).
Definition TMC9660.hpp:2487
bool configure(tmc9660::tmcl::HeartbeatMonitoringConfig mode, uint32_t timeout_ms) noexcept
Enable the heartbeat monitor and set timeout.
Definition TMC9660.cpp:2414
Heartbeat(TMC9660 &parent) noexcept
Definition TMC9660.hpp:2502
TMC9660 & driver
Definition TMC9660.hpp:2503
Subsystem for motor thermal overload protection via I²t integration.
Definition TMC9660.hpp:2016
bool getActualTotalMotorCurrent(uint32_t ¤t, uint8_t motorIndex=0) noexcept
Read the total motor current (torque+flux).
Definition TMC9660.cpp:2087
bool setLimit2(uint32_t limit) noexcept
Set the I²t limit for window 2.
Definition TMC9660.cpp:2079
bool getSum2(uint32_t &sum) noexcept
Read the current integrated sum of window 2.
Definition TMC9660.cpp:2096
bool getSum1(uint32_t &sum) noexcept
Read the current integrated sum of window 1.
Definition TMC9660.cpp:2092
bool getThermalWindingTimeConstant2(uint16_t &ms) noexcept
Get the winding time constant for window 2.
Definition TMC9660.cpp:2071
bool setThermalWindingTimeConstant1(uint16_t ms) noexcept
Set the winding time constant for window 1.
Definition TMC9660.cpp:2047
bool resetIntegralState() noexcept
Reset both I²t accumulators to zero.
Definition TMC9660.cpp:2043
bool setThermalWindingTimeConstant2(uint16_t ms) noexcept
Set the winding time constant for window 2.
Definition TMC9660.cpp:2067
bool setLimit1(uint32_t limit) noexcept
Set the I²t limit for window 1.
Definition TMC9660.cpp:2059
IIT(TMC9660 &parent) noexcept
Definition TMC9660.hpp:2085
bool getThermalWindingTimeConstant1(uint16_t &ms) noexcept
Get the winding time constant for window 1.
Definition TMC9660.cpp:2051
TMC9660 & driver
Definition TMC9660.hpp:2086
bool configure(uint16_t timeConstant1_ms, float continuousCurrent1_A, uint16_t timeConstant2_ms, float continuousCurrent2_A) noexcept
Configure the two I²t monitoring windows.
Definition TMC9660.cpp:2029
bool getLimit2(uint32_t &limit) noexcept
Get the I²t limit for window 2.
Definition TMC9660.cpp:2083
bool getLimit1(uint32_t &limit) noexcept
Get the I²t limit for window 1.
Definition TMC9660.cpp:2063
Subsystem for configuring motor type and basic settings.
Definition TMC9660.hpp:156
MotorConfig(TMC9660 &parent) noexcept
Definition TMC9660.hpp:352
TMC9660 & driver
Definition TMC9660.hpp:353
Subsystem for storing and recalling parameters from nonvolatile flash.
Definition TMC9660.hpp:2442
NvmStorage(TMC9660 &parent) noexcept
Definition TMC9660.hpp:2470
bool storeToFlash() noexcept
Store all writable parameters to flash or EEPROM.
Definition TMC9660.cpp:2385
bool recallFromFlash() noexcept
Restore parameters previously saved to NVM.
Definition TMC9660.cpp:2390
TMC9660 & driver
Definition TMC9660.hpp:2471
bool eraseFlashBank(uint8_t n) noexcept
Erase a configuration bank from external memory.
Definition TMC9660.cpp:2405
Subsystem for entering low-power hibernation mode and configuring wake.
Definition TMC9660.hpp:2676
Power(TMC9660 &parent) noexcept
Definition TMC9660.hpp:2695
bool enableWakePin(bool enable) noexcept
Enable or disable the external wake-up pin.
Definition TMC9660.cpp:2421
bool enterPowerDown(tmc9660::tmcl::PowerDownTimeout period) noexcept
Put the chip into power-down mode for a set duration.
Definition TMC9660.cpp:2426
TMC9660 & driver
Definition TMC9660.hpp:2696
Subsystem for motor protection features.
Definition TMC9660.hpp:2247
TMC9660 & driver
Definition TMC9660.hpp:2298
Protection(TMC9660 &parent) noexcept
Definition TMC9660.hpp:2297
bool resetI2tState() noexcept
Reset the integrated I²t sum accumulators.
Definition TMC9660.cpp:2286
bool configureVoltage(uint16_t overVoltThreshold, uint16_t underVoltThreshold) noexcept
Configure overvoltage and undervoltage protection thresholds.
Definition TMC9660.cpp:2231
bool configureTemperature(float warningDegC, float shutdownDegC) noexcept
Configure over-temperature protection thresholds.
Definition TMC9660.cpp:2241
bool setOvercurrentEnabled(bool enabled) noexcept
Enable or disable overcurrent protection on the driver outputs.
Definition TMC9660.cpp:2263
bool configureI2t(uint16_t timeConstant1_ms, float continuousCurrent1_A, uint16_t timeConstant2_ms, float continuousCurrent2_A) noexcept
Configure the two I²t monitoring windows for motor current.
Definition TMC9660.cpp:2269
Subsystem for debug and data logging features.
Definition TMC9660.hpp:2392
RamDebug(TMC9660 &parent) noexcept
Definition TMC9660.hpp:2423
bool startCapture() noexcept
Start capturing data using RAMDebug.
Definition TMC9660.cpp:2358
bool getStatus(bool &isRunning) noexcept
Get the current state of the RAM debug engine.
Definition TMC9660.cpp:2368
bool readData(uint32_t index, uint32_t &data) noexcept
Read a captured sample from RAMDebug buffer.
Definition TMC9660.cpp:2362
TMC9660 & driver
Definition TMC9660.hpp:2424
bool init(uint32_t sampleCount) noexcept
Initialize and configure the RAMDebug feature (data logging).
Definition TMC9660.cpp:2349
Hardware 8-segment acceleration/dec-acc profile controller.
Definition TMC9660.hpp:1760
bool enable(bool on) noexcept
Enable or disable the ramp generator block.
Definition TMC9660.cpp:1848
bool enableFeedForward(bool enableVelFF, bool enableAccelFF, uint16_t accelFFGain, tmc9660::tmcl::AccelerationFFShift accelFFShift) noexcept
Enable hardware feed-forward terms and set gain/shift.
Definition TMC9660.cpp:1886
bool setDeceleration(uint32_t d1, uint32_t d2, uint32_t dMax) noexcept
Set deceleration segments D1, D2, Dmax (µ units/s²).
Definition TMC9660.cpp:1860
bool getRampVelocity(int32_t &velocity) noexcept
Get the current target velocity calculated by the ramp controller.
Definition TMC9660.cpp:1903
TMC9660 & driver
Definition TMC9660.hpp:1833
bool setDirectVelocityMode(bool enable) noexcept
Direct-velocity mode instead of classic PI velocity loop.
Definition TMC9660.cpp:1899
bool setTiming(uint16_t tVmaxCycles, uint16_t tZeroWaitCycles) noexcept
Timing constraints at Vmax and between moves.
Definition TMC9660.cpp:1879
Ramp(TMC9660 &parent) noexcept
Definition TMC9660.hpp:1832
bool setAcceleration(uint32_t a1, uint32_t a2, uint32_t aMax) noexcept
Set acceleration segments A1, A2, Amax (µ units/s²).
Definition TMC9660.cpp:1852
bool getRampPosition(int32_t &position) noexcept
Get the current target position calculated by the ramp controller.
Definition TMC9660.cpp:1911
bool setVelocities(uint32_t vStart, uint32_t vStop, uint32_t v1, uint32_t v2, uint32_t vMax) noexcept
Configure velocity thresholds and limits.
Definition TMC9660.cpp:1868
Subsystem for executing a reference search (homing) routine.
Definition TMC9660.hpp:1922
bool start() noexcept
Start the reference search procedure.
Definition TMC9660.cpp:1957
bool stop() noexcept
Abort an ongoing reference search.
Definition TMC9660.cpp:1963
TMC9660 & driver
Definition TMC9660.hpp:1933
bool getStatus(tmc9660::tmcl::ReferenceSearchStatus &status) noexcept
Query the current reference search status code.
Definition TMC9660.cpp:1969
ReferenceSearch(TMC9660 &parent) noexcept
Definition TMC9660.hpp:1932
Subsystem for TMCL script execution control.
Definition TMC9660.hpp:2307
bool readMemory(uint16_t address, uint32_t &value) noexcept
Read a 32-bit instruction from script memory.
Definition TMC9660.cpp:2325
bool getStatus(uint32_t &status) noexcept
Query the execution state of the running script.
Definition TMC9660.cpp:2321
bool upload(const std::vector< uint32_t > &scriptData) noexcept
Upload a TMCL script to the TMC9660's internal memory.
Definition TMC9660.cpp:2294
bool reset() noexcept
Reset the TMCL program counter.
Definition TMC9660.cpp:2317
bool getMaxBreakpointCount(uint32_t &count) noexcept
Query the maximum number of supported breakpoints.
Definition TMC9660.cpp:2341
bool clearBreakpoints() noexcept
Remove all breakpoints from the script.
Definition TMC9660.cpp:2337
bool start(uint16_t address=0) noexcept
Start or restart execution of the stored script.
Definition TMC9660.cpp:2304
Script(TMC9660 &parent) noexcept
Definition TMC9660.hpp:2383
bool stop() noexcept
Stop execution of the running script.
Definition TMC9660.cpp:2309
bool removeBreakpoint(uint16_t address) noexcept
Remove a previously set breakpoint.
Definition TMC9660.cpp:2333
bool addBreakpoint(uint16_t address) noexcept
Add a breakpoint at the given address.
Definition TMC9660.cpp:2329
TMC9660 & driver
Definition TMC9660.hpp:2384
bool step() noexcept
Execute a single TMCL instruction of the loaded script.
Definition TMC9660.cpp:2313
Subsystem for controlling the STEP/DIR pulse input interface.
Definition TMC9660.hpp:1851
bool setMicrostepResolution(tmc9660::tmcl::StepDirStepDividerShift µSteps) noexcept
Configure microstep resolution for each STEP pulse.
Definition TMC9660.cpp:1923
bool setSignalTimeout(uint16_t timeout_ms) noexcept
Timeout before extrapolated motion stops after last pulse.
Definition TMC9660.cpp:1938
bool enableInterface(bool on) noexcept
Enable or disable the STEP/DIR interface.
Definition TMC9660.cpp:1929
bool enableVelocityFeedForward(bool enableVelFF) noexcept
Enable hardware feed-forward terms and set gain/shift.
Definition TMC9660.cpp:1948
TMC9660 & driver
Definition TMC9660.hpp:1914
bool setMaxExtrapolationVelocity(uint32_t eRPM) noexcept
Set maximum allowed extrapolation velocity.
Definition TMC9660.cpp:1943
StepDir(TMC9660 &parent) noexcept
Definition TMC9660.hpp:1913
bool enableExtrapolation(bool enable) noexcept
Enable signal extrapolation between STEP pulses.
Definition TMC9660.cpp:1933
Configure automatic stop/latch behaviour for deviation, switches.
Definition TMC9660.hpp:2186
bool configureReferenceSwitches(uint8_t mask, bool invertL, bool invertR, bool invertH, bool swapLR) noexcept
Configure reference / limit-switch inputs.
Definition TMC9660.cpp:2207
bool enableDeviationStop(uint32_t maxVelError, uint32_t maxPosError, bool softStop=true) noexcept
Stop when ramp target deviates from actual > thresholds.
Definition TMC9660.cpp:2180
bool getAndClearLatchedPosition(int32_t &pos) noexcept
Read and clear the latched position from a switch event.
Definition TMC9660.cpp:2217
TMC9660 & driver
Definition TMC9660.hpp:2238
StopEvents(TMC9660 &parent) noexcept
Definition TMC9660.hpp:2237
Subsystem for reading various telemetry and status information from the driver.
Definition TMC9660.hpp:2096
int16_t getMotorCurrent() noexcept
Read the current motor current (torque current).
Definition TMC9660.cpp:2124
bool clearGeneralErrorFlags(uint32_t mask) noexcept
Clear bits in the GENERAL_ERROR_FLAGS register.
Definition TMC9660.cpp:2153
bool getGeneralErrorFlags(uint32_t &flags) noexcept
Read the GENERAL_ERROR_FLAGS register.
Definition TMC9660.cpp:2145
TMC9660 & driver
Definition TMC9660.hpp:2177
bool getADCStatusFlags(uint32_t &flags) noexcept
Read the ADC_STATUS_FLAGS register (clipped ADC channels).
Definition TMC9660.cpp:2161
bool clearADCStatusFlags(uint32_t mask) noexcept
Clear bits in the ADC_STATUS_FLAGS register (write-1-to-clear).
Definition TMC9660.cpp:2165
int32_t getActualPosition() noexcept
Read the measured actual position of the motor.
Definition TMC9660.cpp:2138
uint16_t getExternalTemperature() noexcept
Read the external temperature sensor raw value.
Definition TMC9660.cpp:2169
float getSupplyVoltage() noexcept
Read the current supply (bus) voltage.
Definition TMC9660.cpp:2110
float getChipTemperature() noexcept
Read the internal chip temperature.
Definition TMC9660.cpp:2117
bool getGateDriverErrorFlags(uint32_t &flags) noexcept
Read the GDRV_ERROR_FLAGS register.
Definition TMC9660.cpp:2149
bool clearGateDriverErrorFlags(uint32_t mask) noexcept
Clear bits in the GDRV_ERROR_FLAGS register.
Definition TMC9660.cpp:2157
bool getGeneralStatusFlags(uint32_t &flags) noexcept
Read the GENERAL_STATUS_FLAGS register.
Definition TMC9660.cpp:2106
int32_t getActualVelocity() noexcept
Read the measured actual velocity of the motor.
Definition TMC9660.cpp:2131
Aggregated bootloader configuration written by ::TMC9660Bootloader.
Definition TMC9660Bootloader.hpp:191