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

UART implementation of TMC9660CommInterface. More...

#include <TMC9660CommInterface.hpp>

Inheritance diagram for UARTTMC9660CommInterface:
Collaboration diagram for UARTTMC9660CommInterface:

Public Member Functions

CommMode mode () const noexcept override
 Return underlying communication mode.
 
virtual bool sendUartDatagram (const std::array< uint8_t, 9 > &data) noexcept=0
 Send raw 9-byte UART TMCL datagram.
 
virtual bool receiveUartDatagram (std::array< uint8_t, 9 > &data) noexcept=0
 Receive raw 9-byte UART TMCL datagram.
 
bool transfer (const TMCLFrame &tx, TMCLReply &reply, uint8_t address) noexcept override
 Perform a full duplex TMCL transfer.
 
- Public Member Functions inherited from TMC9660CommInterface
virtual ~TMC9660CommInterface () noexcept=default
 

Detailed Description

UART implementation of TMC9660CommInterface.

Uses UART_TXD and UART_RXD signals; supports external transceivers via UART_TXEN. Frames consist of 9 bytes: sync+address, command, type, motor, 4-byte data, checksum. LSB-first transmission; checksum is 8-bit sum of first 8 bytes.

Member Function Documentation

◆ mode()

CommMode UARTTMC9660CommInterface::mode ( ) const
inlineoverridevirtualnoexcept

Return underlying communication mode.

Implements TMC9660CommInterface.

◆ receiveUartDatagram()

virtual bool UARTTMC9660CommInterface::receiveUartDatagram ( std::array< uint8_t, 9 > &  data)
pure virtualnoexcept

Receive raw 9-byte UART TMCL datagram.

Parameters
dataArray to store 9 received bytes.
Returns
true if reception succeeded.

◆ sendUartDatagram()

virtual bool UARTTMC9660CommInterface::sendUartDatagram ( const std::array< uint8_t, 9 > &  data)
pure virtualnoexcept

Send raw 9-byte UART TMCL datagram.

Parameters
dataArray of 9 bytes including sync, fields, and checksum.
Returns
true if transmission succeeded.

◆ transfer()

bool UARTTMC9660CommInterface::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: