forked from RT-Thread/rt-thread
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdrv_uart.h
More file actions
40 lines (32 loc) · 715 Bytes
/
drv_uart.h
File metadata and controls
40 lines (32 loc) · 715 Bytes
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) 2006-2024 RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2022-06-29 Rbb666 first version
*/
#ifndef __DRV_UART_H__
#define __DRV_UART_H__
#include <rthw.h>
#include <rtdevice.h>
#include "board.h"
#define uart_isr_callback(name) name##_isr_callback
struct ifx_uart_config
{
cyhal_uart_t *uart_obj;
const char *name;
rt_uint32_t tx_pin;
rt_uint32_t rx_pin;
CySCB_Type *usart_x;
cy_israddress userIsr;
cy_stc_sysint_t *UART_SCB_IRQ_cfg;
};
struct ifx_uart
{
struct ifx_uart_config *config;
struct rt_serial_device serial;
};
void rt_hw_uart_init(void);
#endif