1 /*
2  * Copyright (c) 2006-2025, RT-Thread Development Team
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  *
6  * Change Logs:
7  * Date           Author       Notes
8  * 2022-12-08     WangShun     the first version
9  */
10 #ifndef __DRV_USART_H__
11 #define __DRV_USART_H__
12 #include <rtthread.h>
13 #include "rtdevice.h"
14 #include <rthw.h>
15 
16 #include <soc.h>
17 #include <dw_uart_ll.h>
18 #include <drv/uart.h>
19 
20 /* xuantie config class */
21 struct xuantie_uart_config
22 {
23     const char *name;
24     uint32_t idx;
25     void (*xuantie_uart_rx_isr)(csi_uart_t *uart_handler, csi_uart_event_t event, void *arg);
26 };
27 
28 /* xuantie uart dirver class */
29 struct xuantie_uart
30 {
31     struct xuantie_uart_config *config;
32     struct rt_serial_device serial;
33     csi_uart_t uart;
34 };
35 
36 extern void uart_rx_isr (void *id);
37 int rt_hw_usart_init(void);
38 #endif /* __DRV_USART_H__ */
39