uart_config.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. * Copyright (c) 2006-2018, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2018-11-06 SummerGift change to new framework
  9. */
  10. #ifndef __UART_CONFIG_H__
  11. #define __UART_CONFIG_H__
  12. #include <rtthread.h>
  13. #if defined(BSP_USING_UART1)
  14. #define UART1_CONFIG \
  15. { \
  16. .name = "uart1", \
  17. .Instance = USART1, \
  18. .irq_type = USART1_IRQn, \
  19. .dma.channel_request.Instance = DMA2_Channel7, \
  20. .dma.channel_request.request = DMA_REQUEST_2, \
  21. .dma_rcc = RCC_AHB1ENR_DMA2EN, \
  22. .dma_irq = DMA2_Channel7_IRQn, \
  23. }
  24. #define USART1_RX_DMA_ISR DMA2_Channel7_IRQHandler
  25. #endif
  26. #if defined(BSP_USING_UART2)
  27. #define UART2_CONFIG \
  28. { \
  29. .name = "uart2", \
  30. .Instance = USART2, \
  31. .irq_type = USART2_IRQn, \
  32. .dma.channel_request.Instance = DMA1_Channel6, \
  33. .dma.channel_request.request = DMA_REQUEST_2, \
  34. .dma_rcc = RCC_AHB1SMENR_DMA1SMEN, \
  35. .dma_irq = DMA1_Channel6_IRQn, \
  36. }
  37. #define USART2_RX_DMA_ISR DMA1_Channel6_IRQHandler
  38. #endif
  39. #endif