drv_usart.h 847 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. * 2018.10.30 SummerGift first version
  9. * 2019.03.05 whj4674672 add stm32h7
  10. * 2020-10-14 Dozingfiretruck Porting for stm32wbxx
  11. */
  12. #ifndef __DRV_USART_H__
  13. #define __DRV_USART_H__
  14. #include <rtthread.h>
  15. #include "rtdevice.h"
  16. #include <rthw.h>
  17. #include <drv_common.h>
  18. #include "board.h"
  19. int rt_hw_usart_init(void);
  20. /* stm32 config class */
  21. struct _uart_config
  22. {
  23. const char *name;
  24. void *InitTypeDef;
  25. IRQn_Type irq_type;
  26. uint32_t clockSrc;
  27. };
  28. /* stm32 uart dirver class */
  29. struct _uart
  30. {
  31. FL_UART_InitTypeDef handle;
  32. struct _uart_config *config;
  33. rt_uint16_t uart_dma_flag;
  34. struct rt_serial_device serial;
  35. };
  36. #endif /* __DRV_USART_H__ */