drv_uart.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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-01-09 Lyons first version
  9. */
  10. #ifndef __DRV_UART_H__
  11. #define __DRV_UART_H__
  12. #include "board.h"
  13. #include "drv_common.h"
  14. #ifdef RT_USING_SERIAL
  15. #ifndef HW_UART_BUS_CLOCK
  16. #define HW_UART_BUS_CLOCK 80000000
  17. #endif
  18. #define RT_SERIAL_CONFIG_115200N81 \
  19. { \
  20. BAUD_RATE_115200, \
  21. DATA_BITS_8, \
  22. STOP_BITS_1, \
  23. PARITY_NONE, \
  24. BIT_ORDER_LSB, \
  25. NRZ_NORMAL, \
  26. RT_SERIAL_RB_BUFSZ, \
  27. 0 \
  28. }
  29. struct imx_periph
  30. {
  31. rt_uint32_t paddr;
  32. rt_uint32_t vaddr;
  33. };
  34. struct imx_uart
  35. {
  36. struct rt_serial_device parent;
  37. const char *name;
  38. struct imx_periph periph;
  39. rt_uint32_t irqno;
  40. //[0]-tx [1]-rx
  41. struct imx6ull_iomuxc gpio[2];
  42. rt_uint32_t flag;
  43. struct serial_configure param;
  44. };
  45. #endif //#ifdef RT_USING_SERIAL
  46. #endif //#ifndef __DRV_UART_H__