uart_config.h 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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. * 2020-06-27 AHTYDHD the first version
  9. */
  10. #ifndef __UART_CONFIG_H__
  11. #define __UART_CONFIG_H__
  12. #ifdef __cplusplus
  13. extern "C" {
  14. #endif
  15. #if defined(BSP_USING_UART0)
  16. #ifndef UART0_CONFIG
  17. #define UART0_CONFIG \
  18. { \
  19. .name = "uart0", \
  20. .uartbase = UART0_BASE, \
  21. .baudrate = 115200, \
  22. .mode = UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | \
  23. UART_CONFIG_PAR_NONE \
  24. }
  25. #endif /* UART1_CONFIG */
  26. #endif /* BSP_USING_UART1*/
  27. #if defined(BSP_USING_UART1)
  28. #ifndef UART1_CONFIG
  29. #define UART1_CONFIG \
  30. { \
  31. .name = "uart1", \
  32. .uartbase = UART1_BASE, \
  33. .baudrate = 115200, \
  34. .mode = UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | \
  35. UART_CONFIG_PAR_NONE \
  36. }
  37. #endif /* UART1_CONFIG */
  38. #endif /* BSP_USING_UART1*/
  39. #if defined(BSP_USING_UART2)
  40. #ifndef UART2_CONFIG
  41. #define UART2_CONFIG \
  42. { \
  43. .name = "uart2", \
  44. .uartbase = UART2_BASE, \
  45. .baudrate = 115200, \
  46. .mode = UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | \
  47. UART_CONFIG_PAR_NONE \
  48. }
  49. #endif /* UART2_CONFIG */
  50. #endif /* BSP_USING_UART2*/
  51. #if defined(BSP_USING_UART3)
  52. #ifndef UART3_CONFIG
  53. #define UART3_CONFIG \
  54. { \
  55. .name = "uart3", \
  56. .uartbase = UART3_BASE, \
  57. .baudrate = 115200, \
  58. .mode = UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | \
  59. UART_CONFIG_PAR_NONE \
  60. }
  61. #endif /* UART3_CONFIG */
  62. #endif /* BSP_USING_UART3*/
  63. #ifdef __cplusplus
  64. }
  65. #endif
  66. #endif /* __UART_CONFIG_H__ */
  67. /************************** end of file ******************/