drv_usart.h 826 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*
  2. * Copyright (c) 2006-2025, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2022-12-08 WangShun the first version
  9. */
  10. #ifndef __DRV_USART_H__
  11. #define __DRV_USART_H__
  12. #include <rtthread.h>
  13. #include "rtdevice.h"
  14. #include <rthw.h>
  15. #include <soc.h>
  16. #include <dw_uart_ll.h>
  17. #include <drv/uart.h>
  18. /* xuantie config class */
  19. struct xuantie_uart_config
  20. {
  21. const char *name;
  22. uint32_t idx;
  23. void (*xuantie_uart_rx_isr)(csi_uart_t *uart_handler, csi_uart_event_t event, void *arg);
  24. };
  25. /* xuantie uart dirver class */
  26. struct xuantie_uart
  27. {
  28. struct xuantie_uart_config *config;
  29. struct rt_serial_device serial;
  30. csi_uart_t uart;
  31. };
  32. extern void uart_rx_isr (void *id);
  33. int rt_hw_usart_init(void);
  34. #endif /* __DRV_USART_H__ */