drv_usart.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /*
  2. * Copyright (C) 2021, Huada Semiconductor Co., Ltd.
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2021-08-19 pjq first version
  9. */
  10. #ifndef __DRV_USART_H__
  11. #define __DRV_USART_H__
  12. /*******************************************************************************
  13. * Include files
  14. ******************************************************************************/
  15. #include <rtthread.h>
  16. #include "rtdevice.h"
  17. #include "ddl.h"
  18. #include "uart.h"
  19. /* C binding of definitions if building with C++ compiler */
  20. #ifdef __cplusplus
  21. extern "C"
  22. {
  23. #endif
  24. /*******************************************************************************
  25. * Global type definitions ('typedef')
  26. ******************************************************************************/
  27. /* HC32 config uart class */
  28. struct hc32_uart_config
  29. {
  30. const char *name;
  31. rt_uint8_t idx;
  32. rt_uint16_t uart_dma_flag;
  33. struct rt_serial_device serial;
  34. };
  35. /* stm32 uart dirver class */
  36. struct hc32_uart
  37. {
  38. struct hc32_uart_config *config;
  39. #ifdef RT_SERIAL_USING_DMA
  40. #endif
  41. rt_uint16_t uart_dma_flag;
  42. struct rt_serial_device serial;
  43. };
  44. /*******************************************************************************
  45. * Global pre-processor symbols/macros ('#define')
  46. ******************************************************************************/
  47. /*******************************************************************************
  48. * Global variable definitions ('extern')
  49. ******************************************************************************/
  50. /*******************************************************************************
  51. * Global function prototypes (definition in C source)
  52. ******************************************************************************/
  53. int rt_hw_uart_init(void);
  54. #ifdef __cplusplus
  55. }
  56. #endif
  57. #endif /* __DRV_USART_H__ */
  58. /*******************************************************************************
  59. * EOF (not truncated)
  60. ******************************************************************************/