summaryrefslogtreecommitdiff
path: root/bsp/at32/libraries/rt_drivers/drv_usart.h
blob: f1e625991decd7559eed828e4e652352e3be6a56 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/*
 * Copyright (c) 2006-2021, RT-Thread Development Team
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author       Notes
 * 2020-03-04     shelton      first version
 */

#ifndef __DRV_UART_H__
#define __DRV_UART_H__

#include <rtthread.h>
#include <rtdevice.h>
#include "drv_dma.h"

struct at32_uart {
    char *name;
    usart_type *uart_x;
    IRQn_Type irqn;
    struct dma_config *dma_rx;
    rt_size_t last_index;
    struct dma_config *dma_tx;
    rt_uint16_t uart_dma_flag;
    struct rt_serial_device serial;
};

int rt_hw_usart_init(void);

#endif /* __DRV_USART_H__ */

/******************* end of file *******************/