RTE_Device.h 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. /*
  2. * Copyright 2018-2020 NXP
  3. * All rights reserved.
  4. *
  5. *
  6. * SPDX-License-Identifier: BSD-3-Clause
  7. */
  8. #ifndef _RTE_DEVICE_H
  9. #define _RTE_DEVICE_H
  10. #include "pin_mux.h"
  11. /* Driver name mapping. */
  12. /* User needs to provide the implementation of LPUARTX_GetFreq/LPUARTX_InitPins/LPUARTX_DeinitPins for the enabled
  13. * LPUART instance. */
  14. #define RTE_USART1 1
  15. #define RTE_USART1_DMA_EN 0
  16. #define RTE_USART2 0
  17. #define RTE_USART2_DMA_EN 0
  18. #define RTE_USART3 0
  19. #define RTE_USART3_DMA_EN 0
  20. #define RTE_USART4 0
  21. #define RTE_USART4_DMA_EN 0
  22. #define RTE_USART5 0
  23. #define RTE_USART5_DMA_EN 0
  24. #define RTE_USART6 0
  25. #define RTE_USART6_DMA_EN 0
  26. #define RTE_USART7 0
  27. #define RTE_USART7_DMA_EN 0
  28. #define RTE_USART8 1
  29. #define RTE_USART8_DMA_EN 0
  30. /* UART configuration. */
  31. #define RTE_USART1_PIN_INIT LPUART1_InitPins
  32. #define RTE_USART1_PIN_DEINIT LPUART1_DeinitPins
  33. #define RTE_USART1_DMA_TX_CH 0
  34. #define RTE_USART1_DMA_TX_PERI_SEL (uint8_t) kDmaRequestMuxLPUART1Tx
  35. #if __CORTEX_M == 7
  36. #define RTE_USART1_DMA_TX_DMAMUX_BASE DMAMUX0
  37. #define RTE_USART1_DMA_TX_DMA_BASE DMA0
  38. #else
  39. #define RTE_USART1_DMA_TX_DMAMUX_BASE DMAMUX1
  40. #define RTE_USART1_DMA_TX_DMA_BASE DMA1
  41. #endif
  42. #define RTE_USART1_DMA_RX_CH 1
  43. #define RTE_USART1_DMA_RX_PERI_SEL (uint8_t) kDmaRequestMuxLPUART1Rx
  44. #if __CORTEX_M == 7
  45. #define RTE_USART1_DMA_RX_DMAMUX_BASE DMAMUX0
  46. #define RTE_USART1_DMA_RX_DMA_BASE DMA0
  47. #else
  48. #define RTE_USART1_DMA_RX_DMAMUX_BASE DMAMUX1
  49. #define RTE_USART1_DMA_RX_DMA_BASE DMA1
  50. #endif
  51. #define RTE_USART2_PIN_INIT LPUART2_InitPins
  52. #define RTE_USART2_PIN_DEINIT LPUART2_DeinitPins
  53. #define RTE_USART2_DMA_TX_CH 0
  54. #define RTE_USART2_DMA_TX_PERI_SEL (uint8_t) kDmaRequestMuxLPUART2Tx
  55. #if __CORTEX_M == 7
  56. #define RTE_USART2_DMA_TX_DMAMUX_BASE DMAMUX0
  57. #define RTE_USART2_DMA_TX_DMA_BASE DMA0
  58. #else
  59. #define RTE_USART2_DMA_TX_DMAMUX_BASE DMAMUX1
  60. #define RTE_USART2_DMA_TX_DMA_BASE DMA1
  61. #endif
  62. #define RTE_USART2_DMA_RX_CH 1
  63. #define RTE_USART2_DMA_RX_PERI_SEL (uint8_t) kDmaRequestMuxLPUART2Rx
  64. #if __CORTEX_M == 7
  65. #define RTE_USART2_DMA_RX_DMAMUX_BASE DMAMUX0
  66. #define RTE_USART2_DMA_RX_DMA_BASE DMA0
  67. #else
  68. #define RTE_USART2_DMA_RX_DMAMUX_BASE DMAMUX1
  69. #define RTE_USART2_DMA_RX_DMA_BASE DMA1
  70. #endif
  71. #define RTE_USART3_PIN_INIT LPUART3_InitPins
  72. #define RTE_USART3_PIN_DEINIT LPUART3_DeinitPins
  73. #define RTE_USART3_DMA_TX_CH 0
  74. #define RTE_USART3_DMA_TX_PERI_SEL (uint8_t) kDmaRequestMuxLPUART3Tx
  75. #if __CORTEX_M == 7
  76. #define RTE_USART3_DMA_TX_DMAMUX_BASE DMAMUX0
  77. #define RTE_USART3_DMA_TX_DMA_BASE DMA0
  78. #else
  79. #define RTE_USART3_DMA_TX_DMAMUX_BASE DMAMUX1
  80. #define RTE_USART3_DMA_TX_DMA_BASE DMA1
  81. #endif
  82. #define RTE_USART3_DMA_RX_CH 1
  83. #define RTE_USART3_DMA_RX_PERI_SEL (uint8_t) kDmaRequestMuxLPUART3Rx
  84. #if __CORTEX_M == 7
  85. #define RTE_USART3_DMA_RX_DMAMUX_BASE DMAMUX0
  86. #define RTE_USART3_DMA_RX_DMA_BASE DMA0
  87. #else
  88. #define RTE_USART3_DMA_RX_DMAMUX_BASE DMAMUX1
  89. #define RTE_USART3_DMA_RX_DMA_BASE DMA1
  90. #endif
  91. #define RTE_USART4_PIN_INIT LPUART4_InitPins
  92. #define RTE_USART4_PIN_DEINIT LPUART4_DeinitPins
  93. #define RTE_USART4_DMA_TX_CH 0
  94. #define RTE_USART4_DMA_TX_PERI_SEL (uint8_t) kDmaRequestMuxLPUART4Tx
  95. #if __CORTEX_M == 7
  96. #define RTE_USART4_DMA_TX_DMAMUX_BASE DMAMUX0
  97. #define RTE_USART4_DMA_TX_DMA_BASE DMA0
  98. #else
  99. #define RTE_USART4_DMA_TX_DMAMUX_BASE DMAMUX1
  100. #define RTE_USART4_DMA_TX_DMA_BASE DMA1
  101. #endif
  102. #define RTE_USART4_DMA_RX_CH 1
  103. #define RTE_USART4_DMA_RX_PERI_SEL (uint8_t) kDmaRequestMuxLPUART4Rx
  104. #if __CORTEX_M == 7
  105. #define RTE_USART4_DMA_RX_DMAMUX_BASE DMAMUX0
  106. #define RTE_USART4_DMA_RX_DMA_BASE DMA0
  107. #else
  108. #define RTE_USART4_DMA_RX_DMAMUX_BASE DMAMUX1
  109. #define RTE_USART4_DMA_RX_DMA_BASE DMA1
  110. #endif
  111. #define RTE_USART5_PIN_INIT LPUART5_InitPins
  112. #define RTE_USART5_PIN_DEINIT LPUART5_DeinitPins
  113. #define RTE_USART5_DMA_TX_CH 0
  114. #define RTE_USART5_DMA_TX_PERI_SEL (uint8_t) kDmaRequestMuxLPUART5Tx
  115. #if __CORTEX_M == 7
  116. #define RTE_USART5_DMA_TX_DMAMUX_BASE DMAMUX0
  117. #define RTE_USART5_DMA_TX_DMA_BASE DMA0
  118. #else
  119. #define RTE_USART5_DMA_TX_DMAMUX_BASE DMAMUX1
  120. #define RTE_USART5_DMA_TX_DMA_BASE DMA1
  121. #endif
  122. #define RTE_USART5_DMA_RX_CH 1
  123. #define RTE_USART5_DMA_RX_PERI_SEL (uint8_t) kDmaRequestMuxLPUART5Rx
  124. #if __CORTEX_M == 7
  125. #define RTE_USART5_DMA_RX_DMAMUX_BASE DMAMUX0
  126. #define RTE_USART5_DMA_RX_DMA_BASE DMA0
  127. #else
  128. #define RTE_USART5_DMA_RX_DMAMUX_BASE DMAMUX1
  129. #define RTE_USART5_DMA_RX_DMA_BASE DMA1
  130. #endif
  131. #define RTE_USART6_PIN_INIT LPUART6_InitPins
  132. #define RTE_USART6_PIN_DEINIT LPUART6_DeinitPins
  133. #define RTE_USART6_DMA_TX_CH 0
  134. #define RTE_USART6_DMA_TX_PERI_SEL (uint8_t) kDmaRequestMuxLPUART6Tx
  135. #if __CORTEX_M == 7
  136. #define RTE_USART6_DMA_TX_DMAMUX_BASE DMAMUX0
  137. #define RTE_USART6_DMA_TX_DMA_BASE DMA0
  138. #else
  139. #define RTE_USART6_DMA_TX_DMAMUX_BASE DMAMUX1
  140. #define RTE_USART6_DMA_TX_DMA_BASE DMA1
  141. #endif
  142. #define RTE_USART6_DMA_RX_CH 1
  143. #define RTE_USART6_DMA_RX_PERI_SEL (uint8_t) kDmaRequestMuxLPUART6Rx
  144. #if __CORTEX_M == 7
  145. #define RTE_USART6_DMA_RX_DMAMUX_BASE DMAMUX0
  146. #define RTE_USART6_DMA_RX_DMA_BASE DMA0
  147. #else
  148. #define RTE_USART6_DMA_RX_DMAMUX_BASE DMAMUX1
  149. #define RTE_USART6_DMA_RX_DMA_BASE DMA1
  150. #endif
  151. #define RTE_USART7_PIN_INIT LPUART7_InitPins
  152. #define RTE_USART7_PIN_DEINIT LPUART7_DeinitPins
  153. #define RTE_USART7_DMA_TX_CH 0
  154. #define RTE_USART7_DMA_TX_PERI_SEL (uint8_t) kDmaRequestMuxLPUART7Tx
  155. #if __CORTEX_M == 7
  156. #define RTE_USART7_DMA_TX_DMAMUX_BASE DMAMUX0
  157. #define RTE_USART7_DMA_TX_DMA_BASE DMA0
  158. #else
  159. #define RTE_USART7_DMA_TX_DMAMUX_BASE DMAMUX1
  160. #define RTE_USART7_DMA_TX_DMA_BASE DMA1
  161. #endif
  162. #define RTE_USART7_DMA_RX_CH 1
  163. #define RTE_USART7_DMA_RX_PERI_SEL (uint8_t) kDmaRequestMuxLPUART7Rx
  164. #if __CORTEX_M == 7
  165. #define RTE_USART7_DMA_RX_DMAMUX_BASE DMAMUX0
  166. #define RTE_USART7_DMA_RX_DMA_BASE DMA0
  167. #else
  168. #define RTE_USART7_DMA_RX_DMAMUX_BASE DMAMUX1
  169. #define RTE_USART7_DMA_RX_DMA_BASE DMA1
  170. #endif
  171. #define RTE_USART8_PIN_INIT LPUART8_InitPins
  172. #define RTE_USART8_PIN_DEINIT LPUART8_DeinitPins
  173. #define RTE_USART8_DMA_TX_CH 0
  174. #define RTE_USART8_DMA_TX_PERI_SEL (uint8_t) kDmaRequestMuxLPUART8Tx
  175. #if __CORTEX_M == 7
  176. #define RTE_USART8_DMA_TX_DMAMUX_BASE DMAMUX0
  177. #define RTE_USART8_DMA_TX_DMA_BASE DMA0
  178. #else
  179. #define RTE_USART8_DMA_TX_DMAMUX_BASE DMAMUX1
  180. #define RTE_USART8_DMA_TX_DMA_BASE DMA1
  181. #endif
  182. #define RTE_USART8_DMA_RX_CH 1
  183. #define RTE_USART8_DMA_RX_PERI_SEL (uint8_t) kDmaRequestMuxLPUART8Rx
  184. #if __CORTEX_M == 7
  185. #define RTE_USART8_DMA_RX_DMAMUX_BASE DMAMUX0
  186. #define RTE_USART8_DMA_RX_DMA_BASE DMA0
  187. #else
  188. #define RTE_USART8_DMA_RX_DMAMUX_BASE DMAMUX1
  189. #define RTE_USART8_DMA_RX_DMA_BASE DMA1
  190. #endif
  191. /* ENET configuration. */
  192. #define RTE_ENET 1
  193. #define RTE_ENET_PHY_ADDRESS 1
  194. #define RTE_ENET_MII 0
  195. #define RTE_ENET_RMII 1
  196. #define RTE_ENET_RGMII 1
  197. #endif /* _RTE_DEVICE_H */