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 12 #ifndef __DRV_USART_V2_H__ 13 #define __DRV_USART_V2_H__ 14 15 #include <rtthread.h> 16 #include <rtdevice.h> 17 #include "drv_dma.h" 18 19 struct at32_uart { 20 char *name; 21 usart_type *uart_x; 22 IRQn_Type irqn; 23 struct dma_config *dma_rx; 24 rt_size_t last_index; 25 struct dma_config *dma_tx; 26 rt_uint16_t uart_dma_flag; 27 struct rt_serial_device serial; 28 }; 29 30 int rt_hw_usart_init(void); 31 32 #endif /* __DRV_USART_V2_H__ */ 33 34 /******************* end of file *******************/ 35