2018-11-29 17:00:22 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2006-2018, RT-Thread Development Team
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*
|
|
|
|
* Change Logs:
|
|
|
|
* Date Author Notes
|
2019-01-08 18:19:11 +08:00
|
|
|
* 2018-11-06 SummerGift first version
|
2018-11-29 17:00:22 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __UART_CONFIG_H__
|
|
|
|
#define __UART_CONFIG_H__
|
|
|
|
|
|
|
|
#include <rtthread.h>
|
|
|
|
|
|
|
|
#if defined(BSP_USING_UART1)
|
2019-01-08 11:58:57 +08:00
|
|
|
#ifndef UART1_CONFIG
|
|
|
|
#define UART1_CONFIG \
|
|
|
|
{ \
|
|
|
|
.name = "uart1", \
|
|
|
|
.Instance = USART1, \
|
|
|
|
.irq_type = USART1_IRQn, \
|
2018-11-29 17:00:22 +08:00
|
|
|
}
|
2019-01-08 11:58:57 +08:00
|
|
|
#endif /* UART1_CONFIG */
|
|
|
|
#endif /* BSP_USING_UART1 */
|
|
|
|
|
|
|
|
#if defined(BSP_UART1_RX_USING_DMA)
|
|
|
|
#ifndef UART1_DMA_CONFIG
|
|
|
|
#define UART1_DMA_CONFIG \
|
|
|
|
{ \
|
2019-01-08 18:19:11 +08:00
|
|
|
.Instance = UART1_RX_DMA_INSTANCE, \
|
|
|
|
.request = UART1_RX_DMA_REQUEST, \
|
|
|
|
.dma_rcc = UART1_RX_DMA_RCC, \
|
|
|
|
.dma_irq = UART1_RX_DMA_IRQ, \
|
2019-01-08 11:58:57 +08:00
|
|
|
}
|
|
|
|
#endif /* UART1_DMA_CONFIG */
|
|
|
|
#endif /* BSP_UART1_RX_USING_DMA */
|
|
|
|
|
2018-11-29 17:00:22 +08:00
|
|
|
#if defined(BSP_USING_UART2)
|
2019-01-08 11:58:57 +08:00
|
|
|
#ifndef UART2_CONFIG
|
|
|
|
#define UART2_CONFIG \
|
|
|
|
{ \
|
|
|
|
.name = "uart2", \
|
|
|
|
.Instance = USART2, \
|
|
|
|
.irq_type = USART2_IRQn, \
|
2018-11-29 17:00:22 +08:00
|
|
|
}
|
2019-01-08 11:58:57 +08:00
|
|
|
#endif /* UART2_CONFIG */
|
|
|
|
#endif /* BSP_USING_UART2 */
|
|
|
|
|
|
|
|
#if defined(BSP_UART2_RX_USING_DMA)
|
|
|
|
#ifndef UART2_DMA_CONFIG
|
|
|
|
#define UART2_DMA_CONFIG \
|
|
|
|
{ \
|
2019-01-08 18:19:11 +08:00
|
|
|
.Instance = UART2_RX_DMA_INSTANCE, \
|
|
|
|
.request = UART2_RX_DMA_REQUEST, \
|
|
|
|
.dma_rcc = UART2_RX_DMA_RCC, \
|
|
|
|
.dma_irq = UART2_RX_DMA_IRQ, \
|
2019-01-08 11:58:57 +08:00
|
|
|
}
|
|
|
|
#endif /* UART2_DMA_CONFIG */
|
|
|
|
#endif /* BSP_UART2_RX_USING_DMA */
|
2018-11-29 17:00:22 +08:00
|
|
|
|
|
|
|
#endif
|