|
| | Esp32UART (uart_port_t uart_num, const Esp32UartPinConfig &pin_config, uint32_t baud_rate=115200, const tmc51x0::PinActiveLevels &active_levels=tmc51x0::PinActiveLevels{}) noexcept |
| | Construct ESP32 UART communication interface.
|
| |
| | ~Esp32UART () noexcept |
| |
| bool | ApplyPinConfig (const tmc51x0::TMC51x0PinConfig &pc) noexcept |
| |
| bool | SetPinMapping (tmc51x0::TMC51x0CtrlPin pin, gpio_num_t gpio_pin) noexcept |
| |
| gpio_num_t | GetPinMapping (tmc51x0::TMC51x0CtrlPin pin) const noexcept |
| |
| tmc51x0::Result< void > | Initialize () noexcept |
| |
| tmc51x0::Result< void > | Deinitialize () noexcept |
| |
| tmc51x0::Result< void > | UartSend (const uint8_t *data, size_t length) noexcept |
| |
| tmc51x0::Result< void > | UartReceive (uint8_t *data, size_t length) noexcept |
| |
| tmc51x0::Result< void > | SetNaiPin (bool active) noexcept |
| |
| tmc51x0::Result< bool > | GetNaoPin () noexcept |
| |
| tmc51x0::CommMode | GetMode () const noexcept |
| |
| tmc51x0::Result< void > | GpioSet (tmc51x0::TMC51x0CtrlPin pin, tmc51x0::GpioSignal signal) noexcept |
| |
| tmc51x0::Result< tmc51x0::GpioSignal > | GpioRead (tmc51x0::TMC51x0CtrlPin pin) noexcept |
| |
| void | DebugLog (int level, const char *tag, const char *format, va_list args) noexcept |
| |
| void | DelayMs (uint32_t ms) noexcept |
| |
| void | DelayUs (uint32_t us) noexcept |
| |
| | UartCommInterface () noexcept |
| | Construct UART communication interface with pin active level configuration.
|
| |
| | UartCommInterface (const UartCommInterface &)=delete |
| |
| CommMode | GetMode () const noexcept |
| | Get communication mode (always UART for this interface)
|
| |
| Result< void > | SetNaiPin (bool active) noexcept |
| | Set NAI (Next Address Input) pin state for daisy chaining.
|
| |
| Result< bool > | GetNaoPin () noexcept |
| | Read NAO (Next Address Output) pin state.
|
| |
| Result< void > | UartSend (const uint8_t *data, size_t length) noexcept |
| | Send raw bytes via UART.
|
| |
| Result< void > | UartReceive (uint8_t *data, size_t length) noexcept |
| | Receive raw bytes via UART.
|
| |
| Result< uint32_t > | ReadRegister (uint8_t address, uint8_t node_address=0) noexcept |
| | Read a 32-bit register via UART.
|
| |
| Result< void > | WriteRegister (uint8_t address, uint32_t value, uint8_t node_address=0) noexcept |
| | Write a 32-bit register via UART.
|
| |
| UartCommInterface & | operator= (const UartCommInterface &)=delete |
| |
| | CommInterface () noexcept=default |
| | Construct communication interface.
|
| |
| CommMode | GetMode () const noexcept |
| | Get the underlying communication mode used by this interface.
|
| |
| Result< uint32_t > | ReadRegister (uint8_t address, uint8_t address_param=0) noexcept |
| | Read a 32-bit register from the TMC5160.
|
| |
| Result< void > | WriteRegister (uint8_t address, uint32_t value, uint8_t address_param=0) noexcept |
| | Write a 32-bit register to the TMC5160.
|
| |
| Result< void > | GpioSet (TMC51x0CtrlPin pin, GpioSignal signal) noexcept |
| | Set GPIO pin signal state (output control)
|
| |
| Result< GpioSignal > | GpioRead (TMC51x0CtrlPin pin) noexcept |
| | Read GPIO pin signal state (input state)
|
| |
| Result< void > | GpioSetActive (TMC51x0CtrlPin pin) noexcept |
| | Set GPIO pin to active state (convenience method)
|
| |
| Result< void > | GpioSetInactive (TMC51x0CtrlPin pin) noexcept |
| | Set GPIO pin to inactive state (convenience method)
|
| |
| void | DelayMs (uint32_t ms) noexcept |
| | Delay execution for specified milliseconds.
|
| |
| void | DelayUs (uint32_t us) noexcept |
| | Delay execution for specified microseconds.
|
| |
| Result< void > | SetPowerEnabled (bool enabled) noexcept |
| | Enable/disable power to the TMC51x0 (optional)
|
| |
| Result< void > | PowerCycle (uint32_t power_off_ms=20, uint32_t power_on_settle_ms=20) noexcept |
| | Power-cycle the TMC51x0 (optional)
|
| |
| Result< void > | SetClkFreq (uint32_t frequency_hz) noexcept |
| | Set external clock frequency on CLK pin (optional)
|
| |
| | CommInterface (const CommInterface &)=delete |
| |
| CommInterface & | operator= (const CommInterface &)=delete |
| |
| void | LogDebug (int level, const char *tag, const char *format,...) noexcept |
| | Public debug logging wrapper for external classes.
|
| |
| void | LogDebug (LogLevel level, const char *tag, const char *format,...) noexcept |
| | LogDebug overload that accepts the driver-native LogLevel enum.
|
| |
ESP32 UART implementation of TMC51x0 communication interface.
Provides UART single-wire communication for the TMC51x0 using the ESP-IDF UART driver. Supports single-node and multi-node (daisy-chain) operation.
The TMC5160 uses a single-wire UART interface on pins:
- SWN/SWPN (pin 26/DIAG0): UART input (active low)
- SWP/SWIOP (pin 27/DIAG1): UART output
For multi-node systems, NAI/NAO pins (SDI_CFG1 / SDO_CFG0) form an addressing chain. See the TMC5160 datasheet section 5.4.
- Note
- SD_MODE and SPI_MODE must both be LOW (GND) for UART operation.