1 /* 2 * Copyright (c) 2006-2024 RT-Thread Development Team 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 * 6 * Change Logs: 7 * Date Author Notes 8 * 2022-06-29 Rbb666 first version 9 */ 10 11 #ifndef __DRV_UART_H__ 12 #define __DRV_UART_H__ 13 14 #include <rthw.h> 15 #include <rtdevice.h> 16 17 #include "board.h" 18 19 #define uart_isr_callback(name) name##_isr_callback 20 21 struct ifx_uart_config 22 { 23 cyhal_uart_t *uart_obj; 24 const char *name; 25 rt_uint32_t tx_pin; 26 rt_uint32_t rx_pin; 27 CySCB_Type *usart_x; 28 cy_israddress userIsr; 29 cy_stc_sysint_t *UART_SCB_IRQ_cfg; 30 }; 31 32 struct ifx_uart 33 { 34 struct ifx_uart_config *config; 35 struct rt_serial_device serial; 36 }; 37 38 void rt_hw_uart_init(void); 39 40 #endif 41