TMC9660 Driver 0.1.0
API reference
Loading...
Searching...
No Matches
Namespaces | Classes | Concepts | Enumerations | Functions | Variables
tmc9660 Namespace Reference

The TMC9660 driver: everything it declares lives here; internals in detail. More...

Namespaces

namespace  fields
 Bit fields, one lower-case namespace per register: fields::mcc_pwm_config::EnableX.
 
namespace  global0
 Bank 0 numbers.
 
namespace  regs
 The registers by name.
 
namespace  value
 

Classes

struct  BlWriteOptions
 Options of TMC9660::BlWriteConfig(). More...
 
class  BootConfig
 The 64-byte configuration memory of the bootloader, as 16 little-endian 32-bit words. More...
 
class  CheckedConfig
 A configuration proven valid at build time. More...
 
struct  Config
 Configuration of the driver. The defaults are the chip's. More...
 
struct  GateDriverRegConfig
 Gate-driver start-up of register mode: the words of the manual's start sequence. More...
 
struct  GlobalInfo
 One global parameter: its bank, number, access and range. More...
 
struct  LastReply
 The last parameter-mode reply as received (see TMC9660::GetLastReply()). More...
 
struct  ParamInfo
 One row of Table 57. More...
 
struct  PartitionEntry
 One entry of an external-memory partition table. More...
 
struct  Quirks
 Model knobs: where the documents disagree, the driver reads one way by default and a flag selects the other (docs/ambiguities.md). More...
 
struct  RegAddr
 Address of a register: its block and its offset in the block. More...
 
struct  RegInfo
 One row of the register map. More...
 
struct  Result
 The value of a call, or why there is none. More...
 
struct  Result< void >
 The result of a call that returns no value. More...
 
class  SpiInterface
 CRTP base of the platform SPI port. More...
 
class  TMC9660
 Driver for one TMC9660 on a platform port. More...
 
struct  TmclInstruction
 One instruction of a script download. More...
 
class  UartInterface
 CRTP base of the platform UART port. More...
 

Concepts

concept  AnyPort
 Satisfied by a port that derives from exactly one of SpiInterface and UartInterface.
 
concept  SpiPort
 Satisfied by a class that derives from SpiInterface<Port> and implements the required hooks with exactly the types above, noexcept and returning bool.
 
concept  UartPort
 Satisfied by a class that derives from UartInterface<Port> and implements the required hooks with exactly the types above.
 

Enumerations

enum class  MemQuery : uint8_t { Configured = 0 , Connected , Busy }
 Queries about the external memory of the bootloader. More...
 
enum class  PowerDownTime : uint8_t {
  Ms250 = 0 , Ms500 , S1 , S2 ,
  S4 , S8 , S16 , S32
}
 Power-down durations of TMC9660::PowerDown() (global parameter 11). More...
 
enum class  BootField : uint8_t {
  LdoVext1 = 0 , LdoVext2 , LdoSsVext1 , LdoSsVext2 ,
  LdoShortFault , DeviceAddress , HostAddress , UartTxenPostDelay ,
  UartTxenPreDelay , BlDisableUart , BlDisableSpi , BlSpiSelect ,
  BlUartRx , BlUartTx , BlUartTxen , BlUartBaudrate ,
  BlSpi0Sck , BootMode , BlReadyFault , BlExitFault ,
  DisableSelftest , BlConfigFault , StartMotorCtrl , SpiFlashEn ,
  SpiFlashCs , SpiFlashFreq , I2cEepromEn , I2cEepromSda ,
  I2cEepromScl , I2cEepromAddr , I2cEepromFreq , GpioOut ,
  GpioOutEn , GpioPullUp , GpioPullDown , Gpio16To18Out ,
  Gpio16To18OutEn , Gpio16To18PullDown , Gpio16To18PullUp , GpioAnalog2To5 ,
  ClockReserved1 , ClockExtNotInt , ClockXtalCfg , ClockXtalBoost ,
  ClockExtNotXtal , ClockPllOutSel , ClockRdiv , ClockSysClkDiv ,
  HallEnable , HallU , HallV , HallW ,
  Abn1Enable , Abn1A , Abn1B , Abn1N ,
  RefL , RefR , RefH , StepDirEnable ,
  StepPin , DirPin , Abn2Enable , Abn2A ,
  Abn2B , BrakeChopperEnable , BrakeChopperOutput , MechBrakeEnable ,
  MechBrakeOutput , SpiEncEnable , SpiEncBlock , SpiEncMode ,
  SpiEncFreq , SpiEncCsPin , MemTmclScript , MemParameters
}
 Named fields of the configuration memory. More...
 
enum class  GlobalBank : uint8_t { System = 0 , UserVars = 2 , Interrupts = 3 }
 Banks of global parameters. More...
 
enum class  Access : uint8_t {
  ReadOnly = 0 , ReadWrite = 1 , ReadWriteStored = 2 , WriteOnly = 3 ,
  ReadWriteClear = 4
}
 Access class of a parameter (the R/W column of Table 57). More...
 
enum class  Param : uint16_t {
  MOTOR_TYPE = 0 , MOTOR_POLE_PAIRS = 1 , MOTOR_DIRECTION = 2 , MOTOR_PWM_FREQUENCY = 3 ,
  COMMUTATION_MODE = 4 , OUTPUT_VOLTAGE_LIMIT = 5 , MAX_TORQUE = 6 , MAX_FLUX = 7 ,
  PWM_SWITCHING_SCHEME = 8 , IDLE_MOTOR_PWM_BEHAVIOR = 9 , ADC_SHUNT_TYPE = 12 , ADC_I0_RAW = 13 ,
  ADC_I1_RAW = 14 , ADC_I2_RAW = 15 , ADC_I3_RAW = 16 , CSA_GAIN_ADC_I0_TO_ADC_I2 = 17 ,
  CSA_GAIN_ADC_I3 = 18 , CSA_FILTER_ADC_I0_TO_ADC_I2 = 19 , CSA_FILTER_ADC_I3 = 20 , CURRENT_SCALING_FACTOR = 21 ,
  PHASE_UX1_ADC_MAPPING = 22 , PHASE_VX2_ADC_MAPPING = 23 , PHASE_WY1_ADC_MAPPING = 24 , PHASE_Y2_ADC_MAPPING = 25 ,
  ADC_I0_SCALE = 26 , ADC_I1_SCALE = 27 , ADC_I2_SCALE = 28 , ADC_I3_SCALE = 29 ,
  ADC_I0_INVERTED = 30 , ADC_I1_INVERTED = 31 , ADC_I2_INVERTED = 32 , ADC_I3_INVERTED = 33 ,
  ADC_I0_OFFSET = 34 , ADC_I1_OFFSET = 35 , ADC_I2_OFFSET = 36 , ADC_I3_OFFSET = 37 ,
  ADC_I0 = 38 , ADC_I1 = 39 , ADC_I2 = 40 , ADC_I3 = 41 ,
  OPENLOOP_ANGLE = 45 , OPENLOOP_CURRENT = 46 , OPENLOOP_VOLTAGE = 47 , ACCELERATION_FF_GAIN = 50 ,
  ACCELERATION_FF_SHIFT = 51 , RAMP_ENABLE = 52 , DIRECT_VELOCITY_MODE = 53 , RAMP_AMAX = 54 ,
  RAMP_A1 = 55 , RAMP_A2 = 56 , RAMP_DMAX = 57 , RAMP_D1 = 58 ,
  RAMP_D2 = 59 , RAMP_VMAX = 60 , RAMP_V1 = 61 , RAMP_V2 = 62 ,
  RAMP_VSTART = 63 , RAMP_VSTOP = 64 , RAMP_TVMAX = 65 , RAMP_TZEROWAIT = 66 ,
  ACCELERATION_FEEDFORWARD_ENABLE = 67 , VELOCITY_FEEDFORWARD_ENABLE = 68 , RAMP_VELOCITY = 69 , RAMP_POSITION = 70 ,
  HALL_PHI_E = 74 , HALL_SECTOR_OFFSET = 75 , HALL_FILTER_LENGTH = 76 , HALL_POSITION_0_OFFSET = 77 ,
  HALL_POSITION_60_OFFSET = 78 , HALL_POSITION_120_OFFSET = 79 , HALL_POSITION_180_OFFSET = 80 , HALL_POSITION_240_OFFSET = 81 ,
  HALL_POSITION_300_OFFSET = 82 , HALL_INVERT_DIRECTION = 83 , HALL_EXTRAPOLATION_ENABLE = 84 , HALL_PHI_E_OFFSET = 85 ,
  ABN_1_PHI_E = 89 , ABN_1_STEPS = 90 , ABN_1_DIRECTION = 91 , ABN_1_INIT_METHOD = 92 ,
  ABN_1_INIT_STATE = 93 , ABN_1_INIT_DELAY = 94 , ABN_1_INIT_VELOCITY = 95 , ABN_1_N_CHANNEL_PHI_E_OFFSET = 96 ,
  ABN_1_N_CHANNEL_INVERTED = 97 , ABN_1_N_CHANNEL_FILTERING = 98 , ABN_1_CLEAR_ON_NEXT_NULL = 99 , ABN_1_VALUE = 100 ,
  TARGET_TORQUE = 104 , ACTUAL_TORQUE = 105 , TARGET_FLUX = 106 , ACTUAL_FLUX = 107 ,
  TORQUE_OFFSET = 108 , TORQUE_P = 109 , TORQUE_I = 110 , FLUX_P = 111 ,
  FLUX_I = 112 , SEPARATE_TORQUE_FLUX_PI_PARAMTERS = 113 , CURRENT_NORM_P = 114 , CURRENT_NORM_I = 115 ,
  TORQUE_PI_ERROR = 116 , FLUX_PI_ERROR = 117 , TORQUE_PI_INTEGRATOR = 118 , FLUX_PI_INTEGRATOR = 119 ,
  FLUX_OFFSET = 120 , VELOCITY_SENSOR_SELECTION = 123 , TARGET_VELOCITY = 124 , ACTUAL_VELOCITY = 125 ,
  VELOCITY_OFFSET = 126 , VELOCITY_P = 127 , VELOCITY_I = 128 , VELOCITY_NORM_P = 129 ,
  VELOCITY_NORM_I = 130 , VELOCITY_PI_INTEGRATOR = 131 , VELOCITY_PI_ERROR = 132 , VELOCITY_SCALING_FACTOR = 133 ,
  STOP_ON_VELOCITY_DEVIATION = 134 , VELOCITY_LOOP_DOWNSAMPLING = 135 , VELOCITY_REACHED_THRESHOLD = 136 , VELOCITY_METER_SWITCH_THRESHOLD = 137 ,
  VELOCITY_METER_SWITCH_HYSTERESIS = 138 , VELOCITY_METER_MODE = 139 , POSITION_SENSOR_SELECTION = 142 , TARGET_POSITION = 143 ,
  ACTUAL_POSITION = 144 , POSITION_SCALING_FACTOR = 145 , POSITION_P = 146 , POSITION_I = 147 ,
  POSITION_NORM_P = 148 , POSITION_NORM_I = 149 , POSITION_PI_INTEGRATOR = 150 , POSITION_PI_ERROR = 151 ,
  STOP_ON_POSITION_DEVIATION = 152 , POSITION_LOOP_DOWNSAMPLING = 153 , LATCH_POSITION = 154 , POSITION_LIMIT_LOW = 155 ,
  POSITION_LIMIT_HIGH = 156 , POSITION_REACHED_THRESHOLD = 157 , REFERENCE_SWITCH_ENABLE = 161 , REFERENCE_SWITCH_POLARITY_AND_SWAP = 162 ,
  REFERENCE_SWITCH_LATCH_SETTINGS = 163 , EVENT_STOP_SETTINGS = 164 , REFERENCE_SWITCH_SEARCH_MODE = 165 , REFERENCE_SWITCH_SEARCH_SPEED = 166 ,
  REFERENCE_SWITCH_SPEED = 167 , RIGHT_LIMIT_SWITCH_POSITION = 168 , HOME_SWITCH_POSITION = 169 , LAST_REFERENCE_POSITION = 170 ,
  ABN_2_STEPS = 174 , ABN_2_DIRECTION = 175 , ABN_2_GEAR_RATIO = 176 , ABN_2_ENABLE = 177 ,
  ABN_2_VALUE = 178 , SPI_ENCODE_CS_SETTLE_DELAY_TIME = 181 , SPI_ENCODER_CS_IDLE_DELAY_TIME = 182 , SPI_ENCODER_MAIN_TRANSFER_CMD_SIZE = 183 ,
  SPI_ENCODER_SECONDARY_TRANSFER_CMD_SIZE = 184 , SPI_ENCODER_TRANSFER_DATA_3_0 = 185 , SPI_ENCODER_TRANSFER_DATA_7_4 = 186 , SPI_ENCODER_TRANSFER_DATA_11_8 = 187 ,
  SPI_ENCODER_TRANSFER_DATA_15_12 = 188 , SPI_ENCODER_TRANSFER = 189 , SPI_ENCODER_POSITION_COUNTER_MASK = 190 , SPI_ENCODER_POSITION_COUNTER_SHIFT = 191 ,
  SPI_ENCODER_POSITION_COUNTER_VALUE = 192 , SPI_ENCODER_COMMUTATION_ANGLE = 193 , SPI_ENCODER_INITIALIZATION_METHOD = 194 , SPI_ENCODER_DIRECTION = 195 ,
  SPI_ENCODER_OFFSET = 196 , SPI_LUT_CORRECTION_ENABLE = 197 , SPI_LUT_ADDRESS_SELECT = 198 , SPI_LUT_DATA = 199 ,
  SPI_LUT_COMMON_SHIFT_FACTOR = 201 , STEP_DIR_STEP_DIVIDER_SHIFT = 205 , STEP_DIR_ENABLE = 206 , STEP_DIR_EXTRAPOLATION_ENABLE = 207 ,
  STEP_DIR_STEP_SIGNAL_TIMEOUT_LIMIT = 208 , STEP_DIR_MAXIMUM_EXTRAPOLATION_VELOCITY = 209 , BRAKE_CHOPPER_ENABLE = 212 , BRAKE_CHOPPER_VOLTAGE_LIMIT = 213 ,
  BRAKE_CHOPPER_HYSTERESIS = 214 , RELEASE_BRAKE = 216 , BRAKE_RELEASING_DUTY_CYCLE = 217 , BRAKE_HOLDING_DUTY_CYCLE = 218 ,
  BRAKE_RELEASING_DURATION = 219 , INVERT_BRAKE_OUTPUT = 221 , THERMAL_WINDING_TIME_CONSTANT_1 = 224 , IIT_LIMIT_1 = 225 ,
  IIT_SUM_1 = 226 , THERMAL_WINDING_TIME_CONSTANT_2 = 227 , IIT_LIMIT_2 = 228 , IIT_SUM_2 = 229 ,
  RESET_IIT_SUMS = 230 , ACTUAL_TOTAL_MOTOR_CURRENT = 231 , PWM_L_OUTPUT_POLARITY = 233 , PWM_H_OUTPUT_POLARITY = 234 ,
  BREAK_BEFORE_MAKE_TIME_LOW_UVW = 235 , BREAK_BEFORE_MAKE_TIME_HIGH_UVW = 236 , BREAK_BEFORE_MAKE_TIME_LOW_Y2 = 237 , BREAK_BEFORE_MAKE_TIME_HIGH_Y2 = 238 ,
  USE_ADAPTIVE_DRIVE_TIME_UVW = 239 , USE_ADAPTIVE_DRIVE_TIME_Y2 = 240 , DRIVE_TIME_SINK_UVW = 241 , DRIVE_TIME_SOURCE_UVW = 242 ,
  DRIVE_TIME_SINK_Y2 = 243 , DRIVE_TIME_SOURCE_Y2 = 244 , UVW_SINK_CURRENT = 245 , UVW_SOURCE_CURRENT = 246 ,
  Y2_SINK_CURRENT = 247 , Y2_SOURCE_CURRENT = 248 , BOOTSTRAP_CURRENT_LIMIT = 249 , UNDERVOLTAGE_PROTECTION_SUPPLY_LEVEL = 250 ,
  UNDERVOLTAGE_PROTECTION_VDRV_ENABLE = 251 , UNDERVOLTAGE_PROTECTION_BST_UVW_ENABLE = 252 , UNDERVOLTAGE_PROTECTION_BST_Y2_ENABLE = 253 , OVERCURRENT_PROTECTION_UVW_LOW_SIDE_ENABLE = 254 ,
  OVERCURRENT_PROTECTION_UVW_HIGH_SIDE_ENABLE = 255 , OVERCURRENT_PROTECTION_Y2_LOW_SIDE_ENABLE = 256 , OVERCURRENT_PROTECTION_Y2_HIGH_SIDE_ENABLE = 257 , OVERCURRENT_PROTECTION_UVW_LOW_SIDE_THRESHOLD = 258 ,
  OVERCURRENT_PROTECTION_UVW_HIGH_SIDE_THRESHOLD = 259 , OVERCURRENT_PROTECTION_Y2_LOW_SIDE_THRESHOLD = 260 , OVERCURRENT_PROTECTION_Y2_HIGH_SIDE_THRESHOLD = 261 , OVERCURRENT_PROTECTION_UVW_LOW_SIDE_BLANKING = 262 ,
  OVERCURRENT_PROTECTION_UVW_HIGH_SIDE_BLANKING = 263 , OVERCURRENT_PROTECTION_Y2_LOW_SIDE_BLANKING = 264 , OVERCURRENT_PROTECTION_Y2_HIGH_SIDE_BLANKING = 265 , OVERCURRENT_PROTECTION_UVW_LOW_SIDE_DEGLITCH = 266 ,
  OVERCURRENT_PROTECTION_UVW_HIGH_SIDE_DEGLITCH = 267 , OVERCURRENT_PROTECTION_Y2_LOW_SIDE_DEGLITCH = 268 , OVERCURRENT_PROTECTION_Y2_HIGH_SIDE_DEGLITCH = 269 , OVERCURRENT_PROTECTION_UVW_LOW_SIDE_USE_VDS = 270 ,
  OVERCURRENT_PROTECTION_Y2_LOW_SIDE_USE_VDS = 271 , VGS_SHORT_ON_PROTECTION_UVW_LOW_SIDE_ENABLE = 272 , VGS_SHORT_OFF_PROTECTION_UVW_LOW_SIDE_ENABLE = 273 , VGS_SHORT_ON_PROTECTION_UVW_HIGH_SIDE_ENABLE = 274 ,
  VGS_SHORT_OFF_PROTECTION_UVW_HIGH_SIDE_ENABLE = 275 , VGS_SHORT_ON_PROTECTION_Y2_LOW_SIDE_ENABLE = 276 , VGS_SHORT_OFF_PROTECTION_Y2_LOW_SIDE_ENABLE = 277 , VGS_SHORT_ON_PROTECTION_Y2_HIGH_SIDE_ENABLE = 278 ,
  VGS_SHORT_OFF_PROTECTION_Y2_HIGH_SIDE_ENABLE = 279 , VGS_SHORT_PROTECTION_UVW_BLANKING = 280 , VGS_SHORT_PROTECTION_Y2_BLANKING = 281 , VGS_SHORT_PROTECTION_UVW_DEGLITCH = 282 ,
  VGS_SHORT_PROTECTION_Y2_DEGLITCH = 283 , GDRV_RETRY_BEHAVIOUR = 286 , DRIVE_FAULT_BEHAVIOUR = 287 , FAULT_HANDLER_NUMBER_OF_RETRIES = 288 ,
  GENERAL_STATUS_FLAGS = 289 , SUPPLY_VOLTAGE = 290 , SUPPLY_OVERVOLTAGE_WARNING_THRESHOLD = 291 , SUPPLY_UNDERVOLTAGE_WARNING_THRESHOLD = 292 ,
  EXTERNAL_TEMPERATURE = 293 , EXTERNAL_TEMPERATURE_SHUTDOWN_THRESHOLD = 294 , EXTERNAL_TEMPERATURE_WARNING_THRESHOLD = 295 , CHIP_TEMPERATURE = 296 ,
  CHIP_TEMPERATURE_SHUTDOWN_THRESHOLD = 297 , CHIP_TEMPERATURE_WARNING_THRESHOLD = 298 , GENERAL_ERROR_FLAGS = 299 , GDRV_ERROR_FLAGS = 300 ,
  ADC_STATUS_FLAGS = 301 , MCC_INPUTS_RAW = 304 , FOC_VOLTAGE_UX = 305 , FOC_VOLTAGE_WY = 306 ,
  FOC_VOLTAGE_V = 307 , FIELDWEAKENING_I = 308 , FIELDWEAKENING_VOLTAGE_THRESHOLD = 310 , FOC_CURRENT_UX = 311 ,
  FOC_CURRENT_V = 312 , FOC_CURRENT_WY = 313 , FOC_VOLTAGE_UQ = 314 , FOC_CURRENT_IQ = 315 ,
  TARGET_TORQUE_BIQUAD_FILTER_ENABLE = 318 , TARGET_TORQUE_BIQUAD_FILTER_ACOEFF_1 = 319 , TARGET_TORQUE_BIQUAD_FILTER_ACOEFF_2 = 320 , TARGET_TORQUE_BIQUAD_FILTER_BCOEFF_0 = 321 ,
  TARGET_TORQUE_BIQUAD_FILTER_BCOEFF_1 = 322 , TARGET_TORQUE_BIQUAD_FILTER_BCOEFF_2 = 323 , ACTUAL_VELOCITY_BIQUAD_FILTER_ENABLE = 324 , ACTUAL_VELOCITY_BIQUAD_FILTER_ACOEFF_1 = 325 ,
  ACTUAL_VELOCITY_BIQUAD_FILTER_ACOEFF_2 = 326 , ACTUAL_VELOCITY_BIQUAD_FILTER_BCOEFF_0 = 327 , ACTUAL_VELOCITY_BIQUAD_FILTER_BCOEFF_1 = 328 , ACTUAL_VELOCITY_BIQUAD_FILTER_BCOEFF_2 = 329 ,
  TORQUE_FLUX_COMBINED_TARGET_VALUES = 330 , TORQUE_FLUX_COMBINED_ACTUAL_VALUES = 331 , VOLTAGE_D_Q_COMBINED_ACTUAL_VALUES = 332 , INTEGRATED_ACTUAL_TORQUE_VALUE = 333 ,
  INTEGRATED_ACTUAL_VELOCITY_VALUE = 334
}
 The axis parameters, by name; the value is the number sent as the TMCL type. More...
 
enum class  Block : uint8_t { Mcc = 0 , Adc = 1 , SysCtrl = 2 , RamDebug = 31 }
 Register blocks (Table 5 of the register manual). More...
 
enum class  Error : uint8_t {
  Error::Ok = 0 , Error::NotInitialized = 1 , Error::InvalidArgument = 2 , Error::Bus = 3 ,
  Error::Timeout = 4 , Error::DeviceIdMismatch , Error::Crc = 6 , Error::Busy = 7 ,
  Error::DeviceFault = 8 , Error::Unsupported = 9 , Error::UnexpectedReset , Error::Nack = 17 ,
  Error::WrongMode = 18 , Error::Refused = 19 , Error::VerifyFailed = 20 , Error::BadReply = 21
}
 Why a call failed. Every call of the driver returns one of these in its Result. More...
 
enum class  LogLevel : uint8_t { LogLevel::Error = 0 , LogLevel::Warning , LogLevel::Info , LogLevel::Debug }
 Severity passed to the optional Log() hook. More...
 
enum class  BusStatus : uint8_t { BusStatus::Ok = 0 , BusStatus::Fault , BusStatus::Timeout }
 What a UART port reports for one exchange. More...
 
enum class  CtrlPin : uint8_t { CtrlPin::Reset = 0 , CtrlPin::DrvEn , CtrlPin::Wake , CtrlPin::Faultn }
 The control pins of the chip that the optional GpioSet() and GpioGet() hooks may drive. More...
 
enum class  GpioSignal : uint8_t { GpioSignal::INACTIVE = 0 , GpioSignal::ACTIVE = 1 }
 Logical level of a control pin; the port maps it to the physical polarity. More...
 
enum class  Mode : uint8_t { Mode::Bootloader = 0 , Mode::Parameter = 1 , Mode::Register = 2 }
 The protocol the chip speaks on its host interface. More...
 
enum class  BootMode : uint8_t { BootMode::Reserved , BootMode::Register = 1 , BootMode::Parameter = 2 , BootMode::Reserved3 = 3 }
 BOOT_MODE of the boot configuration (offset 8, bits 0-1). More...
 
enum class  Bank : uint8_t { Bank::SpiFlash = 1 , Bank::I2cEeprom = 2 , Bank::Otp = 3 , Bank::Config = 5 }
 External memory banks of the bootloader (SET_BANK). More...
 
enum class  BlInfo : uint8_t {
  BlInfo::ChipType = 0 , BlInfo::BlVersion = 1 , BlInfo::Features = 2 , BlInfo::GitInfo = 12 ,
  BlInfo::ChipVersion = 13 , BlInfo::ChipFrequency = 14 , BlInfo::ConfigMemStart = 17 , BlInfo::ConfigMemSize = 18 ,
  BlInfo::OtpMemSize = 19 , BlInfo::I2cMemSize = 20 , BlInfo::SpiMemSize = 21 , BlInfo::PartitionVersion = 22 ,
  BlInfo::SpiMemPartitions = 25 , BlInfo::I2cMemPartitions = 26 , BlInfo::ChipVariant = 28
}
 GET_INFO selectors of the bootloader. More...
 
enum class  BlStatus : uint8_t {
  BlStatus::Ok = 0 , BlStatus::CmdNotFound = 1 , BlStatus::InvalidAddr = 3 , BlStatus::InvalidValue = 4 ,
  BlStatus::InvalidBank = 14 , BlStatus::Busy = 15 , BlStatus::MemUnconfigured = 17 , BlStatus::OtpError = 18 ,
  BlStatus::SessionStart = 19 , BlStatus::CmdNotAvailable = 20 , BlStatus::BootloaderResumed = 21
}
 Bootloader reply status codes (datasheet bootloader chapter). More...
 
enum class  BlCmd : uint8_t {
  BlCmd::GetInfo = 0 , BlCmd::GetBank = 8 , BlCmd::SetBank = 9 , BlCmd::GetAddress = 10 ,
  BlCmd::SetAddress = 11 , BlCmd::Read32 = 12 , BlCmd::Read32Inc = 13 , BlCmd::Read16 = 14 ,
  BlCmd::Read16Inc = 15 , BlCmd::Read8 = 16 , BlCmd::Read8Inc = 17 , BlCmd::Write32 = 18 ,
  BlCmd::Write32Inc = 19 , BlCmd::Write16 = 20 , BlCmd::Write16Inc = 21 , BlCmd::Write8 = 22 ,
  BlCmd::Write8Inc = 23 , BlCmd::NoOp = 29 , BlCmd::OtpLoad = 30 , BlCmd::OtpBurn = 31 ,
  BlCmd::MemIsConfigured = 32 , BlCmd::MemIsConnected = 33 , BlCmd::FlashSendCmd = 36 , BlCmd::FlashEraseSector = 37 ,
  BlCmd::MemIsBusy = 40 , BlCmd::BootstrapRs485 = 255
}
 Bootloader command codes. More...
 
enum class  Tmcl : uint8_t {
  Tmcl::Mst = 3 , Tmcl::Sap = 5 , Tmcl::Gap = 6 , Tmcl::Stap = 7 ,
  Tmcl::Sgp = 9 , Tmcl::Ggp = 10 , Tmcl::Rfs = 13 , Tmcl::Sio = 14 ,
  Tmcl::Gio = 15 , Tmcl::Calc = 19 , Tmcl::Comp = 20 , Tmcl::Jc = 21 ,
  Tmcl::Ja = 22 , Tmcl::Csub = 23 , Tmcl::Rsub = 24 , Tmcl::Ei = 25 ,
  Tmcl::Di = 26 , Tmcl::Wait = 27 , Tmcl::Stop = 28 , Tmcl::Calcx = 33 ,
  Tmcl::Aap = 34 , Tmcl::Agp = 35 , Tmcl::Cle = 36 , Tmcl::Vect = 37 ,
  Tmcl::Reti = 38 , Tmcl::Calcvv = 40 , Tmcl::Calcva = 41 , Tmcl::Calcav = 42 ,
  Tmcl::Calcvx = 43 , Tmcl::Calcxv = 44 , Tmcl::Calcv = 45 , Tmcl::Rst = 48 ,
  Tmcl::Djnz = 49 , Tmcl::Siv = 55 , Tmcl::Giv = 56 , Tmcl::Aiv = 57 ,
  Tmcl::ApplStop = 128 , Tmcl::ApplRun = 129 , Tmcl::ApplStep = 130 , Tmcl::ApplReset = 131 ,
  Tmcl::DownloadStart = 132 , Tmcl::DownloadEnd = 133 , Tmcl::ReadMem = 134 , Tmcl::GetStatus = 135 ,
  Tmcl::GetVersion = 136 , Tmcl::FactoryDefault = 137 , Tmcl::Breakpoint = 141 , Tmcl::RamDebug = 142 ,
  Tmcl::GetInfo = 157 , Tmcl::Boot = 242
}
 TMCL operation codes (Table 18 of the parameter mode manual). More...
 
enum class  TmclStatus : uint8_t {
  TmclStatus::Ok = 100 , TmclStatus::CmdLoaded = 101 , TmclStatus::ChecksumError = 1 , TmclStatus::InvalidCommand = 2 ,
  TmclStatus::WrongType = 3 , TmclStatus::InvalidValue = 4 , TmclStatus::CmdNotAvailable = 6 , TmclStatus::CmdLoadError = 7 ,
  TmclStatus::MaxExceeded = 9 , TmclStatus::DownloadNotPossible = 10
}
 TMCL reply status codes (Table 19). More...
 
enum class  TmclSpiStatus : uint8_t { TmclSpiStatus::Ok = 0xFF , TmclSpiStatus::ChecksumError = 0x00 , TmclSpiStatus::FirstCommand = 0x0C , TmclSpiStatus::NotReady = 0xF0 }
 SPI status byte of a TMCL reply. More...
 
enum class  RamDebugType : uint8_t {
  RamDebugType::Init = 0 , RamDebugType::SampleCount = 1 , RamDebugType::Prescaler = 3 , RamDebugType::SetChannel = 4 ,
  RamDebugType::SetTriggerChannel = 5 , RamDebugType::TriggerMaskShift = 6 , RamDebugType::EnableTrigger = 7 , RamDebugType::GetState = 8 ,
  RamDebugType::ReadSample = 9 , RamDebugType::GetInfo = 10 , RamDebugType::GetChannelType = 11 , RamDebugType::GetChannelAddress = 12 ,
  RamDebugType::SetPretrigger = 13 , RamDebugType::GetPretrigger = 14
}
 RAMDebug types (Table 16). More...
 
enum class  ReferenceSearch : uint8_t { ReferenceSearch::Start = 0 , ReferenceSearch::Stop = 1 , ReferenceSearch::Status = 2 }
 RFS sub-commands. More...
 
enum class  TmclLayout : uint8_t { TmclLayout::Auto = 0 , TmclLayout::MotorHigh , TmclLayout::TypeHigh }
 Where the type and the motor or bank bytes of a TMCL frame put their bits (ambiguity A2). More...
 

Functions

constexpr Result< std::size_t > BuildPartitionTable (std::span< const PartitionEntry > entries, uint8_t size_index, uint8_t sector_index, std::span< uint8_t > out) noexcept
 Build a partition table (datasheet Tables 21 and 22): header, entries, CRC-32 over the bytes from the magic number on.
 
constexpr const GlobalInfo * FindGlobal (uint8_t bank, uint32_t number) noexcept
 The row of a global parameter.
 
constexpr Config KconfigDefaults () noexcept
 The configuration menuconfig selected, on top of the Config{} defaults.
 
constexpr const ParamInfo * FindParam (uint32_t id) noexcept
 The table row of an axis parameter.
 
constexpr const RegInfo * FindRegister (RegAddr addr) noexcept
 The map row of a register.
 
constexpr const char * ToString (Error error) noexcept
 The name of an error, for logs.
 
constexpr Error Validate (const Config &c) noexcept
 Check a Config without touching the bus.
 
void ConfigIsInvalid () noexcept
 Reached only when a CheckedConfig is built from an invalid configuration: it is never defined, so the build fails and names it (KB-CPP20-013).
 
constexpr const char * GetDriverVersion () noexcept
 
constexpr uint32_t GetDriverVersionMajor () noexcept
 
constexpr uint32_t GetDriverVersionMinor () noexcept
 
constexpr uint32_t GetDriverVersionPatch () noexcept
 

Variables

constexpr uint32_t kConfigMemAddress = 0x0002'0000U
 Address of the configuration memory in the bootloader's address space.
 
constexpr std::size_t kClockWordIndex = 6
 Word index of the clock configuration (byte offset 24).
 
constexpr std::size_t kBootModeWordIndex = 2
 Word index of the BOOT_MODE word (byte offset 8): written last.
 
constexpr std::size_t kLdoWordIndex = 0
 Word index of the LDO configuration (byte offset 0).
 
constexpr std::size_t kPartitionHeaderBytes = 16
 Header size of a partition table.
 
constexpr std::size_t kPartitionEntryBytes = 24
 Size of one partition entry.
 
constexpr std::array< GlobalInfo, 55 > kGlobals = detail::MakeGlobals()
 Tables 61 to 63, sorted by bank and number.
 
constexpr std::array< int32_t, 513 > kAllowedValues
 Every value a coded parameter accepts, concatenated.
 
constexpr std::array< ParamInfo, 289 > kParams
 Table 57, sorted by number.
 
constexpr std::array< RegInfo, 163 > kRegisters
 The register map, sorted by block and offset.
 
constexpr int32_t kSystemOff = 0
 Value of COMMUTATION_MODE (parameter 4) that leaves the gate driver off.
 
constexpr int32_t kCommutationModeMax = 8
 The largest valid COMMUTATION_MODE value.
 
constexpr uint32_t kChipId = 0x544D0001U
 The chip ID every TMC9660 reports (bootloader CHIP_TYPE, register MCC_INFO_CHIP).
 
constexpr uint32_t kMotorControlClockHz = 40'000'000U
 The system clock motor control needs, in Hz.
 
constexpr uint32_t kBootMagic = 0xA3B4C5D6U
 The magic value of the Boot command.
 
Bus requirements

What the TMC9660 needs from the UART.

constexpr uint8_t kSpiMode = 3
 SPI mode: CPOL 1, CPHA 1 (the default of the chip's SPI peripheral).
 
constexpr bool kMsbFirst = true
 Each byte is clocked most significant bit first; multi-byte values are big endian.
 
constexpr uint32_t kMaxClockHz = 10'000'000
 Highest SCK frequency.
 
constexpr uint32_t kCsSetupNs = 100
 CS low to the first SCK edge, t_CSS.
 
constexpr uint32_t kCsHoldNs = 100
 SCK edge to CS change, t_CC (data sheet p. 27: one SCK period, 100 ns at 10 MHz).
 
constexpr bool kContinuousWord = true
 true: a datagram is clocked in one CS low period, without a CS pulse between its bytes.
 
constexpr uint32_t kMinCsHighNs = 100
 Shortest time CS stays high between two datagrams, t_CSH (4 system clocks at 40 MHz).
 
constexpr uint32_t kClockPhaseNs = 20
 SCK low and high time, t_CL and t_CH.
 
constexpr uint32_t kDataSetupNs = 20
 Data setup and hold time, t_DU and t_DH.
 
constexpr std::size_t kBootloaderDatagramBytes = 5
 Bootloader datagram length in bytes.
 
constexpr std::size_t kParameterDatagramBytes = 8
 Parameter-mode (TMCL) datagram length in bytes.
 
constexpr std::size_t kRegisterDatagramBytes = 6
 Register-mode datagram length in bytes.
 
constexpr uint8_t kUartDataBits = 8
 Data bits of a frame: 8N1, one start bit and one stop bit.
 
constexpr uint32_t kMaxBaudRate = 5'000'000
 Highest baud rate.
 
constexpr uint32_t kTurnaroundUs = 1'000
 
constexpr uint32_t kMinAutobaudRate = 9'600
 Lowest standard baud rate the chip detects automatically.
 
constexpr uint32_t kMaxAutobaudRate = 250'000
 Highest standard baud rate the chip detects automatically at a 40 MHz system clock.
 

Detailed Description

The TMC9660 driver: everything it declares lives here; internals in detail.

Enumeration Type Documentation

◆ Access

enum class tmc9660::Access : uint8_t
strong

Access class of a parameter (the R/W column of Table 57).

Enumerator
ReadOnly 

R: GAP only.

ReadWrite 

RW: SAP and GAP, not stored by STAP.

ReadWriteStored 

RWE: SAP and GAP, STAP stores it.

WriteOnly 

W: SAP only.

ReadWriteClear 

Flags: GAP; SAP with 1 clears the bit (RWC).

◆ Block

enum class tmc9660::Block : uint8_t
strong

Register blocks (Table 5 of the register manual).

Enumerator
Mcc 

Motion control core.

Adc 

ADC configuration.

SysCtrl 

System control.

RamDebug 

RAMDebug; offsets are subcommand and index, not register numbers.

◆ BootField

enum class tmc9660::BootField : uint8_t
strong

Named fields of the configuration memory.

Enumerator
LdoVext1 

VEXT1 output voltage select (offset 0, bits 0-1).

LdoVext2 

VEXT2 output voltage select (bits 2-3).

LdoSsVext1 

VEXT1 start-up select (bits 4-5).

LdoSsVext2 

VEXT2 start-up select (bits 6-7).

LdoShortFault 

Signal an LDO short on FAULTN (bit 8).

DeviceAddress 

UART device address (offset 2, bits 0-7).

HostAddress 

UART host address (bits 8-15).

UartTxenPostDelay 

TX-enable release delay (offset 4, bits 0-7).

UartTxenPreDelay 

TX-enable lead (bits 8-15).

BlDisableUart 

Disable the bootloader UART (offset 6, bit 0).

BlDisableSpi 

Disable the bootloader SPI (bit 1).

BlSpiSelect 

Bootloader SPI instance (bit 2).

BlUartRx 

Bootloader UART RX pin (bit 3).

BlUartTx 

Bootloader UART TX pin (bit 4).

BlUartTxen 

Bootloader UART TX-enable pin (bits 5-6).

BlUartBaudrate 

Bootloader UART baud rate (bits 7-9).

BlSpi0Sck 

SPI0 SCK pin (bit 10).

BootMode 

BOOT_MODE (offset 8, bits 0-1): see BootMode.

BlReadyFault 

Assert FAULTN until the bootloader is ready (bit 2).

BlExitFault 

Assert FAULTN while leaving the bootloader (bit 3).

DisableSelftest 

Skip the start-up self-test (bit 8).

BlConfigFault 

Assert FAULTN while a configuration change applies (bit 9).

StartMotorCtrl 

Start the motor control application (bit 12).

SpiFlashEn 

SPI flash enable (offset 10, bit 0).

SpiFlashCs 

SPI flash chip-select GPIO (bits 3-7).

SpiFlashFreq 

SPI flash divider: 40 MHz / (N + 1), N of 3 or more (bits 8-11).

I2cEepromEn 

I2C EEPROM enable (offset 12, bit 0).

I2cEepromSda 

I2C SDA pin select (bits 1-2).

I2cEepromScl 

I2C SCL pin select (bits 3-4).

I2cEepromAddr 

I2C EEPROM address bits (bits 5-7).

I2cEepromFreq 

I2C clock select (bits 8-10).

GpioOut 

Output level of GPIO 0 to 15 (offset 14).

GpioOutEn 

Output enable of GPIO 0 to 15 (offset 16).

GpioPullUp 

Pull-up of GPIO 0 to 15 (offset 18).

GpioPullDown 

Pull-down of GPIO 0 to 15 (offset 20).

Gpio16To18Out 

Output level of GPIO 16 to 18 (offset 22, bits 0-2).

Gpio16To18OutEn 

Output enable of GPIO 16 to 18 (bits 3-5).

Gpio16To18PullDown 

Pull-down of GPIO 16 to 18 (bits 6-8).

Gpio16To18PullUp 

Pull-up of GPIO 16 to 18 (bits 9-11).

GpioAnalog2To5 

Analog input of GPIO 2 to 5 (bits 12-15).

ClockReserved1 

Reserved, 99 (offset 24, bits 0-6).

ClockExtNotInt 

External clock instead of the internal oscillator (bit 8).

ClockXtalCfg 

Crystal configuration (bits 9-11).

ClockXtalBoost 

Crystal boost (bit 12).

ClockExtNotXtal 

External clock instead of a crystal (bit 13).

ClockPllOutSel 

System clock source: 0 oscillator, 1 PLL (bits 16-17).

ClockRdiv 

PLL input divider: input MHz minus one (bits 18-22).

ClockSysClkDiv 

System clock: 0 is 40 MHz, 3 is 15 MHz (bits 23-24).

HallEnable 

Hall sensor enable (offset 32, bit 0).

HallU 

Hall U pin select (bits 4-5).

HallV 

Hall V pin select (bits 6-7).

HallW 

Hall W pin select (bits 8-9).

Abn1Enable 

ABN encoder 1 enable (bit 1).

Abn1A 

ABN1 A pin select (bits 10-11).

Abn1B 

ABN1 B pin select (bits 12-13).

Abn1N 

ABN1 N pin select (bits 14-15).

RefL 

Left reference switch pin (offset 34, bits 0-1).

RefR 

Right reference switch pin (bits 2-3).

RefH 

Home switch pin (bits 4-6).

StepDirEnable 

STEP/DIR input enable (bit 8).

StepPin 

STEP pin select (bits 9-10).

DirPin 

DIR pin select (bit 11).

Abn2Enable 

ABN encoder 2 enable (bit 12).

Abn2A 

ABN2 A pin select (bit 13).

Abn2B 

ABN2 B pin select (bits 14-15; ambiguity A10).

BrakeChopperEnable 

Brake chopper enable (offset 36, bit 4).

BrakeChopperOutput 

Brake chopper output select (bits 5-9).

MechBrakeEnable 

Mechanical brake enable (bit 12).

MechBrakeOutput 

Mechanical brake output select (bits 13-14).

SpiEncEnable 

SPI encoder enable (offset 38, bit 0).

SpiEncBlock 

SPI encoder block (bit 1).

SpiEncMode 

SPI encoder mode (bits 2-3).

SpiEncFreq 

SPI encoder divider: 40 MHz / (N + 4) (bits 4-7).

SpiEncCsPin 

SPI encoder chip-select pin (bits 8-9).

MemTmclScript 

Script storage (offset 40, bits 0-1).

MemParameters 

Parameter storage (bits 2-3).

◆ GlobalBank

enum class tmc9660::GlobalBank : uint8_t
strong

Banks of global parameters.

Enumerator
System 

Bank 0: communication, I/O masks, heartbeat, power-down, auto start.

UserVars 

Bank 2: 16 user variables of the scripting feature.

Interrupts 

Bank 3: timers and trigger transitions.

◆ MemQuery

enum class tmc9660::MemQuery : uint8_t
strong

Queries about the external memory of the bootloader.

Enumerator
Configured 

MEM_IS_CONFIGURED.

Connected 

MEM_IS_CONNECTED.

Busy 

MEM_IS_BUSY.

◆ Param

enum class tmc9660::Param : uint16_t
strong

The axis parameters, by name; the value is the number sent as the TMCL type.

Enumerator
MOTOR_TYPE 

Selected motor type.

MOTOR_POLE_PAIRS 

Pole pair count of the motor.

MOTOR_DIRECTION 

Motor direction bit. Inverts the motor direction.

MOTOR_PWM_FREQUENCY 

Set the frequency of the motor PWM.

COMMUTATION_MODE 

Selected FOC operation mode depending on feedback used for commutation.

OUTPUT_VOLTAGE_LIMIT 

PID UQ/UD output limit for circular limiter.

MAX_TORQUE 

Maximum motor torque.

MAX_FLUX 

Max. motor flux.

PWM_SWITCHING_SCHEME 

PWM switching scheme.

IDLE_MOTOR_PWM_BEHAVIOR 

Configure if the PWM should be off (high-z) or on (all motor phases same voltage) in commutation.

ADC_SHUNT_TYPE 

Shunt type used for ADC measurements.

ADC_I0_RAW 

Raw ADC measurement of the ADC I0 shunt.

ADC_I1_RAW 

Raw ADC measurement of the ADC I1 shunt.

ADC_I2_RAW 

Raw ADC measurement of the ADC I2 shunt.

ADC_I3_RAW 

Raw ADC measurement of the ADC I3 shunt.

CSA_GAIN_ADC_I0_TO_ADC_I2 

Current sense amplifier gain for ADC I0, I1 and I2.

CSA_GAIN_ADC_I3 

Current sense amplifier gain for ADC I3.

CSA_FILTER_ADC_I0_TO_ADC_I2 

Current sense amplifier filter for ADC I0, I1 and I2.

CSA_FILTER_ADC_I3 

Current sense amplifier filter for ADC I3.

CURRENT_SCALING_FACTOR 

Current scaling factor converting internal units to real- world units.

PHASE_UX1_ADC_MAPPING 

Mapping ADC to UX1.

PHASE_VX2_ADC_MAPPING 

Mapping ADC to VX2.

PHASE_WY1_ADC_MAPPING 

Mapping ADC to WY1.

PHASE_Y2_ADC_MAPPING 

Mapping ADC to Y2.

ADC_I0_SCALE 

Scaling applied to ADC I0.

ADC_I1_SCALE 

Scaling applied to ADC I1.

ADC_I2_SCALE 

Scaling applied to ADC I2.

ADC_I3_SCALE 

Scaling applied to ADC I3.

ADC_I0_INVERTED 

Invert the reading of ADC I0.

ADC_I1_INVERTED 

Invert the reading of ADC I1.

ADC_I2_INVERTED 

Invert the reading of ADC I2.

ADC_I3_INVERTED 

Invert the reading of ADC I3.

ADC_I0_OFFSET 

Offset applied to ADC I0 measurement.

ADC_I1_OFFSET 

Offset applied to ADC I1 measurement.

ADC_I2_OFFSET 

Offset applied to ADC I2 measurement.

ADC_I3_OFFSET 

Offset applied to ADC I3 measurement.

ADC_I0 

Scaled and offset compensated ADC I0 measurement.

ADC_I1 

Scaled and offset compensated ADC I1 measurement.

ADC_I2 

Scaled and offset compensated ADC I2 measurement.

ADC_I3 

Scaled and offset compensated ADC I3 measurement.

OPENLOOP_ANGLE 

Phi_e calculated by the ramper hardware.

OPENLOOP_CURRENT 

Openloop current applied in openloop, current mode.

OPENLOOP_VOLTAGE 

Openloop voltage applied in openloop, voltage mode.

ACCELERATION_FF_GAIN 

Gain applied to acceleration feedforward.

ACCELERATION_FF_SHIFT 

Shift applied to acceleration feedforward.

RAMP_ENABLE 

Enable the application of acceleration and deceleration ramps.

DIRECT_VELOCITY_MODE 

Specify the control loop structure for velocity mode.

RAMP_AMAX 

Acceleration in top part of eight-point ramp.

RAMP_A1 

First acceleration in eight-point ramp.

RAMP_A2 

Second acceleration in eight-point ramp.

RAMP_DMAX 

Deceleration in top part of eight-point ramp.

RAMP_D1 

Second deceleration in eight-point ramp.

RAMP_D2 

First deceleration in eight-point ramp.

RAMP_VMAX 

Maximum velocity of eight-point ramp.

RAMP_V1 

Velocity threshold to switch from A1/D1 to A2/D2.

RAMP_V2 

Velocity threshold to switch from A2/D2 to AMAX/DMAX.

RAMP_VSTART 

Start velocity of ramp.

RAMP_VSTOP 

Stop velocity of ramp.

RAMP_TVMAX 

Minimum time at VMAX to start deceleration.

RAMP_TZEROWAIT 

Wait time at end of ramp to signal stop.

ACCELERATION_FEEDFORWARD_ENABLE 

Enable the acceleration feedforward feature.

VELOCITY_FEEDFORWARD_ENABLE 

Enable the velocity feedforward feature.

RAMP_VELOCITY 

Target velocity calculated by ramp controller.

RAMP_POSITION 

Target position calculated by ramp controller.

HALL_PHI_E 

Phi_e calculated from hall feedback.

HALL_SECTOR_OFFSET 

Hall sensor 60-degree/sector offset composed of 120 offset (order) and 180 degree offset (polari.

HALL_FILTER_LENGTH 

Filter length of the hall sensor input signal filters.

HALL_POSITION_0_OFFSET 

Hall offset compensation for 0 degree hall position.

HALL_POSITION_60_OFFSET 

Hall offset compensation for 60 degree hall position.

HALL_POSITION_120_OFFSET 

Hall offset compensation for 120 degree hall position.

HALL_POSITION_180_OFFSET 

Hall offset compensation for 180 degree hall position.

HALL_POSITION_240_OFFSET 

Hall offset compensation for 240 degree hall position.

HALL_POSITION_300_OFFSET 

Hall offset compensation for 300 degree hall position.

HALL_INVERT_DIRECTION 

Invert the hall angle direction.

HALL_EXTRAPOLATION_ENABLE 

Enable the hall extrapolation to generate a higher resolution position signal.

HALL_PHI_E_OFFSET 

Use this parameter to compensate hall sensor mounting tolerances.

ABN_1_PHI_E 

Phi_e calculated from abn feedback.

ABN_1_STEPS 

ABN 1 encoder steps per rotation (CPR).

ABN_1_DIRECTION 

ABN 1 encoder rotation direction.

ABN_1_INIT_METHOD 

Select an ABN encoder initialization method that fits best to your motor's sensors.

ABN_1_INIT_STATE 

Actual state of ABN encoder initialization.

ABN_1_INIT_DELAY 

When one of the "Forced phi_e" initialization methods is used, this value defines the wait time.

ABN_1_INIT_VELOCITY 

Init velocity for ABN encoder initialization with N- channel offset.

ABN_1_N_CHANNEL_PHI_E_OFFSET 

Offset between phi_e zero and the ABN encoders index pulse position.

ABN_1_N_CHANNEL_INVERTED 

ABN 1 encoder N-channel is inverted.

ABN_1_N_CHANNEL_FILTERING 

ABN 1 encoder N-channel filtering.

ABN_1_CLEAR_ON_NEXT_NULL 

Clear the actual position on the next ABN 1 encoder N- channel event.

ABN_1_VALUE 

Raw ABN encoder internal counter value.

TARGET_TORQUE 

Target torque value.

ACTUAL_TORQUE 

Actual motor torque value.

TARGET_FLUX 

Target flux value.

ACTUAL_FLUX 

Actual motor flux value.

TORQUE_OFFSET 

Offset applied to torque value.

TORQUE_P 

P parameter for torque PI regulator.

TORQUE_I 

I parameter for torque PI regulator.

FLUX_P 

P parameter for flux PI regulator.

FLUX_I 

I parameter for flux PI regulator.

SEPARATE_TORQUE_FLUX_PI_PARAMTERS 

Enable to configure separate PI values for the torque and flux current control loops.

CURRENT_NORM_P 

P parameter normalization format for current PI regulator.

CURRENT_NORM_I 

I parameter normalization format for current PI regulator.

TORQUE_PI_ERROR 

Torque PI regulator error.

FLUX_PI_ERROR 

Flux PI regulator error.

TORQUE_PI_INTEGRATOR 

Integrated error of torque PI regulator.

FLUX_PI_INTEGRATOR 

Integrated error of flux PI regulator.

FLUX_OFFSET 

Offset applied to flux value.

VELOCITY_SENSOR_SELECTION 

Feedback source for the velocity PI regulator.

TARGET_VELOCITY 

Target velocity value.

ACTUAL_VELOCITY 

Actual velocity value.

VELOCITY_OFFSET 

Offset applied to velocity value.

VELOCITY_P 

P parameter for velocity PI regulator.

VELOCITY_I 

I parameter for velocity PI regulator.

VELOCITY_NORM_P 

P parameter normalization format for velocity PI regulator.

VELOCITY_NORM_I 

I parameter normalization format for velocity PI regulator.

VELOCITY_PI_INTEGRATOR 

Integrated error of velocity PI regulator.

VELOCITY_PI_ERROR 

Velocity PI regulator error.

VELOCITY_SCALING_FACTOR 

Scaling factor to convert internal velocity to real-world units.

STOP_ON_VELOCITY_DEVIATION 

Maximum of velocity deviation tolerated before stop event is triggered (if activated).

VELOCITY_LOOP_DOWNSAMPLING 

Downsampling factor for velocity controller.

VELOCITY_REACHED_THRESHOLD 

Deviation between target and actual velocity below which the velocity reached flag goes active a.

VELOCITY_METER_SWITCH_THRESHOLD 

Velocity threshold switching from period to frequency velocity meter.

VELOCITY_METER_SWITCH_HYSTERESIS 

Velocity hysteresis for switching back from frequency to period velocity meter.

VELOCITY_METER_MODE 

Currently used velocity meter mode.

POSITION_SENSOR_SELECTION 

Feedback source for the position PI regulator.

TARGET_POSITION 

Target position value.

ACTUAL_POSITION 

Actual position value.

POSITION_SCALING_FACTOR 

Scaling factor to convert internal position to real-world units.

POSITION_P 

P parameter for position PI regulator.

POSITION_I 

I parameter for position PI regulator.

POSITION_NORM_P 

P parameter normalization format for position PI regulator.

POSITION_NORM_I 

I parameter normalization format for position PI regulator.

POSITION_PI_INTEGRATOR 

Integrated error of position PI regulator.

POSITION_PI_ERROR 

Error of position PI regulator.

STOP_ON_POSITION_DEVIATION 

Maximum of position deviation tolerated before stop event is triggered (if activated).

POSITION_LOOP_DOWNSAMPLING 

Downsampling factor for position controller.

LATCH_POSITION 

Position switch latched.

POSITION_LIMIT_LOW 

Position limit low.

POSITION_LIMIT_HIGH 

Position limit high.

POSITION_REACHED_THRESHOLD 

Deviation between target and actual position below which the position reached flag goes active a.

REFERENCE_SWITCH_ENABLE 

Bitwise enable for stopping when reference switch input is triggered.

REFERENCE_SWITCH_POLARITY_AND_SWAP 

Bitwise configuration of reference switch configuration.

REFERENCE_SWITCH_LATCH_SETTINGS 

Bitwise configuration of reference switch latch configuration.

EVENT_STOP_SETTINGS 

Bitwise configuration of stop configuration.

REFERENCE_SWITCH_SEARCH_MODE 

Determine the reference switch search sequence.

REFERENCE_SWITCH_SEARCH_SPEED 

Speed used for the reference switch search sequence.

REFERENCE_SWITCH_SPEED 

Lower speed used e.g. for positioning the motor at a reference switch position.

RIGHT_LIMIT_SWITCH_POSITION 

Right limit switch position.

HOME_SWITCH_POSITION 

Home switch position.

LAST_REFERENCE_POSITION 

Last reference position.

ABN_2_STEPS 

ABN 2 encoder steps per rotation (CPR).

ABN_2_DIRECTION 

ABN 2 encoder rotation direction.

ABN_2_GEAR_RATIO 

ABN 2 encoder gear ratio.

ABN_2_ENABLE 

Enable the ABN 2 encoder.

ABN_2_VALUE 

Raw ABN2 encoder internal counter value.

SPI_ENCODE_CS_SETTLE_DELAY_TIME 

Add a delay from CS going low to first SCLK edge.

SPI_ENCODER_CS_IDLE_DELAY_TIME 

Extend CS idle time between SPI message frames.

SPI_ENCODER_MAIN_TRANSFER_CMD_SIZE 

Size of the first SPI transfer frame.

SPI_ENCODER_SECONDARY_TRANSFER_CMD_SIZE 

Size of the optional secondary SPI transfer frame.

SPI_ENCODER_TRANSFER_DATA_3_0 

Used to set the transmit data and read out the received data.

SPI_ENCODER_TRANSFER_DATA_7_4 

Used to set the transmit data and read out the received data.

SPI_ENCODER_TRANSFER_DATA_11_8 

Used to set the transmit data and read out the received data.

SPI_ENCODER_TRANSFER_DATA_15_12 

Used to set the transmit data and read out the received data.

SPI_ENCODER_TRANSFER 

SPI interface setting, polarity and phase.

SPI_ENCODER_POSITION_COUNTER_MASK 

Mask to be used to collect the position counter value from the continuous received data.

SPI_ENCODER_POSITION_COUNTER_SHIFT 

Right bit shift for the position counter value before mask is applied.

SPI_ENCODER_POSITION_COUNTER_VALUE 

Actual SPI encoder position value.

SPI_ENCODER_COMMUTATION_ANGLE 

Actual absolute encoder angle value.

SPI_ENCODER_INITIALIZATION_METHOD 

Select the used absolute encoder initialization mode Forces the rotor into PHI_E zero using the.

SPI_ENCODER_DIRECTION 

SPI encoder direction.

SPI_ENCODER_OFFSET 

This value represents the internal commutation offset.

SPI_LUT_CORRECTION_ENABLE 

Enable the lookup table based encoder correction.

SPI_LUT_ADDRESS_SELECT 

Address to read or write the lookup table.

SPI_LUT_DATA 

Data to read or write to a lookup table address.

SPI_LUT_COMMON_SHIFT_FACTOR 

All LUT table entries are multiplied with 2^SHIFT_FACTOR to compensate for larger erros if neede.

STEP_DIR_STEP_DIVIDER_SHIFT 

Configure step/dir to use between 1 and 1024 microsteps per full step.

STEP_DIR_ENABLE 

Enable the Step/Dir input functionality.

STEP_DIR_EXTRAPOLATION_ENABLE 

Enable the Step/Dir extrapolation feature.

STEP_DIR_STEP_SIGNAL_TIMEOUT_LIMIT 

Step signal timeout limit.

STEP_DIR_MAXIMUM_EXTRAPOLATION_VELOCITY 

Maximum velocity up to which extrapolation is used.

BRAKE_CHOPPER_ENABLE 

Enable the brake chopper functionality.

BRAKE_CHOPPER_VOLTAGE_LIMIT 

If the brake chopper is enabled and supply voltage exceeds this value, the brake chopper output.

BRAKE_CHOPPER_HYSTERESIS 

An activated brake chopper is deactivated if the actual supply voltage is lower than BRAKE_CHOPP.

RELEASE_BRAKE 

Release the external brake by applying a PWM signal.

BRAKE_RELEASING_DUTY_CYCLE 

Set the duty cycle of the first PWM phase for releasing the brake.

BRAKE_HOLDING_DUTY_CYCLE 

Set the duty cycle of the second PWM phase to hold the brake.

BRAKE_RELEASING_DURATION 

Set the duration the brake PWM uses the first duty cycle.

INVERT_BRAKE_OUTPUT 

Invert the brake output.

THERMAL_WINDING_TIME_CONSTANT_1 

Thermal winding time constant for the used motor.

IIT_LIMIT_1 

An actual IIT sum that exceeds this limit leads to trigger the IIT_1_EXCEEDED.

IIT_SUM_1 

Actual sum of the IIT monitor 1.

THERMAL_WINDING_TIME_CONSTANT_2 

Thermal winding time constant for the used motor.

IIT_LIMIT_2 

An actual IIT sum that exceeds this limit leads to trigger the IIT_2_EXCEEDED.

IIT_SUM_2 

Actual sum of the IIT monitor 2.

RESET_IIT_SUMS 

Reset both IIT sums.

ACTUAL_TOTAL_MOTOR_CURRENT 

Total current through the motor windings.

PWM_L_OUTPUT_POLARITY 

PWM_L output polarity.

PWM_H_OUTPUT_POLARITY 

PWM_H output polarity.

BREAK_BEFORE_MAKE_TIME_LOW_UVW 

Break before make time for the low side gates of the UVW phases.

BREAK_BEFORE_MAKE_TIME_HIGH_UVW 

Break before make time for the high side gates of the UVW phases.

BREAK_BEFORE_MAKE_TIME_LOW_Y2 

Break before make time for the low side gate of the Y2 phase.

BREAK_BEFORE_MAKE_TIME_HIGH_Y2 

Break before make time for the high side gate of the Y2 phase.

USE_ADAPTIVE_DRIVE_TIME_UVW 

If enabled, the discharge cycle of the low- and high-side gates for the UVW phases is shortened.

USE_ADAPTIVE_DRIVE_TIME_Y2 

If enabled, the discharge cycle of the low- and high-side gates for the Y2 phase is shortened by.

DRIVE_TIME_SINK_UVW 

Discharge time for the low and high side gates of the UVW phases.

DRIVE_TIME_SOURCE_UVW 

Charge time for the low and high side gates of the UVW phases.

DRIVE_TIME_SINK_Y2 

Discharge time for the low and high side gates of the Y2 phase.

DRIVE_TIME_SOURCE_Y2 

Charge time for the low and high side gates of the Y2 phase.

UVW_SINK_CURRENT 

Limit the maximum sink current for the low and high side gates of the UVW phases.

UVW_SOURCE_CURRENT 

Limit the maximum source current for the low and high side gates of the UVW phases.

Y2_SINK_CURRENT 

Limit the maximum sink current for the low and high side gates of the Y2 phase.

Y2_SOURCE_CURRENT 

Limit the maximum source current for the low and high side gates of the Y2 phase.

BOOTSTRAP_CURRENT_LIMIT 

Bootstrap current limit.

UNDERVOLTAGE_PROTECTION_SUPPLY_LEVEL 

Undervoltage protection level for VS (Supply voltage). 0 disables the comparator.

UNDERVOLTAGE_PROTECTION_VDRV_ENABLE 

Enable the undervoltage protection for VDRV (Driver voltage).

UNDERVOLTAGE_PROTECTION_BST_UVW_ENABLE 

Enable the undervoltage protection on the bootstrap capacitor of the UVW phases.

UNDERVOLTAGE_PROTECTION_BST_Y2_ENABLE 

Enable the undervoltage protection on the bootstrap capacitor of the Y2 phase.

OVERCURRENT_PROTECTION_UVW_LOW_SIDE_ENABLE 

Enable the overcurrent protection on the low side of the UVW phases.

OVERCURRENT_PROTECTION_UVW_HIGH_SIDE_ENABLE 

Enable the overcurrent protection on the high side of the UVW phases.

OVERCURRENT_PROTECTION_Y2_LOW_SIDE_ENABLE 

Enable the overcurrent protection on the low side of the Y2 phase.

OVERCURRENT_PROTECTION_Y2_HIGH_SIDE_ENABLE 

Enable the overcurrent protection on the high side of the Y2 phase.

OVERCURRENT_PROTECTION_UVW_LOW_SIDE_THRESHOLD 

Overcurrent protection threshold for the low side of the UVW phases (uses second list if OVERCUR.

OVERCURRENT_PROTECTION_UVW_HIGH_SIDE_THRESHOLD 

Overcurrent protection threshold for the high side of the UVW phases.

OVERCURRENT_PROTECTION_Y2_LOW_SIDE_THRESHOLD 

Overcurrent protection threshold for the low side of the Y2 phase (uses second list if OVERCURRE.

OVERCURRENT_PROTECTION_Y2_HIGH_SIDE_THRESHOLD 

Overcurrent protection threshold for the high side of the Y2 phase.

OVERCURRENT_PROTECTION_UVW_LOW_SIDE_BLANKING 

Overcurrent protection blanking time for the low side of the UVW phases.

OVERCURRENT_PROTECTION_UVW_HIGH_SIDE_BLANKING 

Overcurrent protection blanking time for the high side of the UVW phases.

OVERCURRENT_PROTECTION_Y2_LOW_SIDE_BLANKING 

Overcurrent protection blanking time for the low side of the Y2 phase.

OVERCURRENT_PROTECTION_Y2_HIGH_SIDE_BLANKING 

Overcurrent protection blanking time for the high side of the Y2 phase.

OVERCURRENT_PROTECTION_UVW_LOW_SIDE_DEGLITCH 

Overcurrent protection deglitch time for the low side of the UVW phases.

OVERCURRENT_PROTECTION_UVW_HIGH_SIDE_DEGLITCH 

Overcurrent protection deglitch time for the high side of the UVW phases.

OVERCURRENT_PROTECTION_Y2_LOW_SIDE_DEGLITCH 

Overcurrent protection deglitch time for the low side of the Y2 phase.

OVERCURRENT_PROTECTION_Y2_HIGH_SIDE_DEGLITCH 

Overcurrent protection deglitch time for the high side of the Y2 phase.

OVERCURRENT_PROTECTION_UVW_LOW_SIDE_USE_VDS 

Use the VDS measurement for the overcurrent protection on the low side of the UVW phases.

OVERCURRENT_PROTECTION_Y2_LOW_SIDE_USE_VDS 

Use the VDS measurement for the overcurrent protection on the low side of the Y2 phase.

VGS_SHORT_ON_PROTECTION_UVW_LOW_SIDE_ENABLE 

Enable the gate-source short protection for the ON transition of the low side of the UVW phases.

VGS_SHORT_OFF_PROTECTION_UVW_LOW_SIDE_ENABLE 

Enable the gate-source short protection for the OFF transition of the low side of the UVW phases.

VGS_SHORT_ON_PROTECTION_UVW_HIGH_SIDE_ENABLE 

Enable the gate-source short protection for the ON transition of the high side of the UVW phases.

VGS_SHORT_OFF_PROTECTION_UVW_HIGH_SIDE_ENABLE 

Enable the gate-source short protection for the OFF transition of the high side of the UVW phase.

VGS_SHORT_ON_PROTECTION_Y2_LOW_SIDE_ENABLE 

Enable the gate-source short protection for the ON transition of the low side of the Y2 phase.

VGS_SHORT_OFF_PROTECTION_Y2_LOW_SIDE_ENABLE 

Enable the gate-source short protection for the OFF transition of the low side of the Y2 phase.

VGS_SHORT_ON_PROTECTION_Y2_HIGH_SIDE_ENABLE 

Enable the gate-source short protection for the ON transition of the high side of the Y2 phase.

VGS_SHORT_OFF_PROTECTION_Y2_HIGH_SIDE_ENABLE 

Enable the gate-source short protection for the OFF transition of the high side of the Y2 phase.

VGS_SHORT_PROTECTION_UVW_BLANKING 

Gate-source short protection blanking time for the low and high sides of the UVW phases.

VGS_SHORT_PROTECTION_Y2_BLANKING 

Gate-source short protection blanking time for the low and high sides of the Y2 phase.

VGS_SHORT_PROTECTION_UVW_DEGLITCH 

Gate-source short protection deglitch time for the low and high sides of the UVW phases.

VGS_SHORT_PROTECTION_Y2_DEGLITCH 

Gate-source short protection deglitch time for low and high sides of the Y2 phase.

GDRV_RETRY_BEHAVIOUR 

This value defines the state the system goes to after a fault condition on a motor phase occurs.

DRIVE_FAULT_BEHAVIOUR 

This value defines the state the system goes to after a fault condition on a motor phase occurs.

FAULT_HANDLER_NUMBER_OF_RETRIES 

Maximum number of retries that are performed for every fault that is detected.

GENERAL_STATUS_FLAGS 

Actual status flags.

SUPPLY_VOLTAGE 

The actual supply voltage.

SUPPLY_OVERVOLTAGE_WARNING_THRESHOLD 

The supply overvoltage warning threshold.

SUPPLY_UNDERVOLTAGE_WARNING_THRESHOLD 

The supply undervoltage warning threshold.

EXTERNAL_TEMPERATURE 

The actual temperature at the external temperature sensor.

EXTERNAL_TEMPERATURE_SHUTDOWN_THRESHOLD 

The temperature threshold at which the motor driver is shut down.

EXTERNAL_TEMPERATURE_WARNING_THRESHOLD 

The temperature threshold above which the warning flag is set.

CHIP_TEMPERATURE 

The actual temperature of the chip.

CHIP_TEMPERATURE_SHUTDOWN_THRESHOLD 

The temperature threshold at which the motor driver is shut down.

CHIP_TEMPERATURE_WARNING_THRESHOLD 

The temperature threshold above which the warning flag is set.

GENERAL_ERROR_FLAGS 

Actual error flags.

GDRV_ERROR_FLAGS 

Gate driver error flags.

ADC_STATUS_FLAGS 

ADC channel clipped.

MCC_INPUTS_RAW 

Raw inputs for ABN, hall, reference switches, driver enabled, hall filtered and ABN2 or Step/Dir.

FOC_VOLTAGE_UX 

Interim result of the FOC for phase U (X in case of motor type is a stepper motor).

FOC_VOLTAGE_WY 

Interim result of the FOC for phase W (Y in case of motor type is a stepper motor).

FOC_VOLTAGE_V 

Interim result of the FOC for phase V (BLDC motor only).

FIELDWEAKENING_I 

I parameter for field weakening controller.

FIELDWEAKENING_VOLTAGE_THRESHOLD 

Maximum motor voltage allowed for field weakening.

FOC_CURRENT_UX 

Interim measurement of the FOC for phase UX.

FOC_CURRENT_V 

Interim measurement of the FOC for phase V.

FOC_CURRENT_WY 

Interim measurement of the FOC for phase WY.

FOC_VOLTAGE_UQ 

Interim measurement of the FOC for Uq.

FOC_CURRENT_IQ 

Interim measurement of the FOC for Iq.

TARGET_TORQUE_BIQUAD_FILTER_ENABLE 

Enable the target torque biquad filter.

TARGET_TORQUE_BIQUAD_FILTER_ACOEFF_1 

Target torque biquad filter aCoeff_1.

TARGET_TORQUE_BIQUAD_FILTER_ACOEFF_2 

Target torque biquad filter aCoeff_2.

TARGET_TORQUE_BIQUAD_FILTER_BCOEFF_0 

Target torque biquad filter bCoeff_0.

TARGET_TORQUE_BIQUAD_FILTER_BCOEFF_1 

Target torque biquad filter bCoeff_1.

TARGET_TORQUE_BIQUAD_FILTER_BCOEFF_2 

Target torque biquad filter bCoeff_2.

ACTUAL_VELOCITY_BIQUAD_FILTER_ENABLE 

Enable the actual velocity biquad filter.

ACTUAL_VELOCITY_BIQUAD_FILTER_ACOEFF_1 

Actual velocity biquad filter aCoeff_1.

ACTUAL_VELOCITY_BIQUAD_FILTER_ACOEFF_2 

Actual velocity biquad filter aCoeff_2.

ACTUAL_VELOCITY_BIQUAD_FILTER_BCOEFF_0 

Actual velocity biquad filter bCoeff_0.

ACTUAL_VELOCITY_BIQUAD_FILTER_BCOEFF_1 

Actual velocity biquad filter bCoeff_1.

ACTUAL_VELOCITY_BIQUAD_FILTER_BCOEFF_2 

Actual velocity biquad filter bCoeff_2.

TORQUE_FLUX_COMBINED_TARGET_VALUES 

Raw (unscaled) torque and flux target values combined into one 32 bit value.

TORQUE_FLUX_COMBINED_ACTUAL_VALUES 

Raw (unscaled) torque and flux actual values combined into one 32 bit value.

VOLTAGE_D_Q_COMBINED_ACTUAL_VALUES 

Raw (unscaled) voltage actual values combined into one 32 bit value.

INTEGRATED_ACTUAL_TORQUE_VALUE 

Periodically summed up actual torque value.

INTEGRATED_ACTUAL_VELOCITY_VALUE 

Periodically summed up actual velocity value.

◆ PowerDownTime

enum class tmc9660::PowerDownTime : uint8_t
strong

Power-down durations of TMC9660::PowerDown() (global parameter 11).

Enumerator
Ms250 

250 ms.

Ms500 

500 ms.

S1 

1 s.

S2 

2 s.

S4 

4 s.

S8 

8 s.

S16 

16 s.

S32 

32 s.

Function Documentation

◆ BuildPartitionTable()

constexpr Result< std::size_t > tmc9660::BuildPartitionTable ( std::span< const PartitionEntry >  entries,
uint8_t  size_index,
uint8_t  sector_index,
std::span< uint8_t >  out 
)
constexprnoexcept

Build a partition table (datasheet Tables 21 and 22): header, entries, CRC-32 over the bytes from the magic number on.

Parameters
entriesThe partitions.
size_indexMemory size is 2^size_index bytes, 0 if unknown (at most 31).
sector_indexErase sector size is 2^sector_index bytes, 0 if unknown (at most 31).
outReceives the table; must hold 16 + 24 * entries.size() bytes.
Returns
The table size, or Error::InvalidArgument when an entry is invalid (type not 2 or 4, size not a multiple of the sector size, parameter partition under 0x400 bytes, offset or size not sector aligned, overlap) or out is too small. Nothing is written on error.

◆ FindGlobal()

constexpr const GlobalInfo * tmc9660::FindGlobal ( uint8_t  bank,
uint32_t  number 
)
constexprnoexcept

The row of a global parameter.

Parameters
bankThe bank number (0, 2 or 3).
numberThe parameter number in the bank.
Returns
The row, or nullptr when the manual lists none.

◆ FindParam()

constexpr const ParamInfo * tmc9660::FindParam ( uint32_t  id)
constexprnoexcept

The table row of an axis parameter.

Parameters
idThe parameter number.
Returns
The row, or nullptr when the manual lists no such parameter.

◆ FindRegister()

constexpr const RegInfo * tmc9660::FindRegister ( RegAddr  addr)
constexprnoexcept

The map row of a register.

Parameters
addrThe register.
Returns
The row, or nullptr when the manual lists none at that address.

◆ KconfigDefaults()

constexpr Config tmc9660::KconfigDefaults ( )
constexprnoexcept

The configuration menuconfig selected, on top of the Config{} defaults.

Returns
Config{} with the mode, device address, boot timeout, reset and canary options from Kconfig.

Variable Documentation

◆ kAllowedValues

constexpr std::array<int32_t, 513> tmc9660::kAllowedValues
inlineconstexpr
Initial value:
{
0, 1, 2, 3, 0, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 0, 1, 2, 0, 1, 0, 1, 2, 3,
4, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0,
1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 2, 3, 4,
5, 6, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 2, 3, 4, 5, 0, 1, 0, 1, 0, 1, 0, 1,
2, 3, 0, 1, 2, 3, 0, 1, 0, 1, 2, 3, 4, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 2,
3, 4, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 0, 1, 2, 3, 4, 0, 1, 2, 3, 0, 1,
2, 3, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
14, 15, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 3, 4, 5,
6, 7, 1, 2, 3, 4, 5, 6, 7, 8, 0, 1, 0, 1, 0, 1, 2, 0, 1, 2, 0, 1, 0, 1,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0,
1, 0, 1, 0, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2,
3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
11, 12, 13, 14, 15, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2,
3, 4, 5, 6, 7, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 2, 3, 4,
5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
13, 14, 15, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 3, 4,
5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4,
5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4,
5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4,
5, 6, 7, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0,
1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0,
1, 0, 1, 2, 3, 0, 1, 0, 1,
}

Every value a coded parameter accepts, concatenated.

◆ kTurnaroundUs

constexpr uint32_t tmc9660::kTurnaroundUs = 1'000
inlineconstexpr

Assumed longest time from the last request byte to the first reply byte, in microseconds. The manuals give no bound (ambiguity A19); the chip adds UART_TXEN_PRE_DELAY only when UART_TXEN is used. A port sets its reply timeout above this value plus the frame time.