drv_usart_v2.h 750 B

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