drv_uart.h 740 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * Copyright (c) 2006-2022, 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. IRQn_Type intrSrc;
  24. cy_israddress userIsr;
  25. cy_stc_sysint_t *UART_SCB_IRQ_cfg;
  26. };
  27. struct ifx_uart
  28. {
  29. struct ifx_uart_config *config;
  30. struct rt_serial_device serial;
  31. };
  32. void rt_hw_uart_init(void);
  33. #endif