dma_config.h 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. /*
  2. * Copyright (c) 2006-2023, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2019-01-02 zylx first version
  9. * 2019-01-08 SummerGift clean up the code
  10. * 2020-05-02 whj4674672 support stm32h7 dma1 and dma2
  11. */
  12. #ifndef __DMA_CONFIG_H__
  13. #define __DMA_CONFIG_H__
  14. #include <rtthread.h>
  15. #ifdef __cplusplus
  16. extern "C" {
  17. #endif
  18. /* DMA1 stream0 */
  19. #if defined(BSP_UART2_RX_USING_DMA) && !defined(UART2_RX_DMA_INSTANCE)
  20. #define UART2_DMA_RX_IRQHandler DMA1_Stream0_IRQHandler
  21. #define UART2_RX_DMA_RCC RCC_AHB1ENR_DMA1EN
  22. #define UART2_RX_DMA_INSTANCE DMA1_Stream0
  23. #define UART2_RX_DMA_REQUEST DMA_REQUEST_USART2_RX
  24. #define UART2_RX_DMA_IRQ DMA1_Stream0_IRQn
  25. #endif
  26. /* DMA1 stream1 */
  27. #if defined(BSP_UART2_TX_USING_DMA) && !defined(UART2_TX_DMA_INSTANCE)
  28. #define UART2_DMA_TX_IRQHandler DMA1_Stream1_IRQHandler
  29. #define UART2_TX_DMA_RCC RCC_AHB1ENR_DMA1EN
  30. #define UART2_TX_DMA_INSTANCE DMA1_Stream1
  31. #define UART2_TX_DMA_REQUEST DMA_REQUEST_USART2_TX
  32. #define UART2_TX_DMA_IRQ DMA1_Stream1_IRQn
  33. #endif
  34. /* DMA1 stream2 */
  35. #if defined(BSP_SPI3_RX_USING_DMA) && !defined(SPI3_RX_DMA_INSTANCE)
  36. #define SPI3_DMA_RX_IRQHandler DMA1_Stream2_IRQHandler
  37. #define SPI3_RX_DMA_RCC RCC_AHB1ENR_DMA1EN
  38. #define SPI3_RX_DMA_INSTANCE DMA1_Stream2
  39. #define SPI3_RX_DMA_IRQ DMA1_Stream2_IRQn
  40. #endif
  41. /* DMA1 stream3 */
  42. #if defined(BSP_SPI2_RX_USING_DMA) && !defined(SPI2_RX_DMA_INSTANCE)
  43. #define SPI2_DMA_RX_IRQHandler DMA1_Stream3_IRQHandler
  44. #define SPI2_RX_DMA_RCC RCC_AHB1ENR_DMA1EN
  45. #define SPI2_RX_DMA_INSTANCE DMA1_Stream3
  46. #define SPI2_RX_DMA_IRQ DMA1_Stream3_IRQn
  47. #endif
  48. /* DMA1 stream4 */
  49. #if defined(BSP_SPI2_TX_USING_DMA) && !defined(SPI2_TX_DMA_INSTANCE)
  50. #define SPI2_DMA_TX_IRQHandler DMA1_Stream4_IRQHandler
  51. #define SPI2_TX_DMA_RCC RCC_AHB1ENR_DMA1EN
  52. #define SPI2_TX_DMA_INSTANCE DMA1_Stream4
  53. #define SPI2_TX_DMA_IRQ DMA1_Stream4_IRQn
  54. #endif
  55. /* DMA1 stream5 */
  56. #if defined(BSP_SPI3_TX_USING_DMA) && !defined(SPI3_TX_DMA_INSTANCE)
  57. #define SPI3_DMA_TX_IRQHandler DMA1_Stream5_IRQHandler
  58. #define SPI3_TX_DMA_RCC RCC_AHB1ENR_DMA1EN
  59. #define SPI3_TX_DMA_INSTANCE DMA1_Stream5
  60. #define SPI3_TX_DMA_IRQ DMA1_Stream5_IRQn
  61. #endif
  62. /* DMA1 stream6 */
  63. /* DMA1 stream7 */
  64. #if defined(BSP_SPI3_TX_USING_DMA) && !defined(SPI3_TX_DMA_INSTANCE)
  65. #define SPI3_DMA_TX_IRQHandler DMA1_Stream7_IRQHandler
  66. #define SPI3_TX_DMA_RCC RCC_AHB1ENR_DMA1EN
  67. #define SPI3_TX_DMA_INSTANCE DMA1_Stream7
  68. #define SPI3_TX_DMA_IRQ DMA1_Stream7_IRQn
  69. #endif
  70. /* DMA2 stream0 */
  71. #if defined(BSP_SPI1_RX_USING_DMA) && !defined(SPI1_RX_DMA_INSTANCE)
  72. #define SPI1_DMA_RX_IRQHandler DMA2_Stream0_IRQHandler
  73. #define SPI1_RX_DMA_RCC RCC_AHB1ENR_DMA2EN
  74. #define SPI1_RX_DMA_INSTANCE DMA2_Stream0
  75. #define SPI1_RX_DMA_IRQ DMA2_Stream0_IRQn
  76. #endif
  77. /* DMA2 stream1 */
  78. #if defined(BSP_SPI4_TX_USING_DMA) && !defined(SPI4_TX_DMA_INSTANCE)
  79. #define SPI4_DMA_TX_IRQHandler DMA2_Stream1_IRQHandler
  80. #define SPI4_TX_DMA_RCC RCC_AHB1ENR_DMA2EN
  81. #define SPI4_TX_DMA_INSTANCE DMA2_Stream1
  82. #define SPI4_TX_DMA_IRQ DMA2_Stream1_IRQn
  83. #endif
  84. /* DMA2 stream2 */
  85. #if defined(BSP_SPI1_RX_USING_DMA) && !defined(SPI1_RX_DMA_INSTANCE)
  86. #define SPI1_DMA_RX_IRQHandler DMA2_Stream2_IRQHandler
  87. #define SPI1_RX_DMA_RCC RCC_AHB1ENR_DMA2EN
  88. #define SPI1_RX_DMA_INSTANCE DMA2_Stream2
  89. #define SPI1_RX_DMA_IRQ DMA2_Stream2_IRQn
  90. #endif
  91. /* DMA2 stream3 */
  92. #if defined(BSP_SPI5_RX_USING_DMA) && !defined(SPI5_RX_DMA_INSTANCE)
  93. #define SPI5_DMA_RX_IRQHandler DMA2_Stream3_IRQHandler
  94. #define SPI5_RX_DMA_RCC RCC_AHB1ENR_DMA2EN
  95. #define SPI5_RX_DMA_INSTANCE DMA2_Stream3
  96. #define SPI5_RX_DMA_IRQ DMA2_Stream3_IRQn
  97. #endif
  98. /* DMA2 stream4 */
  99. #if defined(BSP_SPI5_TX_USING_DMA) && !defined(SPI5_TX_DMA_INSTANCE)
  100. #define SPI5_DMA_TX_IRQHandler DMA2_Stream4_IRQHandler
  101. #define SPI5_TX_DMA_RCC RCC_AHB1ENR_DMA2EN
  102. #define SPI5_TX_DMA_INSTANCE DMA2_Stream4
  103. #define SPI5_TX_DMA_IRQ DMA2_Stream4_IRQn
  104. #endif
  105. /* DMA2 stream5 */
  106. #if defined(BSP_SPI1_TX_USING_DMA) && !defined(SPI1_TX_DMA_INSTANCE)
  107. #define SPI1_DMA_TX_IRQHandler DMA2_Stream5_IRQHandler
  108. #define SPI1_TX_DMA_RCC RCC_AHB1ENR_DMA2EN
  109. #define SPI1_TX_DMA_INSTANCE DMA2_Stream5
  110. #define SPI1_TX_DMA_IRQ DMA2_Stream5_IRQn
  111. #endif
  112. /* DMA2 stream6 */
  113. #if defined(BSP_SPI5_TX_USING_DMA) && !defined(SPI5_TX_DMA_INSTANCE)
  114. #define SPI5_DMA_TX_IRQHandler DMA2_Stream6_IRQHandler
  115. #define SPI5_TX_DMA_RCC RCC_AHB1ENR_DMA2EN
  116. #define SPI5_TX_DMA_INSTANCE DMA2_Stream6
  117. #define SPI5_TX_DMA_IRQ DMA2_Stream6_IRQn
  118. #endif
  119. /* DMA2 stream7 */
  120. #if defined(BSP_QSPI_USING_DMA) && !defined(QSPI_DMA_INSTANCE)
  121. #define QSPI_DMA_IRQHandler DMA2_Stream7_IRQHandler
  122. #define QSPI_DMA_RCC RCC_AHB1ENR_DMA2EN
  123. #define QSPI_DMA_INSTANCE DMA2_Stream7
  124. #define QSPI_DMA_IRQ DMA2_Stream7_IRQn
  125. #endif
  126. #ifdef __cplusplus
  127. }
  128. #endif
  129. #endif /* __DMA_CONFIG_H__ */