Statically-allocated circular DMA UART RX buffer.
More...
#include <DmaUartAdapter.hpp>
|
| const uint8_t * | dmaBuffer () const noexcept |
| | Const pointer to raw memory buffer.
|
| |
| uint8_t * | dmaBuffer () noexcept |
| | Direct pointer to raw memory buffer for DMA peripheral configuration (e.g. HAL_UART_Receive_DMA).
|
| |
| constexpr | DmaUartRxBuffer ()=default |
| |
| template<typename Callback > |
| void | processAvailableBytes (std::size_t currentDmaWriteIndex, Callback &&onPacket) |
| | Update tail position based on hardware DMA counter and extract available bytes. Typically invoked from UART Idle Line ISR or DMA Half/Full Transfer ISR.
|
| |
| void | reset () noexcept |
| | Reset circular tail index.
|
| |
| std::size_t | tail () const noexcept |
| | Current tail index in the circular buffer.
|
| |
|
| static constexpr std::size_t | capacity () noexcept |
| | Capacity of circular DMA buffer in bytes.
|
| |
template<std::size_t BufferSize = 512>
class corium::embedded::DmaUartRxBuffer< BufferSize >
Statically-allocated circular DMA UART RX buffer.
- Template Parameters
-
| BufferSize | Circular buffer capacity in bytes (must be power of two). |
◆ DmaUartRxBuffer()
template<std::size_t BufferSize = 512>
◆ capacity()
template<std::size_t BufferSize = 512>
|
|
inlinestaticconstexprnoexcept |
Capacity of circular DMA buffer in bytes.
◆ dmaBuffer() [1/2]
template<std::size_t BufferSize = 512>
Const pointer to raw memory buffer.
◆ dmaBuffer() [2/2]
template<std::size_t BufferSize = 512>
Direct pointer to raw memory buffer for DMA peripheral configuration (e.g. HAL_UART_Receive_DMA).
◆ processAvailableBytes()
template<std::size_t BufferSize = 512>
template<typename Callback >
Update tail position based on hardware DMA counter and extract available bytes. Typically invoked from UART Idle Line ISR or DMA Half/Full Transfer ISR.
- Parameters
-
| currentDmaWriteIndex | Current hardware DMA write index (e.g. BufferSize - __HAL_DMA_GET_COUNTER(hdma)). |
| onPacket | Extracted byte span callback: void(std::span<const uint8_t> data). |
◆ reset()
template<std::size_t BufferSize = 512>
Reset circular tail index.
◆ tail()
template<std::size_t BufferSize = 512>
Current tail index in the circular buffer.
The documentation for this class was generated from the following file: