libxr
Embedded C++ framework for bare-metal, RTOS and Linux
Loading...
Searching...
No Matches
LibXR::STM32GpdmaUartAdapter Class Reference

STM32 GPDMA 串口适配器 / STM32 GPDMA UART adapter. More...

#include <stm32_uart_gpdma.hpp>

Public Types

using AbortCallback = void (*)(DMA_HandleTypeDef*)
 

Public Member Functions

 STM32GpdmaUartAdapter (UART_HandleTypeDef *uart_handle)
 绑定已初始化的 UART 句柄 / Bind an initialized UART handle.
 
HAL_StatusTypeDef StartLinkedListDmaRx (uint8_t *buffer, size_t total_size, bool in_isr)
 构建或复用四节点循环链表并启动 RX / Build or reuse the four-node ring and start RX.
 
uint8_t * GetLinkedListDmaRxProducer () const
 读取一次当前 DMA 写入地址 / Read the current DMA destination address once.
 
void CloseTxTerminalSource () const
 
bool LaunchStop (DMA_HandleTypeDef *dma_handle, AbortCallback callback, bool in_isr)
 启动异步中止或接续已有中止 / Start an asynchronous abort or join an existing abort.
 
bool AllStopsComplete () const
 检查所有已配置的 DMA 通道均已停止 / Check all configured DMA channels have stopped.
 

Static Public Member Functions

static bool StopComplete (DMA_HandleTypeDef *dma_handle)
 检查通道及 HAL 链表均已停止 / Check that the channel and HAL list have stopped.
 
static void FinalizeStopped (DMA_HandleTypeDef *dma_handle, bool in_isr)
 在停止状态清除旧标志和链表计数 / Clear stale flags and list count while stopped.
 

Static Public Attributes

static constexpr size_t RX_NODE_COUNT = 4U
 

Detailed Description

STM32 GPDMA 串口适配器 / STM32 GPDMA UART adapter.

持有四个线性接收节点与循环链表,数据缓冲区由调用者提供。 Owns four linear RX nodes and their circular list; the caller supplies the payload.

Precondition
UART、DMA 句柄及缓冲区在传输期间有效且由本后端独占;相关 UART/DMA 中断具有相同抢占优先级,运行中的 DMA 中断必须使能。 UART/DMA handles and buffers remain valid and exclusively owned by this backend. Related UART/DMA IRQs share a preemption priority; active DMA IRQs must be enabled.

Definition at line 40 of file stm32_uart_gpdma.hpp.

Member Typedef Documentation

◆ AbortCallback

using LibXR::STM32GpdmaUartAdapter::AbortCallback = void (*)(DMA_HandleTypeDef*)

Definition at line 44 of file stm32_uart_gpdma.hpp.

Member Function Documentation

◆ CloseTxTerminalSource()

void LibXR::STM32GpdmaUartAdapter::CloseTxTerminalSource ( ) const

关闭 TX 完成中断,保留 DMA 请求位 / Disable TX completion IRQ, retaining DMA requests.

Member Data Documentation

◆ RX_NODE_COUNT

size_t LibXR::STM32GpdmaUartAdapter::RX_NODE_COUNT = 4U
staticconstexpr

Definition at line 43 of file stm32_uart_gpdma.hpp.


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