drv_usart.h 658 B

123456789101112131415161718192021222324252627282930313233
  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-04 iysheng first version
  9. */
  10. #ifndef __USART_H__
  11. #define __USART_H__
  12. #include <rthw.h>
  13. #include <rtthread.h>
  14. /* GD32 uart driver */
  15. struct gd32_uart {
  16. USART_TypeDef * uart_periph;
  17. IRQn_Type irqn;
  18. rcu_periph_enum per_clk;
  19. rcu_periph_enum tx_gpio_clk;
  20. rcu_periph_enum rx_gpio_clk;
  21. GPIO_TypeDef * tx_port;
  22. GPIO_TypeDef * rx_port;
  23. uint16_t tx_pin;
  24. uint16_t rx_pin;
  25. struct rt_serial_device *serial;
  26. char *device_name;
  27. };
  28. #endif