drivers: adc: stm32: use correct macros for dma transfer

Use the correct dedicated macros for enabling DMA transfer for STM32H7 and
U5.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
This commit is contained in:
Guillaume Gautier 2024-03-08 08:49:57 +01:00 committed by Anas Nashif
parent 7aa5d33a94
commit 3b50237699

View file

@ -221,12 +221,9 @@ static void adc_stm32_enable_dma_support(ADC_TypeDef *adc)
#if defined(ADC_VER_V5_V90)
if (adc == ADC3) {
LL_ADC_REG_SetDMATransferMode(adc,
ADC3_CFGR_DMACONTREQ(LL_ADC_REG_DMA_TRANSFER_LIMITED));
LL_ADC_EnableDMAReq(adc);
LL_ADC_REG_SetDMATransferMode(adc, LL_ADC3_REG_DMA_TRANSFER_LIMITED);
} else {
LL_ADC_REG_SetDataTransferMode(adc,
ADC_CFGR_DMACONTREQ(LL_ADC_REG_DMA_TRANSFER_LIMITED));
LL_ADC_REG_SetDataTransferMode(adc, LL_ADC_REG_DMA_TRANSFER_LIMITED);
}
#elif defined(ADC_VER_V5_X)
LL_ADC_REG_SetDataTransferMode(adc, LL_ADC_REG_DMA_TRANSFER_LIMITED);
@ -238,7 +235,15 @@ static void adc_stm32_enable_dma_support(ADC_TypeDef *adc)
#error "The STM32F1 ADC + DMA is not yet supported"
#else /* DT_HAS_COMPAT_STATUS_OKAY(st_stm32f1_adc) */
#elif defined(CONFIG_SOC_SERIES_STM32U5X) /* DT_HAS_COMPAT_STATUS_OKAY(st_stm32f1_adc) */
if (adc == ADC4) {
LL_ADC_REG_SetDMATransfer(adc, LL_ADC_REG_DMA_TRANSFER_LIMITED_ADC4);
} else {
LL_ADC_REG_SetDataTransferMode(adc, LL_ADC_REG_DMA_TRANSFER_LIMITED);
}
#else /* defined(CONFIG_SOC_SERIES_STM32U5X) */
/* Default mechanism for other MCUs */
LL_ADC_REG_SetDMATransfer(adc, LL_ADC_REG_DMA_TRANSFER_LIMITED);