Skip to content

Commit 64149e4

Browse files
Alain Volmatnashif
authored andcommitted
video: stm32_dcmi: addition of STM32L4 DMA support
The STM32 DMA LL api differ between the STM32F7 and the STM32L4 in order to get the CHANNEL instance information. For that reason, enclose within preproc statements STM32F7 specific code and add STM32L4 code related to the DMA configuration for the DCMI peripheral. Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
1 parent b03ec6d commit 64149e4

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

drivers/video/video_stm32_dcmi.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,10 +156,16 @@ static int stm32_dma_init(const struct device *dev)
156156
hdma.Init.MemDataAlignment = DMA_MDATAALIGN_WORD;
157157
hdma.Init.Mode = DMA_CIRCULAR;
158158
hdma.Init.Priority = DMA_PRIORITY_HIGH;
159+
#if defined(CONFIG_SOC_SERIES_STM32F7X)
159160
hdma.Init.FIFOMode = DMA_FIFOMODE_DISABLE;
161+
#endif
160162

163+
#if defined(CONFIG_SOC_SERIES_STM32F7X)
161164
hdma.Instance = __LL_DMA_GET_STREAM_INSTANCE(config->dma.reg,
162165
config->dma.channel);
166+
#elif defined(CONFIG_SOC_SERIES_STM32L4X)
167+
hdma.Instance = __LL_DMA_GET_CHANNEL_INSTANCE(config->dma.reg, config->dma.channel);
168+
#endif
163169

164170
/* Initialize DMA HAL */
165171
__HAL_LINKDMA(&data->hdcmi, DMA_Handle, hdma);

0 commit comments

Comments
 (0)