24#ifndef TMC9660_SPI_INTERFACE_HPP
25#define TMC9660_SPI_INTERFACE_HPP
78template <
typename Derived>
104template <typename Port>
106 detail::ExactHook<Port, bool()
noexcept>::Take(&Port::EnsureInitialized);
107 detail::ExactHook<Port, bool(
const uint8_t*, uint8_t*, std::size_t)
noexcept>::Take(
CRTP base of the platform SPI port.
Definition tmc9660_spi_interface.hpp:79
SpiInterface() noexcept=default
Only the derived port is constructed.
SpiInterface(const SpiInterface &)=delete
Ports are not copied: the driver holds a reference.
SpiInterface & operator=(const SpiInterface &)=delete
Ports are not copied: the driver holds a reference.
Satisfied by a class that derives from SpiInterface<Port> and implements the required hooks with exac...
Definition tmc9660_spi_interface.hpp:105
The TMC9660 driver: everything it declares lives here; internals in detail.
Definition tmc9660.hpp:37
constexpr std::size_t kBootloaderDatagramBytes
Bootloader datagram length in bytes.
Definition tmc9660_spi_interface.hpp:61
constexpr uint32_t kDataSetupNs
Data setup and hold time, t_DU and t_DH.
Definition tmc9660_spi_interface.hpp:59
constexpr uint32_t kCsSetupNs
CS low to the first SCK edge, t_CSS.
Definition tmc9660_spi_interface.hpp:49
constexpr std::size_t kRegisterDatagramBytes
Register-mode datagram length in bytes.
Definition tmc9660_spi_interface.hpp:65
constexpr bool kMsbFirst
Each byte is clocked most significant bit first; multi-byte values are big endian.
Definition tmc9660_spi_interface.hpp:45
constexpr std::size_t kParameterDatagramBytes
Parameter-mode (TMCL) datagram length in bytes.
Definition tmc9660_spi_interface.hpp:63
constexpr uint8_t kSpiMode
SPI mode: CPOL 1, CPHA 1 (the default of the chip's SPI peripheral).
Definition tmc9660_spi_interface.hpp:43
constexpr uint32_t kMaxClockHz
Highest SCK frequency.
Definition tmc9660_spi_interface.hpp:47
constexpr uint32_t kMinCsHighNs
Shortest time CS stays high between two datagrams, t_CSH (4 system clocks at 40 MHz).
Definition tmc9660_spi_interface.hpp:55
constexpr uint32_t kCsHoldNs
SCK edge to CS change, t_CC (data sheet p. 27: one SCK period, 100 ns at 10 MHz).
Definition tmc9660_spi_interface.hpp:51
constexpr bool kContinuousWord
true: a datagram is clocked in one CS low period, without a CS pulse between its bytes.
Definition tmc9660_spi_interface.hpp:53
constexpr uint32_t kClockPhaseNs
SCK low and high time, t_CL and t_CH.
Definition tmc9660_spi_interface.hpp:57
Compile-time helpers of the TMC9660 driver: byte copy, exact hook matching, typed register fields and...
Public types of the TMC9660 driver: errors, Result<T>, the protocol enumerations, Config and its mode...