summaryrefslogtreecommitdiff
path: root/bsp/bluetrum/libraries/hal_drivers/drv_usartX.h
blob: acd4b63a8406a46ebf974e3c7072b350aff2a96f (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
34
35
36
37
38
39
40
/*
 * Copyright (c) 2020-2022, Bluetrum Development Team
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author            Notes
 * 2020-11-20     greedyhao         first version
 * 2022-06-08     THEWON            first version for serialX
 */

#ifndef DRV_USART_H__
#define DRV_USART_H__

#include "drv_common.h"

#ifdef RT_USING_SERIAL

/* an32 config class */
struct ab32_uart_config
{
    const char *name;
    hal_sfr_t   instance;
    uint8_t     mode;
};

/* ab32 uart driver class */
struct ab32_uart
{
    struct uart_handle handle;
    struct rt_serial_device serial;
    struct ab32_uart_config *uart_config;
    rt_bool_t intTxing;
};

#endif

int rt_hw_usart_init(void);

#endif