TMC9660 Driver 0.1.0
API reference
Loading...
Searching...
No Matches
Classes | Enumerations | Functions | Variables
Driver types

Errors, results, protocol enumerations and configuration. More...

Classes

struct  tmc9660::Result< T >
 The value of a call, or why there is none. More...
 
struct  tmc9660::Result< void >
 The result of a call that returns no value. More...
 
struct  tmc9660::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  tmc9660::Config
 Configuration of the driver. The defaults are the chip's. More...
 
class  tmc9660::CheckedConfig
 A configuration proven valid at build time. More...
 

Enumerations

enum class  tmc9660::Error : uint8_t {
  tmc9660::Error::Ok = 0 , tmc9660::Error::NotInitialized = 1 , tmc9660::Error::InvalidArgument = 2 , tmc9660::Error::Bus = 3 ,
  tmc9660::Error::Timeout = 4 , tmc9660::Error::DeviceIdMismatch , tmc9660::Error::Crc = 6 , tmc9660::Error::Busy = 7 ,
  tmc9660::Error::DeviceFault = 8 , tmc9660::Error::Unsupported = 9 , tmc9660::Error::UnexpectedReset , tmc9660::Error::Nack = 17 ,
  tmc9660::Error::WrongMode = 18 , tmc9660::Error::Refused = 19 , tmc9660::Error::VerifyFailed = 20 , tmc9660::Error::BadReply = 21
}
 Why a call failed. Every call of the driver returns one of these in its Result. More...
 
enum class  tmc9660::LogLevel : uint8_t { tmc9660::LogLevel::Error = 0 , tmc9660::LogLevel::Warning , tmc9660::LogLevel::Info , tmc9660::LogLevel::Debug }
 Severity passed to the optional Log() hook. More...
 
enum class  tmc9660::BusStatus : uint8_t { tmc9660::BusStatus::Ok = 0 , tmc9660::BusStatus::Fault , tmc9660::BusStatus::Timeout }
 What a UART port reports for one exchange. More...
 
enum class  tmc9660::CtrlPin : uint8_t { tmc9660::CtrlPin::Reset = 0 , tmc9660::CtrlPin::DrvEn , tmc9660::CtrlPin::Wake , tmc9660::CtrlPin::Faultn }
 The control pins of the chip that the optional GpioSet() and GpioGet() hooks may drive. More...
 
enum class  tmc9660::GpioSignal : uint8_t { tmc9660::GpioSignal::INACTIVE = 0 , tmc9660::GpioSignal::ACTIVE = 1 }
 Logical level of a control pin; the port maps it to the physical polarity. More...
 
enum class  tmc9660::Mode : uint8_t { tmc9660::Mode::Bootloader = 0 , tmc9660::Mode::Parameter = 1 , tmc9660::Mode::Register = 2 }
 The protocol the chip speaks on its host interface. More...
 
enum class  tmc9660::BootMode : uint8_t { tmc9660::BootMode::Reserved , tmc9660::BootMode::Register = 1 , tmc9660::BootMode::Parameter = 2 , tmc9660::BootMode::Reserved3 = 3 }
 BOOT_MODE of the boot configuration (offset 8, bits 0-1). More...
 
enum class  tmc9660::Bank : uint8_t { tmc9660::Bank::SpiFlash = 1 , tmc9660::Bank::I2cEeprom = 2 , tmc9660::Bank::Otp = 3 , tmc9660::Bank::Config = 5 }
 External memory banks of the bootloader (SET_BANK). More...
 
enum class  tmc9660::BlInfo : uint8_t {
  tmc9660::BlInfo::ChipType = 0 , tmc9660::BlInfo::BlVersion = 1 , tmc9660::BlInfo::Features = 2 , tmc9660::BlInfo::GitInfo = 12 ,
  tmc9660::BlInfo::ChipVersion = 13 , tmc9660::BlInfo::ChipFrequency = 14 , tmc9660::BlInfo::ConfigMemStart = 17 , tmc9660::BlInfo::ConfigMemSize = 18 ,
  tmc9660::BlInfo::OtpMemSize = 19 , tmc9660::BlInfo::I2cMemSize = 20 , tmc9660::BlInfo::SpiMemSize = 21 , tmc9660::BlInfo::PartitionVersion = 22 ,
  tmc9660::BlInfo::SpiMemPartitions = 25 , tmc9660::BlInfo::I2cMemPartitions = 26 , tmc9660::BlInfo::ChipVariant = 28
}
 GET_INFO selectors of the bootloader. More...
 
enum class  tmc9660::BlStatus : uint8_t {
  tmc9660::BlStatus::Ok = 0 , tmc9660::BlStatus::CmdNotFound = 1 , tmc9660::BlStatus::InvalidAddr = 3 , tmc9660::BlStatus::InvalidValue = 4 ,
  tmc9660::BlStatus::InvalidBank = 14 , tmc9660::BlStatus::Busy = 15 , tmc9660::BlStatus::MemUnconfigured = 17 , tmc9660::BlStatus::OtpError = 18 ,
  tmc9660::BlStatus::SessionStart = 19 , tmc9660::BlStatus::CmdNotAvailable = 20 , tmc9660::BlStatus::BootloaderResumed = 21
}
 Bootloader reply status codes (datasheet bootloader chapter). More...
 
enum class  tmc9660::BlCmd : uint8_t {
  tmc9660::BlCmd::GetInfo = 0 , tmc9660::BlCmd::GetBank = 8 , tmc9660::BlCmd::SetBank = 9 , tmc9660::BlCmd::GetAddress = 10 ,
  tmc9660::BlCmd::SetAddress = 11 , tmc9660::BlCmd::Read32 = 12 , tmc9660::BlCmd::Read32Inc = 13 , tmc9660::BlCmd::Read16 = 14 ,
  tmc9660::BlCmd::Read16Inc = 15 , tmc9660::BlCmd::Read8 = 16 , tmc9660::BlCmd::Read8Inc = 17 , tmc9660::BlCmd::Write32 = 18 ,
  tmc9660::BlCmd::Write32Inc = 19 , tmc9660::BlCmd::Write16 = 20 , tmc9660::BlCmd::Write16Inc = 21 , tmc9660::BlCmd::Write8 = 22 ,
  tmc9660::BlCmd::Write8Inc = 23 , tmc9660::BlCmd::NoOp = 29 , tmc9660::BlCmd::OtpLoad = 30 , tmc9660::BlCmd::OtpBurn = 31 ,
  tmc9660::BlCmd::MemIsConfigured = 32 , tmc9660::BlCmd::MemIsConnected = 33 , tmc9660::BlCmd::FlashSendCmd = 36 , tmc9660::BlCmd::FlashEraseSector = 37 ,
  tmc9660::BlCmd::MemIsBusy = 40 , tmc9660::BlCmd::BootstrapRs485 = 255
}
 Bootloader command codes. More...
 
enum class  tmc9660::Tmcl : uint8_t {
  tmc9660::Tmcl::Mst = 3 , tmc9660::Tmcl::Sap = 5 , tmc9660::Tmcl::Gap = 6 , tmc9660::Tmcl::Stap = 7 ,
  tmc9660::Tmcl::Sgp = 9 , tmc9660::Tmcl::Ggp = 10 , tmc9660::Tmcl::Rfs = 13 , tmc9660::Tmcl::Sio = 14 ,
  tmc9660::Tmcl::Gio = 15 , tmc9660::Tmcl::Calc = 19 , tmc9660::Tmcl::Comp = 20 , tmc9660::Tmcl::Jc = 21 ,
  tmc9660::Tmcl::Ja = 22 , tmc9660::Tmcl::Csub = 23 , tmc9660::Tmcl::Rsub = 24 , tmc9660::Tmcl::Ei = 25 ,
  tmc9660::Tmcl::Di = 26 , tmc9660::Tmcl::Wait = 27 , tmc9660::Tmcl::Stop = 28 , tmc9660::Tmcl::Calcx = 33 ,
  tmc9660::Tmcl::Aap = 34 , tmc9660::Tmcl::Agp = 35 , tmc9660::Tmcl::Cle = 36 , tmc9660::Tmcl::Vect = 37 ,
  tmc9660::Tmcl::Reti = 38 , tmc9660::Tmcl::Calcvv = 40 , tmc9660::Tmcl::Calcva = 41 , tmc9660::Tmcl::Calcav = 42 ,
  tmc9660::Tmcl::Calcvx = 43 , tmc9660::Tmcl::Calcxv = 44 , tmc9660::Tmcl::Calcv = 45 , tmc9660::Tmcl::Rst = 48 ,
  tmc9660::Tmcl::Djnz = 49 , tmc9660::Tmcl::Siv = 55 , tmc9660::Tmcl::Giv = 56 , tmc9660::Tmcl::Aiv = 57 ,
  tmc9660::Tmcl::ApplStop = 128 , tmc9660::Tmcl::ApplRun = 129 , tmc9660::Tmcl::ApplStep = 130 , tmc9660::Tmcl::ApplReset = 131 ,
  tmc9660::Tmcl::DownloadStart = 132 , tmc9660::Tmcl::DownloadEnd = 133 , tmc9660::Tmcl::ReadMem = 134 , tmc9660::Tmcl::GetStatus = 135 ,
  tmc9660::Tmcl::GetVersion = 136 , tmc9660::Tmcl::FactoryDefault = 137 , tmc9660::Tmcl::Breakpoint = 141 , tmc9660::Tmcl::RamDebug = 142 ,
  tmc9660::Tmcl::GetInfo = 157 , tmc9660::Tmcl::Boot = 242
}
 TMCL operation codes (Table 18 of the parameter mode manual). More...
 
enum class  tmc9660::TmclStatus : uint8_t {
  tmc9660::TmclStatus::Ok = 100 , tmc9660::TmclStatus::CmdLoaded = 101 , tmc9660::TmclStatus::ChecksumError = 1 , tmc9660::TmclStatus::InvalidCommand = 2 ,
  tmc9660::TmclStatus::WrongType = 3 , tmc9660::TmclStatus::InvalidValue = 4 , tmc9660::TmclStatus::CmdNotAvailable = 6 , tmc9660::TmclStatus::CmdLoadError = 7 ,
  tmc9660::TmclStatus::MaxExceeded = 9 , tmc9660::TmclStatus::DownloadNotPossible = 10
}
 TMCL reply status codes (Table 19). More...
 
enum class  tmc9660::TmclSpiStatus : uint8_t { tmc9660::TmclSpiStatus::Ok = 0xFF , tmc9660::TmclSpiStatus::ChecksumError = 0x00 , tmc9660::TmclSpiStatus::FirstCommand = 0x0C , tmc9660::TmclSpiStatus::NotReady = 0xF0 }
 SPI status byte of a TMCL reply. More...
 
enum class  tmc9660::RamDebugType : uint8_t {
  tmc9660::RamDebugType::Init = 0 , tmc9660::RamDebugType::SampleCount = 1 , tmc9660::RamDebugType::Prescaler = 3 , tmc9660::RamDebugType::SetChannel = 4 ,
  tmc9660::RamDebugType::SetTriggerChannel = 5 , tmc9660::RamDebugType::TriggerMaskShift = 6 , tmc9660::RamDebugType::EnableTrigger = 7 , tmc9660::RamDebugType::GetState = 8 ,
  tmc9660::RamDebugType::ReadSample = 9 , tmc9660::RamDebugType::GetInfo = 10 , tmc9660::RamDebugType::GetChannelType = 11 , tmc9660::RamDebugType::GetChannelAddress = 12 ,
  tmc9660::RamDebugType::SetPretrigger = 13 , tmc9660::RamDebugType::GetPretrigger = 14
}
 RAMDebug types (Table 16). More...
 
enum class  tmc9660::ReferenceSearch : uint8_t { tmc9660::ReferenceSearch::Start = 0 , tmc9660::ReferenceSearch::Stop = 1 , tmc9660::ReferenceSearch::Status = 2 }
 RFS sub-commands. More...
 
enum class  tmc9660::TmclLayout : uint8_t { tmc9660::TmclLayout::Auto = 0 , tmc9660::TmclLayout::MotorHigh , tmc9660::TmclLayout::TypeHigh }
 Where the type and the motor or bank bytes of a TMCL frame put their bits (ambiguity A2). More...
 

Functions

constexpr const char * tmc9660::ToString (Error error) noexcept
 The name of an error, for logs.
 
constexpr Error tmc9660::Validate (const Config &c) noexcept
 Check a Config without touching the bus.
 
void tmc9660::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 * tmc9660::GetDriverVersion () noexcept
 
constexpr uint32_t tmc9660::GetDriverVersionMajor () noexcept
 
constexpr uint32_t tmc9660::GetDriverVersionMinor () noexcept
 
constexpr uint32_t tmc9660::GetDriverVersionPatch () noexcept
 

Variables

constexpr int32_t tmc9660::kSystemOff = 0
 Value of COMMUTATION_MODE (parameter 4) that leaves the gate driver off.
 
constexpr int32_t tmc9660::kCommutationModeMax = 8
 The largest valid COMMUTATION_MODE value.
 
constexpr uint32_t tmc9660::kChipId = 0x544D0001U
 The chip ID every TMC9660 reports (bootloader CHIP_TYPE, register MCC_INFO_CHIP).
 
constexpr uint32_t tmc9660::kMotorControlClockHz = 40'000'000U
 The system clock motor control needs, in Hz.
 
constexpr uint32_t tmc9660::kBootMagic = 0xA3B4C5D6U
 The magic value of the Boot command.
 

Detailed Description

Errors, results, protocol enumerations and configuration.

Enumeration Type Documentation

◆ Bank

enum class tmc9660::Bank : uint8_t
strong

External memory banks of the bootloader (SET_BANK).

Enumerator
SpiFlash 

External SPI flash.

I2cEeprom 

External I2C EEPROM.

Otp 

One-time programmable memory.

Config 

The 64-byte configuration memory at 0x00020000.

◆ BlCmd

enum class tmc9660::BlCmd : uint8_t
strong

Bootloader command codes.

Enumerator
GetInfo 

Read an information value.

GetBank 

Read the current memory bank.

SetBank 

Select a memory bank.

GetAddress 

Read the current memory address.

SetAddress 

Set the memory address.

Read32 

Read 32 bits.

Read32Inc 

Read 32 bits, then increment the address.

Read16 

Read 16 bits.

Read16Inc 

Read 16 bits, then increment.

Read8 

Read 8 bits.

Read8Inc 

Read 8 bits, then increment.

Write32 

Write 32 bits.

Write32Inc 

Write 32 bits, then increment.

Write16 

Write 16 bits.

Write16Inc 

Write 16 bits, then increment.

Write8 

Write 8 bits.

Write8Inc 

Write 8 bits, then increment.

NoOp 

Retrieve a reply (SPI).

OtpLoad 

Load the OTP configuration.

OtpBurn 

Permanent: not exposed by the driver.

MemIsConfigured 

Is the selected external memory configured.

MemIsConnected 

Is the selected external memory connected.

FlashSendCmd 

Raw flash command: not exposed by the driver.

FlashEraseSector 

Erase one flash sector.

MemIsBusy 

Is the external memory busy.

BootstrapRs485 

RS485 bootstrap: must be the first command.

◆ BlInfo

enum class tmc9660::BlInfo : uint8_t
strong

GET_INFO selectors of the bootloader.

Enumerator
ChipType 

0x544D0001.

BlVersion 

Bootloader version.

Features 

Feature bits.

GitInfo 

Git revision of the bootloader.

ChipVersion 

Silicon version.

ChipFrequency 

System clock in Hz.

ConfigMemStart 

Start address of the configuration memory.

ConfigMemSize 

Size of the configuration memory in bytes.

OtpMemSize 

Size of the OTP memory.

I2cMemSize 

Size of the I2C memory.

SpiMemSize 

Size of the SPI flash.

PartitionVersion 

Partition table version.

SpiMemPartitions 

Partitions in the SPI flash.

I2cMemPartitions 

Partitions in the I2C memory.

ChipVariant 

Chip variant (2).

◆ BlStatus

enum class tmc9660::BlStatus : uint8_t
strong

Bootloader reply status codes (datasheet bootloader chapter).

Enumerator
Ok 

Success.

CmdNotFound 

Unknown command.

InvalidAddr 

Address not valid.

InvalidValue 

Value not valid.

InvalidBank 

Bank not valid.

Busy 

SPI only: the reply is not ready.

MemUnconfigured 

External memory not configured.

OtpError 

SPI only: OTP error.

SessionStart 

First reply of a session; the value is the version.

CmdNotAvailable 

Command not available.

BootloaderResumed 

SPI only: the bootloader restarted.

◆ BootMode

enum class tmc9660::BootMode : uint8_t
strong

BOOT_MODE of the boot configuration (offset 8, bits 0-1).

Enumerator
Reserved 

The hardware default: no application. The driver never starts the application with it.

Register 

Register mode.

Parameter 

Parameter mode.

Reserved3 

Reserved.

◆ BusStatus

enum class tmc9660::BusStatus : uint8_t
strong

What a UART port reports for one exchange.

Enumerator
Ok 

The bytes were sent and the expected reply was received.

Fault 

The UART failed (framing, overrun, driver error).

Timeout 

The reply did not arrive in time.

◆ CtrlPin

enum class tmc9660::CtrlPin : uint8_t
strong

The control pins of the chip that the optional GpioSet() and GpioGet() hooks may drive.

Enumerator
Reset 

RSTN, active low on the package pin; ACTIVE holds the chip in reset.

DrvEn 

DRV_EN, active high on the package pin; ACTIVE allows the gate-driver outputs.

Wake 

WAKE, the wake-up pin (ACTIVE: the application's wake condition is asserted).

Faultn 

FAULTN, an input; GpioGet reports the pin level (low: asserted).

◆ Error

enum class tmc9660::Error : uint8_t
strong

Why a call failed. Every call of the driver returns one of these in its Result.

Values 0 to 9 are the shared base set; chip-specific values start at 16. [[nodiscard]] on the type: a function that returns a bare Error cannot have it ignored either (KB-CPP20-037).

Enumerator
Ok 

The call succeeded.

NotInitialized 

EnsureInitialized() has not succeeded, or Deinitialize() or a detected reset ran since.

InvalidArgument 

An argument or a Config field is out of range; nothing was sent.

Bus 

A port hook returned false or BusStatus::Fault.

Timeout 

No reply, or the chip did not become ready in the allowed time.

DeviceIdMismatch 

The chip ID is not the TMC9660's: wrong chip, no chip or a wiring fault.

Crc 

The bootloader UART CRC-8 of a reply did not match.

Busy 

The chip answered BUSY and the retries ran out.

DeviceFault 

A latched error flag forbids the call (gate driver or general error flags).

Unsupported 

The hook or silicon feature this call needs is absent.

UnexpectedReset 

The chip reset since the last validated reply; the driver is uninitialised.

Nack 

The chip answered with an error status; see LastStatus().

WrongMode 

The call belongs to another mode than the chip is in; nothing was sent.

Refused 

A safety guard said no; nothing was sent or changed.

VerifyFailed 

A read back after a write did not match.

BadReply 

A reply failed its checksum, address or opcode check; the value is discarded.

◆ GpioSignal

enum class tmc9660::GpioSignal : uint8_t
strong

Logical level of a control pin; the port maps it to the physical polarity.

Enumerator
INACTIVE 

The pin function is deasserted.

ACTIVE 

The pin function is asserted.

◆ LogLevel

enum class tmc9660::LogLevel : uint8_t
strong

Severity passed to the optional Log() hook.

Enumerator
Error 

A call failed.

Warning 

Something unexpected that the driver recovered from.

Info 

Lifecycle events: initialised, mode changes.

Debug 

Detail for bring-up.

◆ Mode

enum class tmc9660::Mode : uint8_t
strong

The protocol the chip speaks on its host interface.

Enumerator
Bootloader 

The bootloader: GET_INFO, memory access, configuration.

Parameter 

The application in parameter mode: TMCL commands.

Register 

The application in register mode: direct register access.

◆ RamDebugType

enum class tmc9660::RamDebugType : uint8_t
strong

RAMDebug types (Table 16).

Enumerator
Init 

Initialise and reset.

SampleCount 

Total number of samples.

Prescaler 

Sampling divider minus one.

SetChannel 

Set a channel.

SetTriggerChannel 

Set the trigger source.

TriggerMaskShift 

Mask and shift of the trigger value.

EnableTrigger 

Start the measurement.

GetState 

State: idle, trigger, capture, complete, pretrigger.

ReadSample 

Read a sample by index.

GetInfo 

General information.

GetChannelType 

Channel type by index.

GetChannelAddress 

Channel address by index.

SetPretrigger 

Total pretrigger samples.

GetPretrigger 

Read the pretrigger sample count.

◆ ReferenceSearch

enum class tmc9660::ReferenceSearch : uint8_t
strong

RFS sub-commands.

Enumerator
Start 

Start the search.

Stop 

Stop the search.

Status 

Read the search status.

◆ Tmcl

enum class tmc9660::Tmcl : uint8_t
strong

TMCL operation codes (Table 18 of the parameter mode manual).

Enumerator
Mst 

Motor stop.

Sap 

Set axis parameter.

Gap 

Get axis parameter.

Stap 

Store axis parameters.

Sgp 

Set global parameter.

Ggp 

Get global parameter.

Rfs 

Reference search.

Sio 

Set I/O.

Gio 

Get I/O.

Calc 

Calculate with the accumulator.

Comp 

Compare.

Jc 

Jump conditional.

Ja 

Jump absolute.

Csub 

Call subroutine.

Rsub 

Return from subroutine.

Ei 

Enable interrupt.

Di 

Disable interrupt.

Wait 

Wait.

Stop 

Stop the script.

Calcx 

Calculate with the X register.

Aap 

Accumulator to axis parameter.

Agp 

Accumulator to global parameter.

Cle 

Clear error flags.

Vect 

Set interrupt vector.

Reti 

Return from interrupt.

Calcvv 

Calculate variable with variable.

Calcva 

Calculate variable with accumulator.

Calcav 

Calculate accumulator with variable.

Calcvx 

Calculate variable with X.

Calcxv 

Calculate X with variable.

Calcv 

Calculate variable.

Rst 

Restart.

Djnz 

Decrement and jump if not zero.

Siv 

Set indexed variable.

Giv 

Get indexed variable.

Aiv 

Accumulator to indexed variable.

ApplStop 

Stop the script.

ApplRun 

Run the script.

ApplStep 

Single-step the script.

ApplReset 

Reset the script.

DownloadStart 

Start a script download.

DownloadEnd 

End a script download.

ReadMem 

Read script memory.

GetStatus 

Script status.

GetVersion 

Legacy version string: not used by the driver (ambiguity A11).

FactoryDefault 

Restore the factory defaults.

Breakpoint 

Set a breakpoint.

RamDebug 

RAMDebug access.

GetInfo 

ID and version.

Boot 

Return to the bootloader.

◆ TmclLayout

enum class tmc9660::TmclLayout : uint8_t
strong

Where the type and the motor or bank bytes of a TMCL frame put their bits (ambiguity A2).

The parameter manual numbers the UART bits least significant bit first (the sync bit is bit 0): type bits 16 to 27, motor or bank bits 28 to 31, so the fourth byte reads motor << 4 | type[11:8] (MotorHigh). A vendor example is reported to pack it the other way (TypeHigh). The SPI table (Table 3) numbers its bits most significant bit first, which read literally gives a third layout (type[11:4] in byte 1). It is not offered: a chip that uses it decodes the probe frames as types that do not exist (299 reads as 0x2B0), answers an error to both probes, and the driver refuses to start (fail closed, nothing written); supporting it needs a code change (bench item A2). The documents are not settled and nothing has run on a chip, so the driver never trusts a layout: at the start of parameter mode it probes the layouts with two read-only commands and starts only when exactly the configured one (or, for Auto, exactly one of the two) is answered. A wrong layout would put a protection parameter (256 to 288) on the wire as another parameter, for example 260 as COMMUTATION_MODE.

Enumerator
Auto 

Probe both layouts; start only when exactly one answers.

MotorHigh 

Byte 3 (SPI byte 2): motor << 4 | type[11:8]; the byte before holds type[7:0].

TypeHigh 

Byte 3 (SPI byte 2): type[11:8] << 4 | motor; the byte before holds type[7:0].

◆ TmclSpiStatus

enum class tmc9660::TmclSpiStatus : uint8_t
strong

SPI status byte of a TMCL reply.

Enumerator
Ok 

The reply is valid.

ChecksumError 

The chip received a bad checksum (also seen under load).

FirstCommand 

The first command since a reset.

NotReady 

The reply is not ready.

◆ TmclStatus

enum class tmc9660::TmclStatus : uint8_t
strong

TMCL reply status codes (Table 19).

Enumerator
Ok 

Command executed.

CmdLoaded 

Command stored by a download.

ChecksumError 

Checksum error in the request.

InvalidCommand 

Unknown command.

WrongType 

Type not valid.

InvalidValue 

Value not valid.

CmdNotAvailable 

Command not available.

CmdLoadError 

Download error.

MaxExceeded 

Limit exceeded.

DownloadNotPossible 

Download not possible.

Function Documentation

◆ GetDriverVersion()

constexpr const char * tmc9660::GetDriverVersion ( )
constexprnoexcept
Returns
The driver version, e.g. "0.1.0", from the generated tmc9660_version.h. No I/O.

◆ GetDriverVersionMajor()

constexpr uint32_t tmc9660::GetDriverVersionMajor ( )
constexprnoexcept
Returns
The major version. No I/O.

◆ GetDriverVersionMinor()

constexpr uint32_t tmc9660::GetDriverVersionMinor ( )
constexprnoexcept
Returns
The minor version. No I/O.

◆ GetDriverVersionPatch()

constexpr uint32_t tmc9660::GetDriverVersionPatch ( )
constexprnoexcept
Returns
The patch version. No I/O.

◆ ToString()

constexpr const char * tmc9660::ToString ( Error  error)
constexprnoexcept

The name of an error, for logs.

Parameters
errorThe error.
Returns
A static string such as "Timeout"; "Unknown" for a value that is not an enumerator.

◆ Validate()

constexpr Error tmc9660::Validate ( const Config &  c)
constexprnoexcept

Check a Config without touching the bus.

Parameters
cThe configuration.
Returns
Error::Ok or Error::InvalidArgument.