|
Zephyr API 3.6.99
|
Loading...
Searching...
No Matches
Go to the documentation of this file.
7#ifndef ZEPHYR_INCLUDE_DRIVERS_DMA_STM32_H_
8#define ZEPHYR_INCLUDE_DRIVERS_DMA_STM32_H_
13#define STM32_DMA_HAL_OVERRIDE 0x7F
18#if defined(CONFIG_DMA_STM32U5)
20#define STM32_DMA_STREAM_OFFSET 0
21#elif !defined(CONFIG_DMA_STM32_V1)
24#define STM32_DMA_STREAM_OFFSET 1
25#elif defined(CONFIG_DMA_STM32_V1) && defined(CONFIG_DMAMUX_STM32)
27#define STM32_DMA_STREAM_OFFSET 1
30#define STM32_DMA_STREAM_OFFSET 0
34#if DT_HAS_COMPAT_STATUS_OKAY(st_stm32_dma_v2bis)
35#define STM32_DMA_SLOT(id, dir, slot) 0
36#define STM32_DMA_SLOT_BY_IDX(id, idx, slot) 0
38#define STM32_DMA_SLOT(id, dir, slot) DT_INST_DMAS_CELL_BY_NAME(id, dir, slot)
39#define STM32_DMA_SLOT_BY_IDX(id, idx, slot) DT_INST_DMAS_CELL_BY_IDX(id, idx, slot)
42#if DT_HAS_COMPAT_STATUS_OKAY(st_stm32_dma_v2) || \
43 DT_HAS_COMPAT_STATUS_OKAY(st_stm32_dma_v2bis) || \
44 DT_HAS_COMPAT_STATUS_OKAY(st_stm32_dmamux)
45#define STM32_DMA_FEATURES(id, dir) 0
47#define STM32_DMA_FEATURES(id, dir) \
48 DT_INST_DMAS_CELL_BY_NAME(id, dir, features)
51#define STM32_DMA_CTLR(id, dir) \
52 DT_INST_DMAS_CTLR_BY_NAME(id, dir)
53#define STM32_DMA_CHANNEL_CONFIG(id, dir) \
54 DT_INST_DMAS_CELL_BY_NAME(id, dir, channel_config)
55#define STM32_DMA_CHANNEL_CONFIG_BY_IDX(id, idx) \
56 DT_INST_DMAS_CELL_BY_IDX(id, idx, channel_config)
61#define STM32_DMA_CONFIG_DIRECTION(config) ((config >> 6) & 0x3)
63#define STM32_DMA_CONFIG_PERIPHERAL_ADDR_INC(config) ((config >> 9) & 0x1)
65#define STM32_DMA_CONFIG_MEMORY_ADDR_INC(config) ((config >> 10) & 0x1)
68#define STM32_DMA_CONFIG_PERIPHERAL_DATA_SIZE(config) \
69 (1 << ((config >> 11) & 0x3))
72#define STM32_DMA_CONFIG_MEMORY_DATA_SIZE(config) \
73 (1 << ((config >> 13) & 0x3))
75#define STM32_DMA_CONFIG_PERIPHERAL_INC_FIXED(config) ((config >> 15) & 0x1)
77#define STM32_DMA_CONFIG_PRIORITY(config) ((config >> 16) & 0x3)
80#if DT_HAS_COMPAT_STATUS_OKAY(st_stm32_dma_v1)
81#define STM32_DMA_FEATURES_FIFO_THRESHOLD(features) (features & 0x3)
83#define STM32_DMA_FEATURES_FIFO_THRESHOLD(features) 0