drv_usart_msg.h 876 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. #ifndef __DRV_USART_MSG_H__
  13. #define __DRV_USART_MSG_H__
  14. #include <rtthread.h>
  15. #include "rtdevice.h"
  16. #include "fuart_msg.h"
  17. #include "fuart_msg_hw.h"
  18. #define RTOS_UART_MSG_RX_ISR_MASK 0x01
  19. #define RTOS_UART_MSG_TX_ISR_MASK 0x02
  20. typedef struct
  21. {
  22. u32 uart_instance; /* select uart global object */
  23. u32 isr_priority; /* irq Priority */
  24. u32 isr_event_mask; /* followed by RTOS_UART_ISR_XX */
  25. u32 uart_baudrate;
  26. } FtRtthreadUartMsgConfig;
  27. struct drv_usart_msg
  28. {
  29. const char *name;
  30. FUartMsg *handle;
  31. FtRtthreadUartMsgConfig config;
  32. struct rt_serial_device serial;
  33. };
  34. #endif // !