TMC9660 Driver 0.1.0
API reference
Loading...
Searching...
No Matches
Classes | Namespaces | Concepts
tmc9660_uart_interface.hpp File Reference

The UART port of the TMC9660 driver: the CRTP base, the UartPort concept and the bus requirements. More...

#include <concepts>
#include <cstddef>
#include <cstdint>
#include "tmc9660_detail.hpp"
#include "tmc9660_types.hpp"

Go to the source code of this file.

Classes

class  tmc9660::UartInterface< Derived >
 CRTP base of the platform UART port. More...
 

Namespaces

namespace  tmc9660
 The TMC9660 driver: everything it declares lives here; internals in detail.
 

Concepts

concept  tmc9660::UartPort
 Satisfied by a class that derives from UartInterface<Port> and implements the required hooks with exactly the types above.
 

Variables

Bus requirements

What the TMC9660 needs from the UART.

constexpr uint8_t tmc9660::kUartDataBits = 8
 Data bits of a frame: 8N1, one start bit and one stop bit.
 
constexpr uint32_t tmc9660::kMaxBaudRate = 5'000'000
 Highest baud rate.
 
constexpr uint32_t tmc9660::kTurnaroundUs = 1'000
 
constexpr uint32_t tmc9660::kMinAutobaudRate = 9'600
 Lowest standard baud rate the chip detects automatically.
 
constexpr uint32_t tmc9660::kMaxAutobaudRate = 250'000
 Highest standard baud rate the chip detects automatically at a 40 MHz system clock.
 

Detailed Description

The UART port of the TMC9660 driver: the CRTP base, the UartPort concept and the bus requirements.

The chip's host UART is 8N1, least significant bit first, and detects the baud rate from the sync bit of each request (standard rates from 9600 to 250000 at a 40 MHz system clock; up to 5 Mbit/s when the rate is configured). Derive from tmc9660::UartInterface<Self> and implement:

Two documents disagree on how long a gap inside a request may be before the chip discards the partial message (about 100 ms in one chapter, 10 ms in another, ambiguity A6): a port sends each request without gaps, so the question does not arise.