drv_usartX.h 724 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*
  2. * Copyright (c) 2020-2022, Bluetrum Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2020-11-20 greedyhao first version
  9. * 2022-06-08 THEWON first version for serialX
  10. */
  11. #ifndef DRV_USART_H__
  12. #define DRV_USART_H__
  13. #include "drv_common.h"
  14. #ifdef RT_USING_SERIAL
  15. /* an32 config class */
  16. struct ab32_uart_config
  17. {
  18. const char *name;
  19. hal_sfr_t instance;
  20. uint8_t mode;
  21. };
  22. /* ab32 uart driver class */
  23. struct ab32_uart
  24. {
  25. struct uart_handle handle;
  26. struct rt_serial_device serial;
  27. struct ab32_uart_config *uart_config;
  28. rt_bool_t intTxing;
  29. };
  30. #endif
  31. int rt_hw_usart_init(void);
  32. #endif