HF-TMC9660 Driver
Hardware Agnostic C++ Driver for the TMC9660
Loading...
Searching...
No Matches
SPITMC9660CommInterface Class Referenceabstract

SPI implementation of TMC9660CommInterface. More...

#include <TMC9660CommInterface.hpp>

Inheritance diagram for SPITMC9660CommInterface:
Collaboration diagram for SPITMC9660CommInterface:

Public Member Functions

CommMode mode () const noexcept override
 Return underlying communication mode.
 
virtual bool spiTransfer (std::array< uint8_t, 8 > &tx, std::array< uint8_t, 8 > &rx) noexcept=0
 Low-level SPI transfer of 8 bytes.
 
bool transfer (const TMCLFrame &tx, TMCLReply &reply, uint8_t) noexcept override
 Perform a full duplex TMCL transfer.
 
- Public Member Functions inherited from TMC9660CommInterface
virtual ~TMC9660CommInterface () noexcept=default
 

Detailed Description

SPI implementation of TMC9660CommInterface.

Uses a 4-wire SPI bus (mode 3) to exchange 64-bit datagrams (8 bytes). Data is sent MSB-first, big-endian. Replies match the previous command; initial reply uses FIRST_CMD status.

Member Function Documentation

◆ mode()

CommMode SPITMC9660CommInterface::mode ( ) const
inlineoverridevirtualnoexcept

Return underlying communication mode.

Implements TMC9660CommInterface.

◆ spiTransfer()

virtual bool SPITMC9660CommInterface::spiTransfer ( std::array< uint8_t, 8 > &  tx,
std::array< uint8_t, 8 > &  rx 
)
pure virtualnoexcept

Low-level SPI transfer of 8 bytes.

Parameters
txBuffer containing 8 bytes to transmit.
rxBuffer to receive 8 bytes from device.
Returns
true if the SPI transfer completed successfully.

◆ transfer()

bool SPITMC9660CommInterface::transfer ( const TMCLFrame tx,
TMCLReply reply,
uint8_t  address 
)
inlineoverridevirtualnoexcept

Perform a full duplex TMCL transfer.

Implementations encode tx according to the active mode (SPI or UART), transmit it and decode the reply into reply. The address parameter is only used for UART transfers and ignored for SPI.

Implements TMC9660CommInterface.


The documentation for this class was generated from the following file: