67 template <
typename ReadPortType = ReadPort,
typename WritePortType = WritePort>
68 UART(ReadPortType* read_port, WritePortType* write_port)
88 template <
typename OperationType,
typename = std::enable_if_t<std::is_base_of_v<
92 return (*
write_port_)(data, std::forward<OperationType>(op), in_isr);
95 template <
typename OperationType,
typename = std::enable_if_t<std::is_base_of_v<
99 return (*
read_port_)(data, std::forward<OperationType>(op), in_isr);
只读原始数据视图 / Immutable raw data view
可写原始数据视图 / Mutable raw data view
基于 SPSC 字节队列的读端口 / Read endpoint backed by an SPSC byte queue.
通用异步收发传输(UART)基类 / Abstract base class for Universal Asynchronous Receiver-Transmitter (UART)
ReadPort * read_port_
读取端口 / Read port
Parity
奇偶校验模式 / Parity mode
@ NO_PARITY
无校验 / No parity
virtual ErrorCode SetConfig(Configuration config, bool in_isr=false)=0
设置 UART 配置 / Sets the UART configuration
WritePort * write_port_
写入端口 / Write port
UART(ReadPortType *read_port, WritePortType *write_port)
UART 构造函数 / UART constructor.
基于 SPSC 字节队列的写端口 / Write endpoint backed by an SPSC byte queue.
LibXR 命名空间 / LibXR namespace.
ErrorCode
定义错误码枚举 / Defines an enumeration for error codes
Operation< ErrorCode > ReadOperation
读操作的完成通知描述符 / Read completion descriptor.
Operation< ErrorCode > WriteOperation
写操作的完成通知描述符 / Write completion descriptor.
UART 配置结构体 / UART configuration structure.
uint8_t stop_bits
停止位长度 / Number of stop bits
uint32_t baudrate
波特率 / Baud rate