drv_uart.h 715 B

12345678910111213141516171819202122232425262728293031323334353637383940
  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. #ifndef __DRV_UART_H__
  11. #define __DRV_UART_H__
  12. #include <rthw.h>
  13. #include <rtdevice.h>
  14. #include "board.h"
  15. #define uart_isr_callback(name) name##_isr_callback
  16. struct ifx_uart_config
  17. {
  18. cyhal_uart_t *uart_obj;
  19. const char *name;
  20. rt_uint32_t tx_pin;
  21. rt_uint32_t rx_pin;
  22. CySCB_Type *usart_x;
  23. cy_israddress userIsr;
  24. cy_stc_sysint_t *UART_SCB_IRQ_cfg;
  25. };
  26. struct ifx_uart
  27. {
  28. struct ifx_uart_config *config;
  29. struct rt_serial_device serial;
  30. };
  31. void rt_hw_uart_init(void);
  32. #endif