drv_dma.h 1.4 KB

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