36#ifndef FDO2_UART_INTERFACE_HPP
37#define FDO2_UART_INTERFACE_HPP
99template <
typename Derived>
124template <typename Port>
126 detail::ExactHook<Port, bool()
noexcept>::Take(&Port::EnsureInitialized);
127 detail::ExactHook<Port, bool(
const uint8_t*, std::size_t)
noexcept>::Take(&Port::Write);
128 detail::ExactHook<Port, std::size_t(uint8_t*, std::size_t, uint32_t)
noexcept>::Take(&Port::Read);
129 detail::ExactHook<Port, bool()
noexcept>::Take(&Port::FlushInput);
CRTP base of the platform UART port.
Definition fdo2_uart_interface.hpp:100
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 fdo2_uart_interface.hpp:125
Compile-time helpers of the FDO2 driver: typed integer literals, exact hook matching,...
The FDO2 line protocol as pure functions: CRC-16, command encoders, the line assembler and the strict...
Public types of the FDO2 driver: errors, Result<T>, the status word, measurements,...
The FDO2 driver: everything it declares lives here; internals in detail.
Definition fdo2.hpp:33
constexpr uint32_t kPortDefaultBaud
Rate after every power-up (datasheet 4).
Definition fdo2_uart_interface.hpp:68
constexpr uint32_t kSupplyMinMv
Lowest supply the datasheet allows, millivolts (below it the readings can be wrong).
Definition fdo2_uart_interface.hpp:74
constexpr uint32_t kMaxLogicLevelMv
Absolute maximum on the module's UART pins, millivolts: a 5 V host needs a level shifter.
Definition fdo2_uart_interface.hpp:72
constexpr uint32_t kMaxBaudRate
Highest baud rate the module accepts (datasheet 4.3, #BAUD).
Definition fdo2_uart_interface.hpp:82
constexpr uint32_t kPowerUpMs
Time from power to the first answer, milliseconds ("ca. 1 sec", datasheet 4).
Definition fdo2_uart_interface.hpp:78
constexpr uint32_t kTurnaroundUs
Definition fdo2_uart_interface.hpp:86
GpioSignal
Logical level of a control pin; the port maps it to the physical polarity.
Definition fdo2_uart_interface.hpp:55
@ ACTIVE
The pin function is asserted (module powered).
@ INACTIVE
The pin function is deasserted (module unpowered).
constexpr uint32_t kLogicLevelMv
Logic level of the module's UART, millivolts (datasheet 2, Interface).
Definition fdo2_uart_interface.hpp:70
constexpr uint32_t kRxBufferBytes
Receive buffer a port needs to never lose a #RDUM reply, bytes (or it polls every 300 ms).
Definition fdo2_uart_interface.hpp:80
CtrlPin
Control pins the port may drive through the optional GpioSet() hook.
Definition fdo2_uart_interface.hpp:50
@ Power
Supply switch of the module: ACTIVE powers it. It idles INACTIVE (off).
constexpr uint32_t kSupplyMaxMv
Highest supply, millivolts (absolute maximum 5.5 V).
Definition fdo2_uart_interface.hpp:76