board_config.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. /*
  2. * Copyright (C) 2021, lizhengyang
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2021-09-02 lizhengyang first version
  9. */
  10. #ifndef __BOARD_CONFIG_H__
  11. #define __BOARD_CONFIG_H__
  12. #include <rtconfig.h>
  13. #include "hc32_ddl.h"
  14. /*********** Port configure *********/
  15. #if defined(BSP_USING_UART1)
  16. #define USART1_RX_PORT (PortD)
  17. #define USART1_RX_PIN (Pin00)
  18. #define USART1_TX_PORT (PortD)
  19. #define USART1_TX_PIN (Pin01)
  20. #endif
  21. #if defined(BSP_USING_UART2)
  22. #define USART2_RX_PORT (PortC)
  23. #define USART2_RX_PIN (Pin11)
  24. #define USART2_TX_PORT (PortC)
  25. #define USART2_TX_PIN (Pin12)
  26. #endif
  27. #if defined(BSP_USING_UART3)
  28. #define USART3_RX_PORT (PortB)
  29. #define USART3_RX_PIN (Pin08)
  30. #define USART3_TX_PORT (PortB)
  31. #define USART3_TX_PIN (Pin09)
  32. #endif
  33. #if defined(BSP_USING_UART4)
  34. #define USART4_RX_PORT (PortC)
  35. #define USART4_RX_PIN (Pin07)
  36. #define USART4_TX_PORT (PortC)
  37. #define USART4_TX_PIN (Pin06)
  38. #endif
  39. /*********** USART configure *********/
  40. #if defined(BSP_USING_UART1)
  41. #define USART1_RXERR_INT_IRQn (Int001_IRQn)
  42. #define USART1_RXERR_INT_PRIO (DDL_IRQ_PRIORITY_DEFAULT)
  43. #define USART1_RX_INT_IRQn (Int002_IRQn)
  44. #define USART1_RX_INT_PRIO (DDL_IRQ_PRIORITY_00)
  45. #endif
  46. #if defined(BSP_USING_UART2)
  47. #define USART2_RXERR_INT_IRQn (Int003_IRQn)
  48. #define USART2_RXERR_INT_PRIO (DDL_IRQ_PRIORITY_DEFAULT)
  49. #define USART2_RX_INT_IRQn (Int004_IRQn)
  50. #define USART2_RX_INT_PRIO (DDL_IRQ_PRIORITY_00)
  51. #endif
  52. #if defined(BSP_USING_UART3)
  53. #define USART3_RXERR_INT_IRQn (Int005_IRQn)
  54. #define USART3_RXERR_INT_PRIO (DDL_IRQ_PRIORITY_DEFAULT)
  55. #define USART3_RX_INT_IRQn (Int006_IRQn)
  56. #define USART3_RX_INT_PRIO (DDL_IRQ_PRIORITY_00)
  57. #endif
  58. #if defined(BSP_USING_UART4)
  59. #define USART4_RXERR_INT_IRQn (Int007_IRQn)
  60. #define USART4_RXERR_INT_PRIO (DDL_IRQ_PRIORITY_DEFAULT)
  61. #define USART4_RX_INT_IRQn (Int008_IRQn)
  62. #define USART4_RX_INT_PRIO (DDL_IRQ_PRIORITY_00)
  63. #endif
  64. /*********** Pin configure *********/
  65. #if defined(RT_USING_PIN)
  66. #define EXINT0_INT_IRQn (Int016_IRQn)
  67. #define EXINT0_INT_PRIO (DDL_IRQ_PRIORITY_DEFAULT)
  68. #define EXINT1_INT_IRQn (Int017_IRQn)
  69. #define EXINT1_INT_PRIO (DDL_IRQ_PRIORITY_DEFAULT)
  70. #define EXINT2_INT_IRQn (Int018_IRQn)
  71. #define EXINT2_INT_PRIO (DDL_IRQ_PRIORITY_DEFAULT)
  72. #define EXINT3_INT_IRQn (Int019_IRQn)
  73. #define EXINT3_INT_PRIO (DDL_IRQ_PRIORITY_DEFAULT)
  74. #define EXINT4_INT_IRQn (Int020_IRQn)
  75. #define EXINT4_INT_PRIO (DDL_IRQ_PRIORITY_DEFAULT)
  76. #define EXINT5_INT_IRQn (Int021_IRQn)
  77. #define EXINT5_INT_PRIO (DDL_IRQ_PRIORITY_DEFAULT)
  78. #define EXINT6_INT_IRQn (Int022_IRQn)
  79. #define EXINT6_INT_PRIO (DDL_IRQ_PRIORITY_DEFAULT)
  80. #define EXINT7_INT_IRQn (Int023_IRQn)
  81. #define EXINT7_INT_PRIO (DDL_IRQ_PRIORITY_DEFAULT)
  82. #define EXINT8_INT_IRQn (Int024_IRQn)
  83. #define EXINT8_INT_PRIO (DDL_IRQ_PRIORITY_DEFAULT)
  84. #define EXINT9_INT_IRQn (Int025_IRQn)
  85. #define EXINT9_INT_PRIO (DDL_IRQ_PRIORITY_DEFAULT)
  86. #define EXINT10_INT_IRQn (Int026_IRQn)
  87. #define EXINT10_INT_PRIO (DDL_IRQ_PRIORITY_DEFAULT)
  88. #define EXINT11_INT_IRQn (Int027_IRQn)
  89. #define EXINT11_INT_PRIO (DDL_IRQ_PRIORITY_DEFAULT)
  90. #define EXINT12_INT_IRQn (Int028_IRQn)
  91. #define EXINT12_INT_PRIO (DDL_IRQ_PRIORITY_DEFAULT)
  92. #define EXINT13_INT_IRQn (Int029_IRQn)
  93. #define EXINT13_INT_PRIO (DDL_IRQ_PRIORITY_DEFAULT)
  94. #define EXINT14_INT_IRQn (Int030_IRQn)
  95. #define EXINT14_INT_PRIO (DDL_IRQ_PRIORITY_DEFAULT)
  96. #define EXINT15_INT_IRQn (Int031_IRQn)
  97. #define EXINT15_INT_PRIO (DDL_IRQ_PRIORITY_DEFAULT)
  98. #endif
  99. #endif