drivers: dma: stm32 dma driver using DT compat macro
Controlling the DMA offset for the request, relies on the dma version different from V1 Signed-off-by: Francois Ramu <francois.ramu@st.com>
This commit is contained in:
parent
6b67a568c9
commit
6312b7383d
2 changed files with 3 additions and 5 deletions
|
@ -462,14 +462,12 @@ DMA_STM32_EXPORT_API int dma_stm32_configure(const struct device *dev,
|
|||
config->dest_data_size;
|
||||
}
|
||||
|
||||
#if defined(CONFIG_DMA_STM32_V2) || defined(CONFIG_DMAMUX_STM32)
|
||||
#if DT_HAS_COMPAT_STATUS_OKAY(st_stm32_dma_v2) || DT_HAS_COMPAT_STATUS_OKAY(st_stm32_dmamux)
|
||||
/*
|
||||
* the with dma V2 and dma mux,
|
||||
* the request ID is stored in the dma_slot
|
||||
*/
|
||||
#if !defined(CONFIG_SOC_SERIES_STM32F0X) || defined(CONFIG_SOC_STM32F030XC)
|
||||
DMA_InitStruct.PeriphRequest = config->dma_slot;
|
||||
#endif
|
||||
#endif
|
||||
LL_DMA_Init(dma, dma_stm32_id_to_stream(id), &DMA_InitStruct);
|
||||
|
||||
|
|
|
@ -44,14 +44,14 @@ struct dma_stm32_config {
|
|||
struct dma_stm32_stream *streams;
|
||||
};
|
||||
|
||||
#if defined(CONFIG_DMAMUX_STM32) || defined(CONFIG_DMA_STM32_V2)
|
||||
#if !defined(CONFIG_DMA_STM32_V1)
|
||||
/* from DTS the dma stream id is in range 1..<dma-requests> */
|
||||
/* so decrease to set range from 0 from now on */
|
||||
#define STREAM_OFFSET 1
|
||||
#else
|
||||
/* from DTS the dma stream id is in range 0..<dma-requests>-1 */
|
||||
#define STREAM_OFFSET 0
|
||||
#endif /* CONFIG_DMAMUX_STM32 || CONFIG_DMA_STM32_V2 */
|
||||
#endif /* ! CONFIG_DMA_STM32_V1 */
|
||||
|
||||
uint32_t dma_stm32_id_to_stream(uint32_t id);
|
||||
#if !defined(CONFIG_DMAMUX_STM32)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue