drv_usart.h 670 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. * 2020-03-04 shelton first version
  9. */
  10. #ifndef __DRV_UART_H__
  11. #define __DRV_UART_H__
  12. #include <rtthread.h>
  13. #include <rtdevice.h>
  14. #include "drv_dma.h"
  15. struct at32_uart {
  16. char *name;
  17. usart_type *uart_x;
  18. IRQn_Type irqn;
  19. struct dma_config *dma_rx;
  20. rt_size_t last_index;
  21. struct dma_config *dma_tx;
  22. rt_uint16_t uart_dma_flag;
  23. struct rt_serial_device serial;
  24. };
  25. int rt_hw_usart_init(void);
  26. #endif /* __DRV_USART_H__ */
  27. /******************* end of file *******************/