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

STM32 ADC 循环采样的 GPDMA 适配器 / GPDMA adapter for circular STM32 ADC sampling. More...

#include <stm32_adc_gpdma.hpp>

Public Member Functions

HAL_StatusTypeDef Start (ADC_HandleTypeDef *adc_handle, uint32_t *buffer, uint32_t sample_count, size_t buffer_size)
 挂接循环链表并启动 ADC DMA / Attach the circular list and start ADC DMA.
 
HAL_StatusTypeDef Stop (ADC_HandleTypeDef *adc_handle)
 停止 ADC DMA 并恢复 BSP 链表 / Stop ADC DMA and restore the BSP list.
 

Detailed Description

STM32 ADC 循环采样的 GPDMA 适配器 / GPDMA adapter for circular STM32 ADC sampling.

持有一个线性循环节点,采样缓冲区由调用者提供;启动时替换 BSP 链表,停止后恢复。 Owns one linear circular node while borrowing sample storage; replaces the BSP list on startup and restores it after stopping.

Note
由所属 STM32ADC 在构造时启动、析构时停止,期间独占对应 ADC/DMA 句柄。 Started by the owning STM32ADC constructor and stopped by its destructor, with exclusive ADC/DMA handle ownership throughout that lifetime.

Definition at line 29 of file stm32_adc_gpdma.hpp.

Member Function Documentation

◆ Start()

HAL_StatusTypeDef LibXR::STM32GpdmaAdcAdapter::Start ( ADC_HandleTypeDef * adc_handle,
uint32_t * buffer,
uint32_t sample_count,
size_t buffer_size )

挂接循环链表并启动 ADC DMA / Attach the circular list and start ADC DMA.

Parameters
adc_handle已关联静止循环链表的 ADC 句柄 / ADC handle with a stopped circular list.
bufferDMA 可访问的半字采样缓冲区 / DMA-accessible halfword sample storage.
sample_count每轮采样数,单位为半字 / Samples per cycle, in halfwords.
buffer_size缓冲区字节数 / Available buffer size in bytes.
Returns
HAL 启动结果 / HAL startup result.

◆ Stop()

HAL_StatusTypeDef LibXR::STM32GpdmaAdcAdapter::Stop ( ADC_HandleTypeDef * adc_handle)

停止 ADC DMA 并恢复 BSP 链表 / Stop ADC DMA and restore the BSP list.

Parameters
adc_handle启动时使用的 ADC 句柄 / ADC handle used at startup.
Returns
HAL 停止结果;失败时保留私有链表 / HAL stop result; retain the private list on failure.

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