TMC9660 Driver 0.1.0
API reference
Loading...
Searching...
No Matches
tmc9660_types.hpp
Go to the documentation of this file.
1
12#ifndef TMC9660_TYPES_HPP
13#define TMC9660_TYPES_HPP
14
15#include <cstdint>
16
17#include "tmc9660_detail.hpp"
18#include "tmc9660_version.h"
19
21namespace tmc9660 {
22
35enum class [[nodiscard]] Error : uint8_t {
36 // Base set: the same names and values in every driver of the org (standards/driver.md).
37 Ok = 0,
38 NotInitialized = 1,
40 InvalidArgument = 2,
41 Bus = 3,
42 Timeout = 4,
44 5,
45 Crc = 6,
46 Busy = 7,
47 DeviceFault = 8,
48 Unsupported = 9,
49 // Chip-specific values start at 16; each one is returned by some call (tests/test_errors.cpp).
51 16,
52 Nack = 17,
53 WrongMode = 18,
54 Refused = 19,
55 VerifyFailed = 20,
56 BadReply = 21,
57};
58
64constexpr const char* ToString(Error error) noexcept {
65 switch (error) {
66 case Error::Ok:
67 return "Ok";
69 return "NotInitialized";
71 return "InvalidArgument";
72 case Error::Bus:
73 return "Bus";
74 case Error::Timeout:
75 return "Timeout";
77 return "DeviceIdMismatch";
78 case Error::Crc:
79 return "Crc";
80 case Error::Busy:
81 return "Busy";
83 return "DeviceFault";
85 return "Unsupported";
87 return "UnexpectedReset";
88 case Error::Nack:
89 return "Nack";
91 return "WrongMode";
92 case Error::Refused:
93 return "Refused";
95 return "VerifyFailed";
96 case Error::BadReply:
97 return "BadReply";
98 default:
99 break;
100 }
101 return "Unknown";
102}
103
111template <typename T>
112struct [[nodiscard]] Result {
113 T value{};
114 Error error{Error::Ok};
115
117 [[nodiscard]] constexpr bool ok() const noexcept {
118 return error == Error::Ok;
119 }
121 constexpr explicit operator bool() const noexcept {
122 return ok();
123 }
124
130 static constexpr Result Success(T v) noexcept {
131 return {v, Error::Ok};
132 }
138 static constexpr Result Failure(Error e) noexcept {
139 return {T{}, e};
140 }
141};
142
144template <>
145struct [[nodiscard]] Result<void> {
146 Error error{Error::Ok};
147
149 [[nodiscard]] constexpr bool ok() const noexcept {
150 return error == Error::Ok;
151 }
153 constexpr explicit operator bool() const noexcept {
154 return ok();
155 }
156
158 static constexpr Result Success() noexcept {
159 return {Error::Ok};
160 }
166 static constexpr Result Failure(Error e) noexcept {
167 return {e};
168 }
169};
170
172enum class LogLevel : uint8_t {
173 Error = 0,
174 Warning,
175 Info,
176 Debug,
177};
178
180enum class BusStatus : uint8_t {
181 Ok = 0,
182 Fault,
183 Timeout,
184};
185
188enum class CtrlPin : uint8_t {
189 Reset = 0,
190 DrvEn,
191 Wake,
192 Faultn,
193};
194
196enum class GpioSignal : uint8_t {
197 INACTIVE = 0,
198 ACTIVE = 1,
199};
200
202enum class Mode : uint8_t {
203 Bootloader = 0,
204 Parameter = 1,
205 Register = 2,
206};
207
208namespace detail {
210template <>
211struct EnumLast<Mode> {
213 static constexpr Mode kValue = Mode::Register;
214};
215} // namespace detail
216
218enum class BootMode : uint8_t {
219 Reserved =
220 0,
221 Register = 1,
222 Parameter = 2,
223 Reserved3 = 3,
224};
225
227enum class Bank : uint8_t {
228 SpiFlash = 1,
229 I2cEeprom = 2,
230 Otp = 3,
231 Config = 5,
232};
233
235enum class BlInfo : uint8_t {
236 ChipType = 0,
237 BlVersion = 1,
238 Features = 2,
239 GitInfo = 12,
240 ChipVersion = 13,
241 ChipFrequency = 14,
242 ConfigMemStart = 17,
243 ConfigMemSize = 18,
244 OtpMemSize = 19,
245 I2cMemSize = 20,
246 SpiMemSize = 21,
247 PartitionVersion = 22,
248 SpiMemPartitions = 25,
249 I2cMemPartitions = 26,
250 ChipVariant = 28,
251};
252
254enum class BlStatus : uint8_t {
255 Ok = 0,
256 CmdNotFound = 1,
257 InvalidAddr = 3,
258 InvalidValue = 4,
259 InvalidBank = 14,
260 Busy = 15,
261 MemUnconfigured = 17,
262 OtpError = 18,
263 SessionStart = 19,
264 CmdNotAvailable = 20,
265 BootloaderResumed = 21,
266};
267
269enum class BlCmd : uint8_t {
270 GetInfo = 0,
271 GetBank = 8,
272 SetBank = 9,
273 GetAddress = 10,
274 SetAddress = 11,
275 Read32 = 12,
276 Read32Inc = 13,
277 Read16 = 14,
278 Read16Inc = 15,
279 Read8 = 16,
280 Read8Inc = 17,
281 Write32 = 18,
282 Write32Inc = 19,
283 Write16 = 20,
284 Write16Inc = 21,
285 Write8 = 22,
286 Write8Inc = 23,
287 NoOp = 29,
288 OtpLoad = 30,
289 OtpBurn = 31,
290 MemIsConfigured = 32,
291 MemIsConnected = 33,
292 FlashSendCmd = 36,
293 FlashEraseSector = 37,
294 MemIsBusy = 40,
295 BootstrapRs485 = 255,
296};
297
299enum class Tmcl : uint8_t {
300 Mst = 3,
301 Sap = 5,
302 Gap = 6,
303 Stap = 7,
304 Sgp = 9,
305 Ggp = 10,
306 Rfs = 13,
307 Sio = 14,
308 Gio = 15,
309 Calc = 19,
310 Comp = 20,
311 Jc = 21,
312 Ja = 22,
313 Csub = 23,
314 Rsub = 24,
315 Ei = 25,
316 Di = 26,
317 Wait = 27,
318 Stop = 28,
319 Calcx = 33,
320 Aap = 34,
321 Agp = 35,
322 Cle = 36,
323 Vect = 37,
324 Reti = 38,
325 Calcvv = 40,
326 Calcva = 41,
327 Calcav = 42,
328 Calcvx = 43,
329 Calcxv = 44,
330 Calcv = 45,
331 Rst = 48,
332 Djnz = 49,
333 Siv = 55,
334 Giv = 56,
335 Aiv = 57,
336 ApplStop = 128,
337 ApplRun = 129,
338 ApplStep = 130,
339 ApplReset = 131,
340 DownloadStart = 132,
341 DownloadEnd = 133,
342 ReadMem = 134,
343 GetStatus = 135,
344 GetVersion = 136,
345 FactoryDefault = 137,
346 Breakpoint = 141,
347 RamDebug = 142,
348 GetInfo = 157,
349 Boot = 242,
350};
351
353enum class TmclStatus : uint8_t {
354 Ok = 100,
355 CmdLoaded = 101,
356 ChecksumError = 1,
357 InvalidCommand = 2,
358 WrongType = 3,
359 InvalidValue = 4,
360 CmdNotAvailable = 6,
361 CmdLoadError = 7,
362 MaxExceeded = 9,
364};
365
367enum class TmclSpiStatus : uint8_t {
368 Ok = 0xFF,
369 ChecksumError = 0x00,
370 FirstCommand = 0x0C,
371 NotReady = 0xF0,
372};
373
375enum class RamDebugType : uint8_t {
376 Init = 0,
377 SampleCount = 1,
378 Prescaler = 3,
379 SetChannel = 4,
381 TriggerMaskShift = 6,
382 EnableTrigger = 7,
383 GetState = 8,
384 ReadSample = 9,
385 GetInfo = 10,
386 GetChannelType = 11,
387 GetChannelAddress = 12,
388 SetPretrigger = 13,
389 GetPretrigger = 14,
390};
391
393enum class ReferenceSearch : uint8_t {
394 Start = 0,
395 Stop = 1,
396 Status = 2,
397};
398
400inline constexpr int32_t kSystemOff = 0;
402inline constexpr int32_t kCommutationModeMax = 8;
403
405inline constexpr uint32_t kChipId = 0x544D0001U;
407inline constexpr uint32_t kMotorControlClockHz = 40'000'000U;
409inline constexpr uint32_t kBootMagic = 0xA3B4C5D6U;
410
428enum class TmclLayout : uint8_t {
429 Auto = 0,
430 MotorHigh,
431 TypeHigh,
432};
433
434namespace detail {
436template <>
437struct EnumLast<TmclLayout> {
439 static constexpr TmclLayout kValue = TmclLayout::TypeHigh;
440};
441} // namespace detail
442
457
461struct Config {
463 uint8_t device_address{1};
464 uint8_t host_address{255};
465 uint8_t tmcl_host_address{2};
466 uint32_t reply_timeout_us{50'000};
470 uint32_t uart_resync_us{150'000};
473 uint32_t boot_timeout_ms{500};
476 uint32_t settle_us{20'000};
477 uint32_t spi_gap_us{1'000};
479 5};
480 bool uart_canary{true};
481 uint8_t canary_variable{15};
482 int32_t canary_value{0x5AC3A55A};
483 bool hardware_reset{false};
486 false};
488};
489
495[[nodiscard]] constexpr Error Validate(const Config& c) noexcept {
496 if ((c.device_address == 0U) || (c.host_address == 0U) || (c.tmcl_host_address == 0U)) {
498 }
499 if ((c.reply_timeout_us == 0U) || (c.boot_timeout_ms == 0U) || (c.spi_reply_retries > 50U)) {
501 }
502 if ((c.canary_variable > 15U) || (c.quirks.ram_debug_index_bits < 5U) ||
503 (c.quirks.ram_debug_index_bits > 6U)) {
505 }
506 if (!detail::IsEnumerator(c.mode) || !detail::IsEnumerator(c.quirks.tmcl_layout)) {
508 }
509 return Error::Ok;
510}
511
516void ConfigIsInvalid() noexcept;
517
526public:
531 consteval explicit CheckedConfig(const Config& config) noexcept : config_(config) {
532 if (Validate(config) != Error::Ok) {
534 }
535 }
537 [[nodiscard]] constexpr const Config& Get() const& noexcept {
538 return config_;
539 }
541 void Get() const&& = delete;
542
543private:
544 Config config_;
545};
546
548constexpr const char* GetDriverVersion() noexcept {
549 return TMC9660_VERSION_STRING;
550}
552constexpr uint32_t GetDriverVersionMajor() noexcept {
553 return TMC9660_VERSION_MAJOR;
554}
556constexpr uint32_t GetDriverVersionMinor() noexcept {
557 return TMC9660_VERSION_MINOR;
558}
560constexpr uint32_t GetDriverVersionPatch() noexcept {
561 return TMC9660_VERSION_PATCH;
562}
563
566} // namespace tmc9660
567
568#endif // TMC9660_TYPES_HPP
A configuration proven valid at build time.
Definition tmc9660_types.hpp:525
constexpr const Config & Get() const &noexcept
Definition tmc9660_types.hpp:537
void Get() const &&=delete
Not on a temporary: the reference would dangle (KB-CPP20-044).
consteval CheckedConfig(const Config &config) noexcept
Check config at build time.
Definition tmc9660_types.hpp:531
constexpr int32_t kCommutationModeMax
The largest valid COMMUTATION_MODE value.
Definition tmc9660_types.hpp:402
constexpr const char * ToString(Error error) noexcept
The name of an error, for logs.
Definition tmc9660_types.hpp:64
BlCmd
Bootloader command codes.
Definition tmc9660_types.hpp:269
RamDebugType
RAMDebug types (Table 16).
Definition tmc9660_types.hpp:375
CtrlPin
The control pins of the chip that the optional GpioSet() and GpioGet() hooks may drive.
Definition tmc9660_types.hpp:188
TmclStatus
TMCL reply status codes (Table 19).
Definition tmc9660_types.hpp:353
LogLevel
Severity passed to the optional Log() hook.
Definition tmc9660_types.hpp:172
constexpr uint32_t kMotorControlClockHz
The system clock motor control needs, in Hz.
Definition tmc9660_types.hpp:407
constexpr int32_t kSystemOff
Value of COMMUTATION_MODE (parameter 4) that leaves the gate driver off.
Definition tmc9660_types.hpp:400
constexpr uint32_t GetDriverVersionMinor() noexcept
Definition tmc9660_types.hpp:556
Error
Why a call failed. Every call of the driver returns one of these in its Result.
Definition tmc9660_types.hpp:35
BootMode
BOOT_MODE of the boot configuration (offset 8, bits 0-1).
Definition tmc9660_types.hpp:218
TmclLayout
Where the type and the motor or bank bytes of a TMCL frame put their bits (ambiguity A2).
Definition tmc9660_types.hpp:428
ReferenceSearch
RFS sub-commands.
Definition tmc9660_types.hpp:393
BlInfo
GET_INFO selectors of the bootloader.
Definition tmc9660_types.hpp:235
Mode
The protocol the chip speaks on its host interface.
Definition tmc9660_types.hpp:202
constexpr uint32_t GetDriverVersionPatch() noexcept
Definition tmc9660_types.hpp:560
TmclSpiStatus
SPI status byte of a TMCL reply.
Definition tmc9660_types.hpp:367
constexpr const char * GetDriverVersion() noexcept
Definition tmc9660_types.hpp:548
BusStatus
What a UART port reports for one exchange.
Definition tmc9660_types.hpp:180
Tmcl
TMCL operation codes (Table 18 of the parameter mode manual).
Definition tmc9660_types.hpp:299
constexpr Error Validate(const Config &c) noexcept
Check a Config without touching the bus.
Definition tmc9660_types.hpp:495
Bank
External memory banks of the bootloader (SET_BANK).
Definition tmc9660_types.hpp:227
BlStatus
Bootloader reply status codes (datasheet bootloader chapter).
Definition tmc9660_types.hpp:254
GpioSignal
Logical level of a control pin; the port maps it to the physical polarity.
Definition tmc9660_types.hpp:196
constexpr uint32_t GetDriverVersionMajor() noexcept
Definition tmc9660_types.hpp:552
constexpr uint32_t kBootMagic
The magic value of the Boot command.
Definition tmc9660_types.hpp:409
void ConfigIsInvalid() noexcept
Reached only when a CheckedConfig is built from an invalid configuration: it is never defined,...
constexpr uint32_t kChipId
The chip ID every TMC9660 reports (bootloader CHIP_TYPE, register MCC_INFO_CHIP).
Definition tmc9660_types.hpp:405
@ Read32Inc
Read 32 bits, then increment the address.
@ FlashEraseSector
Erase one flash sector.
@ BootstrapRs485
RS485 bootstrap: must be the first command.
@ SetAddress
Set the memory address.
@ GetAddress
Read the current memory address.
@ MemIsBusy
Is the external memory busy.
@ NoOp
Retrieve a reply (SPI).
@ Write16
Write 16 bits.
@ Read16
Read 16 bits.
@ Write8
Write 8 bits.
@ GetBank
Read the current memory bank.
@ SetBank
Select a memory bank.
@ Read16Inc
Read 16 bits, then increment.
@ OtpLoad
Load the OTP configuration.
@ MemIsConnected
Is the selected external memory connected.
@ Read32
Read 32 bits.
@ Read8Inc
Read 8 bits, then increment.
@ Write16Inc
Write 16 bits, then increment.
@ Read8
Read 8 bits.
@ GetInfo
Read an information value.
@ Write8Inc
Write 8 bits, then increment.
@ FlashSendCmd
Raw flash command: not exposed by the driver.
@ Write32
Write 32 bits.
@ MemIsConfigured
Is the selected external memory configured.
@ Write32Inc
Write 32 bits, then increment.
@ OtpBurn
Permanent: not exposed by the driver.
@ EnableTrigger
Start the measurement.
@ SetTriggerChannel
Set the trigger source.
@ GetChannelType
Channel type by index.
@ SampleCount
Total number of samples.
@ TriggerMaskShift
Mask and shift of the trigger value.
@ GetChannelAddress
Channel address by index.
@ Init
Initialise and reset.
@ GetPretrigger
Read the pretrigger sample count.
@ SetPretrigger
Total pretrigger samples.
@ GetState
State: idle, trigger, capture, complete, pretrigger.
@ Prescaler
Sampling divider minus one.
@ ReadSample
Read a sample by index.
@ SetChannel
Set a channel.
@ DrvEn
DRV_EN, active high on the package pin; ACTIVE allows the gate-driver outputs.
@ Reset
RSTN, active low on the package pin; ACTIVE holds the chip in reset.
@ 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).
@ CmdLoadError
Download error.
@ DownloadNotPossible
Download not possible.
@ ChecksumError
Checksum error in the request.
@ MaxExceeded
Limit exceeded.
@ CmdLoaded
Command stored by a download.
@ InvalidCommand
Unknown command.
@ WrongType
Type not valid.
@ Warning
Something unexpected that the driver recovered from.
@ Info
Lifecycle events: initialised, mode changes.
@ Debug
Detail for bring-up.
@ UnexpectedReset
The chip reset since the last validated reply; the driver is uninitialised.
@ InvalidArgument
An argument or a Config field is out of range; nothing was sent.
@ 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.
@ Bus
A port hook returned false or BusStatus::Fault.
@ VerifyFailed
A read back after a write did not match.
@ BadReply
A reply failed its checksum, address or opcode check; the value is discarded.
@ DeviceFault
A latched error flag forbids the call (gate driver or general error flags).
@ Ok
The call succeeded.
@ Unsupported
The hook or silicon feature this call needs is absent.
@ Nack
The chip answered with an error status; see LastStatus().
@ Timeout
No reply, or the chip did not become ready in the allowed time.
@ Busy
The chip answered BUSY and the retries ran out.
@ 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.
@ Reserved
The hardware default: no application. The driver never starts the application with it.
@ Reserved3
Reserved.
@ 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].
@ Start
Start the search.
@ Status
Read the search status.
@ I2cMemSize
Size of the I2C memory.
@ ChipType
0x544D0001.
@ SpiMemPartitions
Partitions in the SPI flash.
@ PartitionVersion
Partition table version.
@ I2cMemPartitions
Partitions in the I2C memory.
@ ChipVersion
Silicon version.
@ ConfigMemSize
Size of the configuration memory in bytes.
@ ChipFrequency
System clock in Hz.
@ OtpMemSize
Size of the OTP memory.
@ Features
Feature bits.
@ ConfigMemStart
Start address of the configuration memory.
@ ChipVariant
Chip variant (2).
@ SpiMemSize
Size of the SPI flash.
@ BlVersion
Bootloader version.
@ GitInfo
Git revision of the bootloader.
@ Register
The application in register mode: direct register access.
@ Bootloader
The bootloader: GET_INFO, memory access, configuration.
@ Parameter
The application in parameter mode: TMCL commands.
@ FirstCommand
The first command since a reset.
@ NotReady
The reply is not ready.
@ Fault
The UART failed (framing, overrun, driver error).
@ Stap
Store axis parameters.
@ Calcvx
Calculate variable with X.
@ DownloadEnd
End a script download.
@ Mst
Motor stop.
@ Stop
Stop the script.
@ ApplStep
Single-step the script.
@ ApplReset
Reset the script.
@ Ja
Jump absolute.
@ Rst
Restart.
@ FactoryDefault
Restore the factory defaults.
@ Csub
Call subroutine.
@ GetVersion
Legacy version string: not used by the driver (ambiguity A11).
@ Gap
Get axis parameter.
@ Reti
Return from interrupt.
@ Ei
Enable interrupt.
@ Calcva
Calculate variable with accumulator.
@ Di
Disable interrupt.
@ Comp
Compare.
@ DownloadStart
Start a script download.
@ Djnz
Decrement and jump if not zero.
@ Sio
Set I/O.
@ Agp
Accumulator to global parameter.
@ ReadMem
Read script memory.
@ Breakpoint
Set a breakpoint.
@ Aiv
Accumulator to indexed variable.
@ Cle
Clear error flags.
@ Calcxv
Calculate X with variable.
@ Sgp
Set global parameter.
@ Rfs
Reference search.
@ Calcx
Calculate with the X register.
@ Calcv
Calculate variable.
@ Giv
Get indexed variable.
@ ApplStop
Stop the script.
@ Sap
Set axis parameter.
@ Calcvv
Calculate variable with variable.
@ GetStatus
Script status.
@ Ggp
Get global parameter.
@ Boot
Return to the bootloader.
@ Vect
Set interrupt vector.
@ Siv
Set indexed variable.
@ Rsub
Return from subroutine.
@ Calc
Calculate with the accumulator.
@ Jc
Jump conditional.
@ Calcav
Calculate accumulator with variable.
@ Gio
Get I/O.
@ ApplRun
Run the script.
@ Aap
Accumulator to axis parameter.
@ SpiFlash
External SPI flash.
@ I2cEeprom
External I2C EEPROM.
@ Otp
One-time programmable memory.
@ InvalidValue
Value not valid.
@ InvalidAddr
Address not valid.
@ InvalidBank
Bank not valid.
@ BootloaderResumed
SPI only: the bootloader restarted.
@ OtpError
SPI only: OTP error.
@ MemUnconfigured
External memory not configured.
@ SessionStart
First reply of a session; the value is the version.
@ CmdNotFound
Unknown command.
@ CmdNotAvailable
Command not available.
@ ACTIVE
The pin function is asserted.
@ INACTIVE
The pin function is deasserted.
The TMC9660 driver: everything it declares lives here; internals in detail.
Definition tmc9660.hpp:37
@ Busy
MEM_IS_BUSY.
@ RamDebug
RAMDebug; offsets are subcommand and index, not register numbers.
Configuration of the driver. The defaults are the chip's.
Definition tmc9660_types.hpp:461
bool hardware_reset
Definition tmc9660_types.hpp:483
uint32_t boot_timeout_ms
Definition tmc9660_types.hpp:473
bool allow_pwm_in_system_off
See the lines above.
Definition tmc9660_types.hpp:469
bool uart_canary
Parameter mode over UART: detect an unseen reset (A7).
Definition tmc9660_types.hpp:480
uint32_t spi_gap_us
Gap between the command and the reply-request on SPI.
Definition tmc9660_types.hpp:477
uint32_t reply_timeout_us
How long the UART port waits for a reply. Leave PWM active in System off; without it SetParam(IDLE_MO...
Definition tmc9660_types.hpp:466
Quirks quirks
Readings of ambiguous documentation.
Definition tmc9660_types.hpp:487
uint32_t settle_us
Wait after a write that reconfigures the chip (A13).
Definition tmc9660_types.hpp:476
bool faultn_is_reset
Service() treats FAULTN low outside the bootloader as a reset (A18).
Definition tmc9660_types.hpp:485
uint8_t device_address
UART device address (odd: its upper 7 bits are the TMCL address).
Definition tmc9660_types.hpp:463
uint8_t spi_reply_retries
Repeats of the reply-request on NOT_READY or CHECKSUM_ERROR (A5).
Definition tmc9660_types.hpp:478
uint8_t canary_variable
User variable that holds the canary.
Definition tmc9660_types.hpp:481
uint8_t host_address
Host address in bootloader UART replies.
Definition tmc9660_types.hpp:464
uint32_t uart_resync_us
Definition tmc9660_types.hpp:470
Mode mode
The protocol the chip is in at EnsureInitialized().
Definition tmc9660_types.hpp:462
int32_t canary_value
The canary.
Definition tmc9660_types.hpp:482
uint8_t tmcl_host_address
Host address in TMCL and register-mode UART replies.
Definition tmc9660_types.hpp:465
Model knobs: where the documents disagree, the driver reads one way by default and a flag selects the...
Definition tmc9660_types.hpp:447
uint8_t ram_debug_index_bits
A17: width of the RAMDebug index in a register offset: 5 or 6.
Definition tmc9660_types.hpp:454
bool reg_spi_wide_offset
A3: 5-bit block, write bit 42, 10-bit offset.
Definition tmc9660_types.hpp:452
bool crc8_reflect_output
A1: reflect the CRC-8 result, as the prose says. The examples do not.
Definition tmc9660_types.hpp:448
bool reg_uart_msb_fields
A4: offset[10:8] << 5 | block in byte 3.
Definition tmc9660_types.hpp:453
TmclLayout tmcl_layout
A2: the TMCL type and motor bytes; probed at the start, never trusted.
Definition tmc9660_types.hpp:450
constexpr bool ok() const noexcept
Definition tmc9660_types.hpp:149
static constexpr Result Failure(Error e) noexcept
A failed result.
Definition tmc9660_types.hpp:166
static constexpr Result Success() noexcept
Definition tmc9660_types.hpp:158
The value of a call, or why there is none.
Definition tmc9660_types.hpp:112
constexpr bool ok() const noexcept
Definition tmc9660_types.hpp:117
static constexpr Result Success(T v) noexcept
A successful result.
Definition tmc9660_types.hpp:130
static constexpr Result Failure(Error e) noexcept
A failed result.
Definition tmc9660_types.hpp:138
Compile-time helpers of the TMC9660 driver: byte copy, exact hook matching, typed register fields and...