drv_usartX.h 753 B

123456789101112131415161718192021222324252627282930313233343536373839
  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-06 THEWON first version for serialX
  9. */
  10. #ifndef __DRV_USARTX_H__
  11. #define __DRV_USARTX_H__
  12. #include "rtdevice.h"
  13. struct n32_uart_dma
  14. {
  15. /* dma channel */
  16. DMA_ChannelType *dma_ch;
  17. DMA_Module *dma_module;
  18. /* dma global flag */
  19. uint32_t dma_flag;
  20. /* dma irq channel */
  21. uint8_t dma_irq;
  22. };
  23. struct n32_uart
  24. {
  25. USART_Module *uart_device;
  26. struct rt_serial_device serial;
  27. IRQn_Type irq;
  28. #ifdef RT_SERIAL_USING_DMA
  29. rt_bool_t dmaTxing;
  30. struct n32_uart_dma dma_rx;
  31. struct n32_uart_dma dma_tx;
  32. #endif
  33. };
  34. #endif /* __DRV_USART_H__ */