summaryrefslogtreecommitdiff
path: root/bsp/fm33lc026/libraries/HAL_Drivers/drv_usart.h
blob: 757265e1108f9c1095deb470d040806a92fc7557 (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
41
42
43
/*
 * Copyright (c) 2006-2022, RT-Thread Development Team
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author       Notes
 * 2018.10.30     SummerGift   first version
 * 2019.03.05     whj4674672   add stm32h7
 * 2020-10-14     PeakRacing   Porting for stm32wbxx
 */

#ifndef __DRV_USART_H__
#define __DRV_USART_H__

#include <rtthread.h>
#include "rtdevice.h"
#include <rthw.h>
#include <drv_common.h>
#include "board.h"

int rt_hw_usart_init(void);


/* stm32 config class */
struct _uart_config
{
    const char *name;
    void *InitTypeDef;
    IRQn_Type irq_type;
    uint32_t clockSrc;
};

/* stm32 uart dirver class */
struct _uart
{
    FL_UART_InitTypeDef  handle;
    struct _uart_config *config;
    rt_uint16_t uart_dma_flag;
    struct rt_serial_device serial;
};

#endif  /* __DRV_USART_H__ */