rt-thread/bsp/Infineon/libraries/HAL_Drivers/drv_uart.h

43 lines
740 B
C
Raw Normal View History

/*
* Copyright (c) 2006-2022, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
2022-07-05 16:59:20 +08:00
* 2022-06-29 Rbb666 first version
*/
2022-07-05 16:59:20 +08:00
#ifndef __DRV_UART_H__
#define __DRV_UART_H__
#include <rthw.h>
#include <rtdevice.h>
#include "board.h"
2022-07-08 17:07:28 +08:00
#define uart_isr_callback(name) name##_isr_callback
struct ifx_uart_config
{
2022-07-26 12:52:25 +08:00
cyhal_uart_t *uart_obj;
2022-07-08 17:07:28 +08:00
const char *name;
rt_uint32_t tx_pin;
rt_uint32_t rx_pin;
CySCB_Type *usart_x;
IRQn_Type intrSrc;
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