Concrete SPI communication adapter for TMC5160 using BaseSpi and BaseGpio.
More...
#include <Tmc5160Handler.h>
|
| | HalSpiTmc5160Comm (BaseSpi &spi, BaseGpio &enable, BaseGpio *diag0=nullptr, BaseGpio *diag1=nullptr, const tmc51x0::PinActiveLevels &active_levels={}) noexcept |
| | Construct the SPI communication adapter.
|
| |
|
| tmc51x0::Result< void > | SpiTransfer (const uint8_t *tx, uint8_t *rx, size_t length) noexcept |
| | Low-level SPI transfer (5 bytes per TMC5160 datagram).
|
| |
| tmc51x0::Result< void > | GpioSet (tmc51x0::TMC51x0CtrlPin pin, tmc51x0::GpioSignal signal) noexcept |
| | Set a TMC5160 control pin to a given logical signal state.
|
| |
| tmc51x0::Result< tmc51x0::GpioSignal > | GpioRead (tmc51x0::TMC51x0CtrlPin pin) noexcept |
| | Read a TMC5160 control pin's current logical signal state.
|
| |
| void | DebugLog (int level, const char *tag, const char *format, va_list args) noexcept |
| | Debug logging — routes to HardFOC Logger.
|
| |
| void | DelayMs (uint32_t ms) noexcept |
| | Delay in milliseconds.
|
| |
| void | DelayUs (uint32_t us) noexcept |
| | Delay in microseconds.
|
| |
| tmc51x0::CommMode | GetMode () const noexcept |
| | Get communication mode (always SPI).
|
| |
Concrete SPI communication adapter for TMC5160 using BaseSpi and BaseGpio.
Implements all methods required by tmc51x0::SpiCommInterface<HalSpiTmc5160Comm> through the CRTP pattern. This class bridges BaseSpi to the TMC5160 driver's SPI protocol (40-bit datagrams, Mode 3).
◆ HalSpiTmc5160Comm()
| HalSpiTmc5160Comm::HalSpiTmc5160Comm |
( |
BaseSpi & | spi, |
|
|
BaseGpio & | enable, |
|
|
BaseGpio * | diag0 = nullptr, |
|
|
BaseGpio * | diag1 = nullptr, |
|
|
const tmc51x0::PinActiveLevels & | active_levels = {} ) |
|
noexcept |
Construct the SPI communication adapter.
- Parameters
-
| spi | Reference to a pre-configured BaseSpi implementation. |
| enable | BaseGpio connected to TMC5160 DRV_ENN (pin 28, active LOW). |
| diag0 | Optional BaseGpio connected to DIAG0 (pin 26). |
| diag1 | Optional BaseGpio connected to DIAG1 (pin 27). |
| active_levels | Pin active level configuration. |
◆ DebugLog()
| void HalSpiTmc5160Comm::DebugLog |
( |
int | level, |
|
|
const char * | tag, |
|
|
const char * | format, |
|
|
va_list | args ) |
|
noexcept |
Debug logging — routes to HardFOC Logger.
◆ DelayMs()
| void HalSpiTmc5160Comm::DelayMs |
( |
uint32_t | ms | ) |
|
|
noexcept |
◆ DelayUs()
| void HalSpiTmc5160Comm::DelayUs |
( |
uint32_t | us | ) |
|
|
noexcept |
◆ GetMode()
| tmc51x0::CommMode HalSpiTmc5160Comm::GetMode |
( |
| ) |
const |
|
inlinenoexcept |
Get communication mode (always SPI).
◆ GpioRead()
| tmc51x0::Result< tmc51x0::GpioSignal > HalSpiTmc5160Comm::GpioRead |
( |
tmc51x0::TMC51x0CtrlPin | pin | ) |
|
|
noexcept |
Read a TMC5160 control pin's current logical signal state.
◆ GpioSet()
| tmc51x0::Result< void > HalSpiTmc5160Comm::GpioSet |
( |
tmc51x0::TMC51x0CtrlPin | pin, |
|
|
tmc51x0::GpioSignal | signal ) |
|
noexcept |
Set a TMC5160 control pin to a given logical signal state.
◆ SpiTransfer()
| tmc51x0::Result< void > HalSpiTmc5160Comm::SpiTransfer |
( |
const uint8_t * | tx, |
|
|
uint8_t * | rx, |
|
|
size_t | length ) |
|
noexcept |
Low-level SPI transfer (5 bytes per TMC5160 datagram).
◆ active_levels_
| tmc51x0::PinActiveLevels HalSpiTmc5160Comm::active_levels_ |
|
private |
◆ ctrl_pins_
◆ spi_
| BaseSpi& HalSpiTmc5160Comm::spi_ |
|
private |
The documentation for this class was generated from the following files: