|
HF-TMC51x0 Driver (TMC5130 & TMC5160) 0.1.0-dev
Hardware Agnostic C++ Driver for the TMC51x0 (TMC5130 & TMC5160)
|
TMC5160 SPI command structure with union-based frame representation. More...
#include <tmc51x0_comm_interface.hpp>
Classes | |
| union | Frame |
| Union for accessing the 40-bit SPI frame in different ways. More... | |
Public Member Functions | |
| uint8_t | GetAddress () const noexcept |
| Get register address (bits 6-0 of address byte) | |
| bool | IsWrite () const noexcept |
| Check if this is a write command. | |
| uint32_t | GetValue () const noexcept |
| Get 32-bit data value (for writes) or dummy data (for reads) | |
| void | SetFrame (const uint8_t *bytes) noexcept |
| Set the 5-byte frame from raw bytes. | |
| void | GetFrame (uint8_t *bytes) const noexcept |
| Get the 5-byte frame as raw bytes. | |
Static Public Member Functions | |
| static SpiCommand | Read (uint8_t addr) noexcept |
| Construct a read command. | |
| static SpiCommand | Write (uint8_t addr, uint32_t val) noexcept |
| Construct a write command. | |
Public Attributes | |
| union tmc51x0::SpiCommand::Frame | frame |
| The 40-bit SPI frame. | |
TMC5160 SPI command structure with union-based frame representation.
Represents a standard TMC5160 SPI command (40 bits: 8-bit address + 32-bit data). Used for both single-chip and multi-chip (daisy-chain) communication. In daisy-chain mode, multiple commands are sent in one SPI transfer.
The frame is structured as:
|
inlinenoexcept |
Get register address (bits 6-0 of address byte)
|
inlinenoexcept |
Get the 5-byte frame as raw bytes.
| bytes | Output buffer (must be at least 5 bytes) |
|
inlinenoexcept |
Get 32-bit data value (for writes) or dummy data (for reads)
|
inlinenoexcept |
Check if this is a write command.
|
inlinestaticnoexcept |
Construct a read command.
| addr | Register address to read (0x00-0x73) |
|
inlinenoexcept |
Set the 5-byte frame from raw bytes.
| bytes | Pointer to 5 bytes (MSB-first) |
|
inlinestaticnoexcept |
Construct a write command.
| addr | Register address to write (0x00-0x73) |
| val | 32-bit value to write |
| union tmc51x0::SpiCommand::Frame tmc51x0::SpiCommand::frame |
The 40-bit SPI frame.