drv_dma.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. */
  11. #ifndef __DRV_DMA_H__
  12. #define __DRV_DMA_H__
  13. #ifdef __cplusplus
  14. extern "C" {
  15. #endif
  16. #include <rtdevice.h>
  17. #include <rtthread.h>
  18. #include "drv_common.h"
  19. #define DMA_GLO_FLAG 0x0001U
  20. #define DMA_FDT_FLAG 0x0002U
  21. #define DMA_HDT_FLAG 0x0004U
  22. #define DMA_DTE_FLAG 0x0008U
  23. struct dma_config {
  24. dma_type *dma_x;
  25. rt_uint8_t channel_index;
  26. rt_bool_t dma_done;
  27. dma_channel_type *dma_channel;
  28. crm_periph_clock_type dma_clock;
  29. IRQn_Type dma_irqn;
  30. #if defined (SOC_SERIES_AT32F425)
  31. rt_uint8_t flex_channel;
  32. rt_uint32_t request_id;
  33. #endif
  34. #if defined (SOC_SERIES_AT32F435) || defined (SOC_SERIES_AT32F437)
  35. dmamux_channel_type *dmamux_channel;
  36. rt_uint32_t request_id;
  37. #endif
  38. };
  39. #ifdef __cplusplus
  40. }
  41. #endif
  42. #endif /*__DRV_DMA_H__ */
  43. /************************** end of file ******************/