Concrete UART communication adapter for TMC5160 using BaseUart and BaseGpio.
More...
#include <Tmc5160Handler.h>
|
| | HalUartTmc5160Comm (BaseUart &uart, BaseGpio &enable, BaseGpio *diag0=nullptr, BaseGpio *diag1=nullptr, const tmc51x0::PinActiveLevels &active_levels={}) noexcept |
| | Construct the UART communication adapter.
|
| |
|
| tmc51x0::Result< void > | UartSend (const uint8_t *data, size_t length) noexcept |
| | Send data over UART.
|
| |
| tmc51x0::Result< void > | UartReceive (uint8_t *data, size_t length) noexcept |
| | Receive data over UART.
|
| |
| tmc51x0::Result< void > | GpioSet (tmc51x0::TMC51x0CtrlPin pin, tmc51x0::GpioSignal signal) noexcept |
| | Set a TMC5160 control pin.
|
| |
| tmc51x0::Result< tmc51x0::GpioSignal > | GpioRead (tmc51x0::TMC51x0CtrlPin pin) noexcept |
| | Read a TMC5160 control pin.
|
| |
| void | DebugLog (int level, const char *tag, const char *format, va_list args) noexcept |
| | Debug logging.
|
| |
| 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 UART).
|
| |
Concrete UART communication adapter for TMC5160 using BaseUart and BaseGpio.
Implements all methods required by tmc51x0::UartCommInterface<HalUartTmc5160Comm> through the CRTP pattern.
◆ HalUartTmc5160Comm()
| HalUartTmc5160Comm::HalUartTmc5160Comm |
( |
BaseUart & | uart, |
|
|
BaseGpio & | enable, |
|
|
BaseGpio * | diag0 = nullptr, |
|
|
BaseGpio * | diag1 = nullptr, |
|
|
const tmc51x0::PinActiveLevels & | active_levels = {} ) |
|
noexcept |
Construct the UART communication adapter.
- Parameters
-
| uart | Reference to a pre-configured BaseUart implementation. |
| enable | BaseGpio connected to TMC5160 DRV_ENN (pin 28, active LOW). |
| diag0 | Optional BaseGpio connected to DIAG0. |
| diag1 | Optional BaseGpio connected to DIAG1. |
| active_levels | Pin active level configuration. |
◆ DebugLog()
| void HalUartTmc5160Comm::DebugLog |
( |
int | level, |
|
|
const char * | tag, |
|
|
const char * | format, |
|
|
va_list | args ) |
|
noexcept |
◆ DelayMs()
| void HalUartTmc5160Comm::DelayMs |
( |
uint32_t | ms | ) |
|
|
noexcept |
◆ DelayUs()
| void HalUartTmc5160Comm::DelayUs |
( |
uint32_t | us | ) |
|
|
noexcept |
◆ GetMode()
| tmc51x0::CommMode HalUartTmc5160Comm::GetMode |
( |
| ) |
const |
|
inlinenoexcept |
Get communication mode (always UART).
◆ GpioRead()
| tmc51x0::Result< tmc51x0::GpioSignal > HalUartTmc5160Comm::GpioRead |
( |
tmc51x0::TMC51x0CtrlPin | pin | ) |
|
|
noexcept |
Read a TMC5160 control pin.
◆ GpioSet()
| tmc51x0::Result< void > HalUartTmc5160Comm::GpioSet |
( |
tmc51x0::TMC51x0CtrlPin | pin, |
|
|
tmc51x0::GpioSignal | signal ) |
|
noexcept |
Set a TMC5160 control pin.
◆ UartReceive()
| tmc51x0::Result< void > HalUartTmc5160Comm::UartReceive |
( |
uint8_t * | data, |
|
|
size_t | length ) |
|
noexcept |
◆ UartSend()
| tmc51x0::Result< void > HalUartTmc5160Comm::UartSend |
( |
const uint8_t * | data, |
|
|
size_t | length ) |
|
noexcept |
◆ active_levels_
| tmc51x0::PinActiveLevels HalUartTmc5160Comm::active_levels_ |
|
private |
◆ ctrl_pins_
◆ uart_
| BaseUart& HalUartTmc5160Comm::uart_ |
|
private |
The documentation for this class was generated from the following files: