21#ifndef TMC5160_SPI_INTERFACE_HPP
22#define TMC5160_SPI_INTERFACE_HPP
68template <
typename Derived>
88template <typename Port>
90 detail::ExactHook<Port, bool()
noexcept>::Take(&Port::EnsureInitialized);
91 detail::ExactHook<Port, bool(
const uint8_t*, uint8_t*, std::size_t)
noexcept>::Take(
CRTP base of the platform SPI port.
Definition tmc5160_spi_interface.hpp:69
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.
SpiInterface() noexcept=default
Only the derived port is constructed.
Satisfied by a class that derives from SpiInterface<Port> and implements the required hooks with exac...
Definition tmc5160_spi_interface.hpp:89
The TMC5160 driver: everything it declares lives here; internals in detail.
Definition tmc5160.hpp:34
constexpr uint8_t kSpiMode
SPI mode: SCK idles high, data is latched on the rising edge ("usually referred to as mode 3").
Definition tmc5160_spi_interface.hpp:40
constexpr uint32_t kMaxClockHz
Definition tmc5160_spi_interface.hpp:45
constexpr uint32_t kMinCsHighNs
CSN high time between datagrams is more than 2 clocks + 10 ns: 200 ns covers the slowest clock.
Definition tmc5160_spi_interface.hpp:49
constexpr uint32_t kCsSetupNs
CSN low to the first SCK edge, t_CC, minimum.
Definition tmc5160_spi_interface.hpp:54
constexpr bool kContinuousWord
true: the chip needs the 40 bits of a datagram without a CSN pulse in between.
Definition tmc5160_spi_interface.hpp:56
constexpr uint32_t kCsHoldNs
Definition tmc5160_spi_interface.hpp:52
constexpr bool kMsbFirst
Each byte is clocked most significant bit first.
Definition tmc5160_spi_interface.hpp:42
constexpr uint32_t kDatagramBytes
A datagram is 40 bits; the whole datagram (5 bytes per chip in a chain) is one CSN low period.
Definition tmc5160_spi_interface.hpp:47
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.