19#ifndef TMC5160_UART_INTERFACE_HPP
20#define TMC5160_UART_INTERFACE_HPP
53template <
typename Derived>
73template <typename Port>
75 detail::ExactHook<Port, bool()
noexcept>::Take(&Port::EnsureInitialized);
76 detail::ExactHook<Port,
BusStatus(
const uint8_t*, std::size_t, uint8_t*, std::size_t,
77 uint32_t)
noexcept>::Take(&Port::Exchange);
CRTP base of the platform UART port.
Definition tmc5160_uart_interface.hpp:54
UartInterface & operator=(const UartInterface &)=delete
Ports are not copied: the driver holds a reference.
UartInterface() noexcept=default
Only the derived port is constructed.
UartInterface(const UartInterface &)=delete
Ports are not copied: the driver holds a reference.
Satisfied by a class that derives from UartInterface<Port> and implements the required hooks with exa...
Definition tmc5160_uart_interface.hpp:74
BusStatus
Result of one UART exchange as the port reports it.
Definition tmc5160_types.hpp:199
The TMC5160 driver: everything it declares lives here; internals in detail.
Definition tmc5160.hpp:34
constexpr uint32_t kUartGapResetBits
A gap of more than this many bit times between start bits resets the chip's receiver (page 26).
Definition tmc5160_uart_interface.hpp:38
constexpr uint32_t kTurnaroundUs
Definition tmc5160_uart_interface.hpp:46
constexpr uint32_t kUartReplyMarginBits
Definition tmc5160_uart_interface.hpp:41
constexpr uint32_t kMaxBaudRate
Highest baud rate: fCLK / 16 (page 26); 750 kBaud with the internal 12 MHz clock.
Definition tmc5160_uart_interface.hpp:43
constexpr uint8_t kUartDataBits
Data bits of a frame: 8N1, one start bit and one stop bit.
Definition tmc5160_uart_interface.hpp:36
Compile-time helpers of the TMC5160 driver: typed integer literals, exact hook matching,...
Public types of the TMC5160 driver: errors, Result<T>, configuration, validation and advice.