1 /*
2  * Copyright (C) 2021, Huada Semiconductor Co., Ltd.
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  *
6  * Change Logs:
7  * Date           Author       Notes
8  * 2021-08-19     pjq          first version
9  */
10 
11 
12 #ifndef __DRV_USART_H__
13 #define __DRV_USART_H__
14 
15 /*******************************************************************************
16  * Include files
17  ******************************************************************************/
18 #include <rtthread.h>
19 #include "rtdevice.h"
20 
21 #include "ddl.h"
22 #include "uart.h"
23 
24 /* C binding of definitions if building with C++ compiler */
25 #ifdef __cplusplus
26 extern "C"
27 {
28 #endif
29 
30 /*******************************************************************************
31  * Global type definitions ('typedef')
32  ******************************************************************************/
33 /* HC32 config uart class */
34 struct hc32_uart_config
35 {
36     const char *name;
37     rt_uint8_t idx;
38     rt_uint16_t uart_dma_flag;
39     struct rt_serial_device serial;
40 };
41 
42 /* stm32 uart dirver class */
43 struct hc32_uart
44 {
45     struct hc32_uart_config *config;
46 #ifdef RT_SERIAL_USING_DMA
47 
48 #endif
49     rt_uint16_t uart_dma_flag;
50     struct rt_serial_device serial;
51 };
52 
53 /*******************************************************************************
54  * Global pre-processor symbols/macros ('#define')
55  ******************************************************************************/
56 
57 /*******************************************************************************
58  * Global variable definitions ('extern')
59  ******************************************************************************/
60 
61 /*******************************************************************************
62  * Global function prototypes (definition in C source)
63  ******************************************************************************/
64 int rt_hw_uart_init(void);
65 
66 #ifdef __cplusplus
67 }
68 #endif
69 
70 #endif /* __DRV_USART_H__ */
71 
72 /*******************************************************************************
73  * EOF (not truncated)
74  ******************************************************************************/
75