1 /* 2 * Copyright (c) 2006-2021, RT-Thread Development Team 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 * 6 * Email: opensource_embedded@phytium.com.cn 7 * 8 * Change Logs: 9 * Date Author Notes 10 * 2025-05-23 liyilun first commit 11 12 */ 13 14 #ifndef __DRV_USART_MSG_H__ 15 #define __DRV_USART_MSG_H__ 16 17 #include <rtthread.h> 18 #include "rtdevice.h" 19 20 #include "fuart_msg.h" 21 #include "fuart_msg_hw.h" 22 23 24 #define RTOS_UART_MSG_RX_ISR_MASK 0x01 25 #define RTOS_UART_MSG_TX_ISR_MASK 0x02 26 27 typedef struct 28 { 29 u32 uart_instance; /* select uart global object */ 30 u32 isr_priority; /* irq Priority */ 31 u32 isr_event_mask; /* followed by RTOS_UART_ISR_XX */ 32 u32 uart_baudrate; 33 } FtRtthreadUartMsgConfig; 34 35 struct drv_usart_msg 36 { 37 const char *name; 38 FUartMsg *handle; 39 FtRtthreadUartMsgConfig config; 40 struct rt_serial_device serial; 41 }; 42 43 #endif // ! 44