uart_config.h 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. * 2021-07-29 KyleChan first version
  9. */
  10. #ifndef __UART_CONFIG_H__
  11. #define __UART_CONFIG_H__
  12. #include <rtthread.h>
  13. #include "hal_data.h"
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif
  17. #if defined(BSP_USING_UART0)
  18. #ifndef UART0_CONFIG
  19. #define UART0_CONFIG \
  20. { \
  21. .name = "uart0", \
  22. .p_api_ctrl = &g_uart0_ctrl, \
  23. .p_cfg = &g_uart0_cfg, \
  24. }
  25. #endif /* UART0_CONFIG */
  26. #endif /* BSP_USING_UART0 */
  27. #if defined(BSP_USING_UART1)
  28. #ifndef UART1_CONFIG
  29. #define UART1_CONFIG \
  30. { \
  31. .name = "uart1", \
  32. .p_api_ctrl = &g_uart1_ctrl, \
  33. .p_cfg = &g_uart1_cfg, \
  34. }
  35. #endif /* UART1_CONFIG */
  36. #endif /* BSP_USING_UART1 */
  37. #if defined(BSP_USING_UART2)
  38. #ifndef UART2_CONFIG
  39. #define UART2_CONFIG \
  40. { \
  41. .name = "uart2", \
  42. .p_api_ctrl = &g_uart2_ctrl, \
  43. .p_cfg = &g_uart2_cfg, \
  44. }
  45. #endif /* UART2_CONFIG */
  46. #endif /* BSP_USING_UART2 */
  47. #if defined(BSP_USING_UART3)
  48. #ifndef UART3_CONFIG
  49. #define UART3_CONFIG \
  50. { \
  51. .name = "uart3", \
  52. .p_api_ctrl = &g_uart3_ctrl, \
  53. .p_cfg = &g_uart3_cfg, \
  54. }
  55. #endif /* UART3_CONFIG */
  56. #endif /* BSP_USING_UART3 */
  57. #if defined(BSP_USING_UART9)
  58. #ifndef UART9_CONFIG
  59. #define UART9_CONFIG \
  60. { \
  61. .name = "uart9", \
  62. .p_api_ctrl = &g_uart9_ctrl, \
  63. .p_cfg = &g_uart9_cfg, \
  64. }
  65. #endif /* UART9_CONFIG */
  66. #endif /* BSP_USING_UART9 */
  67. #ifdef __cplusplus
  68. }
  69. #endif
  70. #endif