13#if defined(STM32) && defined(HAL_ADC_MODULE_ENABLED)
16LinkedQueue<Stm32AnalogInDma> Stm32AnalogInDma::m_queue;
18: m_hwHandle(&hwHandle)
25 SEMF_INFO(
"start data: %p, size: %u", buffer, bufferSize);
27#if !defined(STM32F4) && !defined STM32F7
28 if (m_hwHandle->DMA_Handle && m_hwHandle->DMA_Handle->Init.MemDataAlignment)
29 bufferSize /= (m_hwHandle->DMA_Handle->Init.MemDataAlignment >> (DMA_CCR_MSIZE_Pos - 1));
32 HAL_StatusTypeDef state = HAL_ADC_Start_DMA(m_hwHandle,
reinterpret_cast<uint32_t*
>(buffer),
static_cast<uint32_t
>(bufferSize));
35 if (state == HAL_ERROR)
40 else if (state == HAL_BUSY)
45 else if (state == HAL_TIMEOUT)
57 HAL_StatusTypeDef state = HAL_ADC_Stop_DMA(m_hwHandle);
60 if (state == HAL_ERROR)
65 else if (state == HAL_BUSY)
70 else if (state == HAL_TIMEOUT)
99 if (&adc == m_hwHandle)
108 if (&adc == m_hwHandle)
Class for representing errors. Every error should have a unique source code. As a user feel encourage...
LinkedQueue is an managed single linked queue implementation.
void isrError(ADC_HandleTypeDef &adc)
Sending a error signal.
static void systemIsr(ADC_HandleTypeDef &adc)
System-wide interrupt service routine for adc conversion finished.
void isr(ADC_HandleTypeDef &adc)
Interrupt service routine for adc conversion finished.
Stm32AnalogInDma(ADC_HandleTypeDef &hwHandle)
Constructor.
static void systemIsrError(ADC_HandleTypeDef &adc)
System-wide interrupt service routine for adc error.
void start(uint8_t buffer[], size_t bufferSize) override
Starts the hardware modules (ADC with DMA) for reading ADC values.
static LinkedQueue< Stm32AnalogInDma > * queue()
Get the list with all analog ins.