2023-02-23 15:42:30 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2006-2021, RT-Thread Development Team
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*
|
|
|
|
* Change Logs:
|
|
|
|
* Date Author Notes
|
|
|
|
* 2023-02-23 Jonas first version
|
2023-04-14 00:35:07 +08:00
|
|
|
* 2023-04-16 shelton update for perfection of drv_usart_v2
|
2023-02-23 15:42:30 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __DRV_USART_V2_H__
|
|
|
|
#define __DRV_USART_V2_H__
|
|
|
|
|
|
|
|
#include <rtthread.h>
|
|
|
|
#include <rtdevice.h>
|
2023-04-14 00:35:07 +08:00
|
|
|
#include "drv_dma.h"
|
2023-02-23 15:42:30 +08:00
|
|
|
|
2023-04-14 00:35:07 +08:00
|
|
|
struct at32_uart {
|
2023-02-23 15:42:30 +08:00
|
|
|
char *name;
|
2023-04-14 00:35:07 +08:00
|
|
|
usart_type *uart_x;
|
2023-02-23 15:42:30 +08:00
|
|
|
IRQn_Type irqn;
|
2023-04-14 00:35:07 +08:00
|
|
|
struct dma_config *dma_rx;
|
|
|
|
rt_size_t last_index;
|
|
|
|
struct dma_config *dma_tx;
|
|
|
|
rt_uint16_t uart_dma_flag;
|
2023-02-23 15:42:30 +08:00
|
|
|
struct rt_serial_device serial;
|
|
|
|
};
|
|
|
|
|
|
|
|
int rt_hw_usart_init(void);
|
|
|
|
|
|
|
|
#endif /* __DRV_USART_V2_H__ */
|
2023-04-14 00:35:07 +08:00
|
|
|
|
|
|
|
/******************* end of file *******************/
|