1 /*
2  * Copyright (c) 2006-2021, RT-Thread Development Team
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  *
6  * Change Logs:
7  * Date           Author       Notes
8  * 2022-11-09     shelton      first version
9  * 2023-01-31     shelton      add support f421/f425
10  * 2023-04-08     shelton      add support f423
11  * 2024-04-12     shelton      add support a403a and a423
12  * 2024-08-30     shelton      add support m412 and m416
13  * 2024-12-18     shelton      add support f455/f456 and f457
14  */
15 
16 #ifndef __DRV_DMA_H__
17 #define __DRV_DMA_H__
18 
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22 
23 #include <rtdevice.h>
24 #include <rtthread.h>
25 #include "drv_common.h"
26 
27 #define DMA_GLO_FLAG                    0x0001U
28 #define DMA_FDT_FLAG                    0x0002U
29 #define DMA_HDT_FLAG                    0x0004U
30 #define DMA_DTE_FLAG                    0x0008U
31 
32 struct dma_config {
33     dma_type *dma_x;
34     rt_uint8_t channel_index;
35     rt_bool_t dma_done;
36     dma_channel_type *dma_channel;
37     crm_periph_clock_type dma_clock;
38     IRQn_Type dma_irqn;
39 #if defined (SOC_SERIES_AT32F425)
40     rt_uint8_t flex_channel;
41     rt_uint32_t request_id;
42 #endif
43 #if defined (SOC_SERIES_AT32F435) || defined (SOC_SERIES_AT32F437) || \
44     defined (SOC_SERIES_AT32F423) || defined (SOC_SERIES_AT32F402) || \
45     defined (SOC_SERIES_AT32F405) || defined (SOC_SERIES_AT32A423) || \
46     defined (SOC_SERIES_AT32M412) || defined (SOC_SERIES_AT32M416) || \
47     defined (SOC_SERIES_AT32F455) || defined (SOC_SERIES_AT32F456) || \
48     defined (SOC_SERIES_AT32F457)
49     dmamux_channel_type *dmamux_channel;
50     rt_uint32_t request_id;
51 #endif
52 };
53 
54 #ifdef __cplusplus
55 }
56 #endif
57 
58 #endif /*__DRV_DMA_H__ */
59 
60 /************************** end of file ******************/
61