libxr  1.0
Want to be the best embedded framework
Loading...
Searching...
No Matches
LibXR::CH32UART Class Reference

CH32 UART 驱动实现 / CH32 UART driver implementation. More...

#include <ch32_uart.hpp>

Inheritance diagram for LibXR::CH32UART:
[legend]
Collaboration diagram for LibXR::CH32UART:
[legend]

Public Member Functions

 CH32UART (ch32_uart_id_t id, RawData dma_rx, RawData dma_tx, GPIO_TypeDef *tx_gpio_port, uint16_t tx_gpio_pin, GPIO_TypeDef *rx_gpio_port, uint16_t rx_gpio_pin, uint32_t pin_remap=0, uint32_t tx_queue_size=5, UART::Configuration config={115200, UART::Parity::NO_PARITY, 8, 1})
 构造 UART 对象 / Construct UART object
 
ErrorCode SetConfig (UART::Configuration config)
 设置 UART 配置 / Sets the UART configuration
 
void TxDmaIRQHandler ()
 
void RxDmaIRQHandler ()
 DMA中断处理函数
 
void OnRxDataAvailable (bool in_isr)
 
- Public Member Functions inherited from LibXR::UART
template<typename ReadPortType = ReadPort, typename WritePortType = WritePort>
 UART (ReadPortType *read_port, WritePortType *write_port)
 UART 构造函数 / UART constructor.
 
template<typename OperationType , typename = std::enable_if_t<std::is_base_of_v< WriteOperation, std::decay_t<OperationType>>>>
ErrorCode Write (ConstRawData data, OperationType &&op, bool in_isr=false)
 
template<typename OperationType , typename = std::enable_if_t<std::is_base_of_v< ReadOperation, std::decay_t<OperationType>>>>
ErrorCode Read (RawData data, OperationType &&op, bool in_isr=false)
 

Static Public Member Functions

static ErrorCode WriteFun (WritePort &port, bool in_isr)
 
static ErrorCode ReadFun (ReadPort &port, bool in_isr)
 

Data Fields

ch32_uart_id_t id_
 
uint16_t uart_mode_
 
ReadPort _read_port
 
WritePort _write_port
 
LatestSnapshot< UART::Configurationrequested_config_
 
UartRxConfigGate rx_config_gate_
 
UartCircularDmaRxModel rx_dma_model_
 
UartDmaTxModel< CH32UARTtx_dma_model_
 
USART_TypeDef * instance_
 
DMA_Channel_TypeDef * dma_rx_channel_
 
DMA_Channel_TypeDef * dma_tx_channel_
 
- Data Fields inherited from LibXR::UART
ReadPortread_port_
 读取端口 / Read port
 
WritePortwrite_port_
 写入端口 / Write port
 

Static Public Attributes

static CH32UARTmap_ [CH32_UART_NUMBER] = {nullptr}
 

Private Member Functions

void OnConfigRequested ()
 
bool ApplyPendingConfig (bool in_isr)
 
bool OnConfigApplied (bool)
 
void StartCircularDmaRx (uint8_t *data, size_t size)
 配置并启动 CH32 UART 循环 RX DMA 通道 / Configure and start the CH32 UART circular RX DMA channel
 
size_t GetCircularDmaRxRemaining () const
 获取 CH32 RX DMA 剩余传输计数 / Get the CH32 RX DMA remaining count
 
void PrepareCircularDmaRxForCpu (uint8_t *, size_t)
 为 CPU 访问准备 CH32 循环 DMA RX 存储区 / Prepare CH32 circular DMA RX storage for CPU access
 
bool StartDmaTx (uint8_t *data, size_t size, int block)
 配置并启动一个 active UART TX DMA 载荷 / Configure and start one active UART TX DMA payload
 

Friends

class UartCircularDmaRxModel
 
class UartDmaTxModel< CH32UART >
 

Additional Inherited Members

- Public Types inherited from LibXR::UART
enum class  Parity : uint8_t { NO_PARITY = 0 , EVEN = 1 , ODD = 2 }
 奇偶校验模式 / Parity mode More...
 

Detailed Description

CH32 UART 驱动实现 / CH32 UART driver implementation.

Warning
使用循环 RX DMA 时,USART/UART IDLE 中断与对应 RX DMA HT/TC 中断必须配置为 相同的抢占优先级。本驱动依赖该优先级契约保证所有 RX 事件入口不重入,使 RX model 保持唯一 producer。 When circular RX DMA is enabled, the USART/UART IDLE IRQ and its RX DMA HT/TC IRQ must use the same preemption priority and, on multicore devices, the same target core. This keeps all RX event entries one logical producer; runtime configuration may execute on another core and is coordinated separately by UartRxConfigGate.

Definition at line 28 of file ch32_uart.hpp.

Constructor & Destructor Documentation

◆ CH32UART()

CH32UART::CH32UART ( ch32_uart_id_t id,
RawData dma_rx,
RawData dma_tx,
GPIO_TypeDef * tx_gpio_port,
uint16_t tx_gpio_pin,
GPIO_TypeDef * rx_gpio_port,
uint16_t rx_gpio_pin,
uint32_t pin_remap = 0,
uint32_t tx_queue_size = 5,
UART::Configuration config = {115200, UART::Parity::NO_PARITY, 8, 1} )

构造 UART 对象 / Construct UART object

Definition at line 15 of file ch32_uart.cpp.

19 : UART(&_read_port, &_write_port),
20 id_(id),
21 _read_port(dma_rx.size_),
22 _write_port(tx_queue_size, dma_tx.size_ / 2),
23 requested_config_(config),
24 rx_dma_model_(dma_rx),
25 tx_dma_model_(*this, _write_port, dma_tx),
26 instance_(ch32_uart_get_instance_id(id)),
27 dma_rx_channel_(CH32_UART_RX_DMA_CHANNEL_MAP[id]),
28 dma_tx_channel_(CH32_UART_TX_DMA_CHANNEL_MAP[id])
29{
30 map_[id] = this;
31
32 bool tx_enable = dma_tx.size_ > 1;
33 bool rx_enable = dma_rx.size_ > 0;
34
35 ASSERT(tx_enable || rx_enable);
36 if (tx_enable)
37 {
38 ASSERT(dma_tx_channel_ != nullptr);
39 ASSERT(CH32_UART_TX_DMA_IT_MAP[id] != 0);
40 }
41 if (rx_enable)
42 {
43 ASSERT(dma_rx_channel_ != nullptr);
44 ASSERT(CH32_UART_RX_DMA_IT_TC_MAP[id] != 0);
45 ASSERT(CH32_UART_RX_DMA_IT_HT_MAP[id] != 0);
46 }
47
48 /* GPIO配置(TX: 推挽输出,RX: 悬空输入) */
49 GPIO_InitTypeDef gpio_init = {};
50 gpio_init.GPIO_Speed = GPIO_Speed_50MHz;
51
52 if (tx_enable)
53 {
54 RCC_APB2PeriphClockCmd(ch32_get_gpio_periph(tx_gpio_port), ENABLE);
55 gpio_init.GPIO_Pin = tx_gpio_pin;
56 gpio_init.GPIO_Mode = GPIO_Mode_AF_PP;
57 GPIO_Init(tx_gpio_port, &gpio_init);
58 (*write_port_) = WriteFun;
59 }
60
61 if (rx_enable)
62 {
63 RCC_APB2PeriphClockCmd(ch32_get_gpio_periph(rx_gpio_port), ENABLE);
64 gpio_init.GPIO_Pin = rx_gpio_pin;
65 gpio_init.GPIO_Mode = GPIO_Mode_IN_FLOATING;
66 GPIO_Init(rx_gpio_port, &gpio_init);
67 (*read_port_) = ReadFun;
68 }
69
70 /* 可选:引脚重映射 */
71 if (pin_remap != 0)
72 {
73 RCC_APB2PeriphClockCmd(RCC_APB2Periph_AFIO, ENABLE);
74 GPIO_PinRemapConfig(pin_remap, ENABLE);
75 }
76
77 /* 串口外设时钟使能 */
78 if (CH32_UART_APB_MAP[id] == 1)
79 {
80 RCC_APB1PeriphClockCmd(CH32_UART_RCC_PERIPH_MAP[id], ENABLE);
81 }
82 else if (CH32_UART_APB_MAP[id] == 2)
83 {
84 RCC_APB2PeriphClockCmd(CH32_UART_RCC_PERIPH_MAP[id], ENABLE);
85 }
86 else
87 {
88 ASSERT(false);
89 }
90 RCC_AHBPeriphClockCmd(CH32_UART_RCC_PERIPH_MAP_DMA[id], ENABLE);
91
92 // 3. USART 配置
93 USART_InitTypeDef usart_cfg = {};
94 usart_cfg.USART_BaudRate = config.baudrate;
95 usart_cfg.USART_StopBits =
96 (config.stop_bits == 2) ? USART_StopBits_2 : USART_StopBits_1;
97 switch (config.parity)
98 {
100 usart_cfg.USART_Parity = USART_Parity_No;
101 usart_cfg.USART_WordLength = USART_WordLength_8b;
102 break;
104 usart_cfg.USART_Parity = USART_Parity_Even;
105 usart_cfg.USART_WordLength = USART_WordLength_9b;
106 break;
108 usart_cfg.USART_Parity = USART_Parity_Odd;
109 usart_cfg.USART_WordLength = USART_WordLength_9b;
110 break;
111 default:
112 ASSERT(false);
113 }
114
115 usart_cfg.USART_HardwareFlowControl = USART_HardwareFlowControl_None;
116 usart_cfg.USART_Mode =
117 (tx_enable ? USART_Mode_Tx : 0) | (rx_enable ? USART_Mode_Rx : 0);
118 uart_mode_ = usart_cfg.USART_Mode;
119 USART_Init(instance_, &usart_cfg);
120
121 /* DMA 配置 */
122 DMA_InitTypeDef dma_init = {};
123 dma_init.DMA_PeripheralInc = DMA_PeripheralInc_Disable;
124 dma_init.DMA_MemoryInc = DMA_MemoryInc_Enable;
125 dma_init.DMA_PeripheralDataSize = DMA_PeripheralDataSize_Byte;
126 dma_init.DMA_MemoryDataSize = DMA_MemoryDataSize_Byte;
127 dma_init.DMA_Priority = DMA_Priority_High;
128 dma_init.DMA_M2M = DMA_M2M_Disable;
129
130 if (rx_enable)
131 {
132 ch32_dma_callback_t rx_cb_fun = [](void* arg)
133 { reinterpret_cast<CH32UART*>(arg)->RxDmaIRQHandler(); };
134
135 ch32_dma_register_callback(ch32_dma_get_id(CH32_UART_RX_DMA_CHANNEL_MAP[id]),
136 rx_cb_fun, this);
137
138 DMA_DeInit(dma_rx_channel_);
139 dma_init.DMA_PeripheralBaseAddr = (uint32_t)&instance_->DATAR;
140 dma_init.DMA_MemoryBaseAddr = (uint32_t)rx_dma_model_.Buffer();
141 dma_init.DMA_DIR = DMA_DIR_PeripheralSRC;
142 dma_init.DMA_Mode = DMA_Mode_Circular;
143 dma_init.DMA_BufferSize = rx_dma_model_.BufferSize();
144 DMA_Init(dma_rx_channel_, &dma_init);
145 rx_dma_model_.Start(*this);
146 DMA_ITConfig(dma_rx_channel_, DMA_IT_TC, ENABLE);
147 DMA_ITConfig(dma_rx_channel_, DMA_IT_HT, ENABLE);
148 USART_DMACmd(instance_, USART_DMAReq_Rx, ENABLE);
149 }
150
151 if (tx_enable)
152 {
153 ch32_dma_callback_t tx_cb_fun = [](void* arg)
154 { reinterpret_cast<CH32UART*>(arg)->TxDmaIRQHandler(); };
155
156 ch32_dma_register_callback(ch32_dma_get_id(CH32_UART_TX_DMA_CHANNEL_MAP[id]),
157 tx_cb_fun, this);
158 DMA_DeInit(dma_tx_channel_);
159 dma_init.DMA_PeripheralBaseAddr = (u32)(&instance_->DATAR);
160 dma_init.DMA_MemoryBaseAddr = 0;
161 dma_init.DMA_DIR = DMA_DIR_PeripheralDST;
162 dma_init.DMA_Mode = DMA_Mode_Normal;
163 dma_init.DMA_BufferSize = 0;
164 DMA_Init(dma_tx_channel_, &dma_init);
165 DMA_ITConfig(dma_tx_channel_, DMA_IT_TC, ENABLE);
166 USART_DMACmd(instance_, USART_DMAReq_Tx, ENABLE);
167 }
168
169 // 6. USART和相关中断
170 USART_Cmd(instance_, ENABLE);
171
172 if (rx_enable)
173 {
174 USART_ITConfig(instance_, USART_IT_IDLE, ENABLE);
175 NVIC_EnableIRQ(CH32_DMA_IRQ_MAP[ch32_dma_get_id(dma_rx_channel_)]);
176 }
177
178 if (tx_enable)
179 {
180 NVIC_EnableIRQ(CH32_DMA_IRQ_MAP[ch32_dma_get_id(dma_tx_channel_)]);
181 }
182
183 NVIC_EnableIRQ(CH32_UART_IRQ_MAP[id]);
184}
CH32 UART 驱动实现 / CH32 UART driver implementation.
Definition ch32_uart.hpp:29
void RxDmaIRQHandler()
DMA中断处理函数
size_t size_
数据字节数 / Data size in bytes
@ NO_PARITY
无校验 / No parity
@ ODD
奇校验 / Odd parity
@ EVEN
偶校验 / Even parity
UART(ReadPortType *read_port, WritePortType *write_port)
UART 构造函数 / UART constructor.
Definition uart.hpp:66
uint8_t * Buffer() const
获取 DMA 可写缓冲区起始地址 / Get the DMA-writable buffer start address
size_t BufferSize() const
获取循环 DMA 缓冲区容量 / Get the circular DMA buffer capacity
void Start(Backend &backend)
复位读取位置并启动循环 DMA / Reset the read position and start circular DMA
ErrorCode(* ReadFun)(ReadPort &port, bool in_isr)
Function pointer type for read notifications.
ErrorCode(* WriteFun)(WritePort &port, bool in_isr)
Function pointer type for write operations.
uint8_t stop_bits
停止位长度 / Number of stop bits
Definition uart.hpp:50
Parity parity
校验模式 / Parity mode
Definition uart.hpp:47
uint32_t baudrate
波特率 / Baud rate
Definition uart.hpp:45

Member Function Documentation

◆ ApplyPendingConfig()

bool CH32UART::ApplyPendingConfig ( bool in_isr)
private

Definition at line 204 of file ch32_uart.cpp.

205{
206 UNUSED(in_isr);
207 if (!rx_config_gate_.TryEnterConfig())
208 {
209 return false;
210 }
211
212 UART::Configuration config{};
213 (void)requested_config_.LoadLatest(config);
214
215 if (uart_mode_ & USART_Mode_Tx)
216 {
217 USART_DMACmd(instance_, USART_DMAReq_Tx, DISABLE);
218 DMA_Cmd(dma_tx_channel_, DISABLE);
219 DMA_ClearITPendingBit(CH32_UART_TX_DMA_IT_MAP[id_]);
220 }
221 if (uart_mode_ & USART_Mode_Rx)
222 {
223 USART_DMACmd(instance_, USART_DMAReq_Rx, DISABLE);
224 DMA_Cmd(dma_rx_channel_, DISABLE);
225 DMA_ClearITPendingBit(CH32_UART_RX_DMA_IT_HT_MAP[id_]);
226 DMA_ClearITPendingBit(CH32_UART_RX_DMA_IT_TC_MAP[id_]);
227 }
228
229 USART_InitTypeDef usart_cfg = {};
230 usart_cfg.USART_BaudRate = config.baudrate;
231 usart_cfg.USART_StopBits =
232 (config.stop_bits == 2) ? USART_StopBits_2 : USART_StopBits_1;
233
234 switch (config.parity)
235 {
237 usart_cfg.USART_Parity = USART_Parity_No;
238 usart_cfg.USART_WordLength = USART_WordLength_8b;
239 break;
241 usart_cfg.USART_Parity = USART_Parity_Even;
242 usart_cfg.USART_WordLength = USART_WordLength_9b;
243 break;
245 usart_cfg.USART_Parity = USART_Parity_Odd;
246 usart_cfg.USART_WordLength = USART_WordLength_9b;
247 break;
248 default:
249 ASSERT(false);
250 return true;
251 }
252
253 usart_cfg.USART_Mode = uart_mode_;
254 usart_cfg.USART_HardwareFlowControl = USART_HardwareFlowControl_None;
255 USART_DeInit(instance_);
256 USART_Init(instance_, &usart_cfg);
257
258 if (uart_mode_ & USART_Mode_Rx)
259 {
260 rx_dma_model_.Start(*this);
261 USART_DMACmd(instance_, USART_DMAReq_Rx, ENABLE);
262 USART_ITConfig(instance_, USART_IT_IDLE, ENABLE);
263 }
264
265 if (uart_mode_ & USART_Mode_Tx)
266 {
267 USART_DMACmd(instance_, USART_DMAReq_Tx, ENABLE);
268 }
269
270 USART_Cmd(instance_, ENABLE);
271 return true;
272}
UART 配置结构体 / UART configuration structure.
Definition uart.hpp:44

◆ GetCircularDmaRxRemaining()

size_t LibXR::CH32UART::GetCircularDmaRxRemaining ( ) const
inlinenodiscardprivate

获取 CH32 RX DMA 剩余传输计数 / Get the CH32 RX DMA remaining count

Returns
DMA 尚未写入的字节数 / Number of bytes not yet written by DMA

Definition at line 94 of file ch32_uart.hpp.

94{ return dma_rx_channel_->CNTR; }

◆ OnConfigApplied()

bool LibXR::CH32UART::OnConfigApplied ( bool )
inlineprivate

Definition at line 71 of file ch32_uart.hpp.

72 {
73 rx_config_gate_.LeaveConfig();
74 return true;
75 }

◆ OnConfigRequested()

void LibXR::CH32UART::OnConfigRequested ( )
inlineprivate

Definition at line 69 of file ch32_uart.hpp.

69{ rx_config_gate_.RequestConfig(); }

◆ OnRxDataAvailable()

void CH32UART::OnRxDataAvailable ( bool in_isr)

Definition at line 299 of file ch32_uart.cpp.

300{
301 if (!rx_config_gate_.TryEnterRx())
302 {
303 return;
304 }
305
306 rx_dma_model_.OnDataAvailable(*this, _read_port, in_isr);
307 if (rx_config_gate_.LeaveRx())
308 {
309 tx_dma_model_.RequestConfig(in_isr);
310 }
311}
void OnDataAvailable(Backend &backend, ReadPort &port, bool in_isr)
消费上次 DMA 事件后新产生的数据 / Consume bytes produced since the previous DMA event

◆ PrepareCircularDmaRxForCpu()

void LibXR::CH32UART::PrepareCircularDmaRxForCpu ( uint8_t * ,
size_t  )
inlineprivate

为 CPU 访问准备 CH32 循环 DMA RX 存储区 / Prepare CH32 circular DMA RX storage for CPU access

Parameters
dataDMA 接收缓冲区起始地址 / DMA receive buffer start address
size接收缓冲区字节数 / Receive buffer capacity in bytes
Note
该 CH32 缓冲区不需要缓存维护 / This CH32 buffer requires no cache maintenance

Definition at line 103 of file ch32_uart.hpp.

103{}

◆ ReadFun()

ErrorCode CH32UART::ReadFun ( ReadPort & port,
bool in_isr )
static

Definition at line 291 of file ch32_uart.cpp.

292{
293 // 接收由 IDLE 中断驱动,读取在 ISR 中完成
294 return ErrorCode::PENDING;
295}
@ PENDING
等待中 | Pending

◆ RxDmaIRQHandler()

void CH32UART::RxDmaIRQHandler ( )

DMA中断处理函数

如果DMA中断触发,且中断状态为半满或传输完成,清除中断标志, 并调用对应的中断处理函数

Parameters
[in]idUART的ID

Definition at line 362 of file ch32_uart.cpp.

363{
364 if (DMA_GetITStatus(CH32_UART_RX_DMA_IT_HT_MAP[id_]) == SET)
365 {
366 DMA_ClearITPendingBit(CH32_UART_RX_DMA_IT_HT_MAP[id_]);
367 ch32_uart_rx_isr_handler(this);
368 }
369
370 if (DMA_GetITStatus(CH32_UART_RX_DMA_IT_TC_MAP[id_]) == SET)
371 {
372 DMA_ClearITPendingBit(CH32_UART_RX_DMA_IT_TC_MAP[id_]);
373 ch32_uart_rx_isr_handler(this);
374 }
375}

◆ SetConfig()

ErrorCode CH32UART::SetConfig ( UART::Configuration config)
virtual

设置 UART 配置 / Sets the UART configuration

Parameters
configUART 配置信息 / UART configuration settings
Returns
返回操作状态,成功时返回 ErrorCode::OK,否则返回相应错误码 / Returns the operation status, ErrorCode::OK if successful, otherwise an error code

该方法为纯虚函数,子类必须实现具体的 UART 配置逻辑。 This is a pure virtual function. Subclasses must implement the specific UART configuration logic.

Implements LibXR::UART.

Definition at line 187 of file ch32_uart.cpp.

188{
189 if ((config.stop_bits != 1U) && (config.stop_bits != 2U))
190 {
191 return ErrorCode::ARG_ERR;
192 }
193 if ((config.parity != UART::Parity::NO_PARITY) &&
194 (config.parity != UART::Parity::EVEN) && (config.parity != UART::Parity::ODD))
195 {
196 return ErrorCode::ARG_ERR;
197 }
198
199 requested_config_.Store(config);
200 tx_dma_model_.RequestConfig(false);
201 return ErrorCode::OK;
202}
@ OK
操作成功 | Operation successful
@ ARG_ERR
参数错误 | Argument error

◆ StartCircularDmaRx()

void LibXR::CH32UART::StartCircularDmaRx ( uint8_t * data,
size_t size )
inlineprivate

配置并启动 CH32 UART 循环 RX DMA 通道 / Configure and start the CH32 UART circular RX DMA channel

Parameters
dataDMA 可写的接收缓冲区 / DMA-writable receive buffer
size接收缓冲区字节数 / Receive buffer capacity in bytes

Definition at line 83 of file ch32_uart.hpp.

84 {
85 dma_rx_channel_->MADDR = reinterpret_cast<uint32_t>(data);
86 dma_rx_channel_->CNTR = size;
87 DMA_Cmd(dma_rx_channel_, ENABLE);
88 }

◆ StartDmaTx()

bool CH32UART::StartDmaTx ( uint8_t * data,
size_t size,
int block )
private

配置并启动一个 active UART TX DMA 载荷 / Configure and start one active UART TX DMA payload

Parameters
dataDMA 可读的载荷缓冲区 / DMA-readable payload buffer
size载荷字节数 / Payload size in bytes
blockactive 双缓冲块索引,CH32 DMA 不使用 / Active double-buffer block index, unused by CH32 DMA
Returns
DMA 通道启用后返回 true / True after the DMA channel is enabled

Definition at line 281 of file ch32_uart.cpp.

282{
283 DMA_Cmd(dma_tx_channel_, DISABLE);
284 dma_tx_channel_->MADDR = reinterpret_cast<uint32_t>(data);
285 dma_tx_channel_->CNTR = size;
286 DMA_Cmd(dma_tx_channel_, ENABLE);
287 return true;
288}

◆ TxDmaIRQHandler()

void CH32UART::TxDmaIRQHandler ( )

Definition at line 341 of file ch32_uart.cpp.

342{
343 if (DMA_GetITStatus(CH32_UART_TX_DMA_IT_MAP[id_]) == RESET)
344 {
345 return;
346 }
347
348 if (dma_tx_channel_->CNTR == 0)
349 {
350 ch32_uart_isr_handler_tx_cplt(this);
351 }
352}

◆ WriteFun()

ErrorCode CH32UART::WriteFun ( WritePort & port,
bool in_isr )
static

Definition at line 275 of file ch32_uart.cpp.

276{
277 auto* uart = LibXR::ContainerOf(&port, &CH32UART::_write_port);
278 return uart->tx_dma_model_.Submit(in_isr);
279}
OwnerType * ContainerOf(MemberType *ptr, MemberType OwnerType::*member) noexcept
通过成员指针恢复其所属对象指针

Friends And Related Symbol Documentation

◆ UartCircularDmaRxModel

friend class UartCircularDmaRxModel
friend

Definition at line 30 of file ch32_uart.hpp.

◆ UartDmaTxModel< CH32UART >

friend class UartDmaTxModel< CH32UART >
friend

Definition at line 30 of file ch32_uart.hpp.

Field Documentation

◆ _read_port

ReadPort LibXR::CH32UART::_read_port

Definition at line 54 of file ch32_uart.hpp.

◆ _write_port

WritePort LibXR::CH32UART::_write_port

Definition at line 55 of file ch32_uart.hpp.

◆ dma_rx_channel_

DMA_Channel_TypeDef* LibXR::CH32UART::dma_rx_channel_

Definition at line 63 of file ch32_uart.hpp.

◆ dma_tx_channel_

DMA_Channel_TypeDef* LibXR::CH32UART::dma_tx_channel_

Definition at line 64 of file ch32_uart.hpp.

◆ id_

ch32_uart_id_t LibXR::CH32UART::id_

Definition at line 51 of file ch32_uart.hpp.

◆ instance_

USART_TypeDef* LibXR::CH32UART::instance_

Definition at line 62 of file ch32_uart.hpp.

◆ map_

CH32UART * CH32UART::map_ = {nullptr}
static

Definition at line 66 of file ch32_uart.hpp.

◆ requested_config_

LatestSnapshot<UART::Configuration> LibXR::CH32UART::requested_config_

Definition at line 57 of file ch32_uart.hpp.

◆ rx_config_gate_

UartRxConfigGate LibXR::CH32UART::rx_config_gate_

Definition at line 58 of file ch32_uart.hpp.

◆ rx_dma_model_

UartCircularDmaRxModel LibXR::CH32UART::rx_dma_model_

Definition at line 59 of file ch32_uart.hpp.

◆ tx_dma_model_

UartDmaTxModel<CH32UART> LibXR::CH32UART::tx_dma_model_

Definition at line 60 of file ch32_uart.hpp.

◆ uart_mode_

uint16_t LibXR::CH32UART::uart_mode_

Definition at line 52 of file ch32_uart.hpp.


The documentation for this class was generated from the following files: