5#include DEF2STR(LIBXR_CH32_CONFIG_FILE)
7#include "ch32_uart_def.hpp"
8#include "double_buffer.hpp"
9#include "libxr_def.hpp"
10#include "libxr_rw.hpp"
20 uint16_t tx_gpio_pin, GPIO_TypeDef *rx_gpio_port, uint16_t rx_gpio_pin,
21 uint32_t pin_remap = 0, uint32_t tx_queue_size = 5,
29 static void DmaIRQHandler(DMA_Channel_TypeDef *channel, ch32_uart_id_t
id);
41 size_t last_rx_pos_ = 0;
43 USART_TypeDef *instance_;
44 DMA_Channel_TypeDef *dma_rx_channel_;
45 DMA_Channel_TypeDef *dma_tx_channel_;
47 static CH32UART *map[CH32_UART_NUMBER];
ErrorCode SetConfig(UART::Configuration config)
设置 UART 配置 / Sets the UART configuration
双缓冲区管理类 / Double buffer manager class
原始数据封装类。 A class for encapsulating raw data.
ReadPort class for handling read operations.
通用异步收发传输(UART)基类 / Abstract base class for Universal Asynchronous Receiver-Transmitter (UART)
@ NO_PARITY
无校验 / No parity
WritePort class for handling write operations.
ErrorCode(* ReadFun)(ReadPort &port)
Function pointer type for read operations.
ErrorCode(* WriteFun)(WritePort &port)
Function pointer type for write operations.
UART 配置结构体 / UART configuration structure.