ENV中没有办法配置串口引脚。
RT-studio中可以配置引脚定义。
这个功能要想在ENV中使用是不是得自己写???
因为RT-studio我用起来不习惯。
其中生成的board.h差别很大。
ENV生成的
/*
- Copyright (c) 2006-2021, RT-Thread Development Team
SPDX-License-Identifier: Apache-2.0
*
Date Author Notes
- 2018-11-5 SummerGift first
version
*/
#ifndef BOARD_H
#define BOARD_H
#include
<rtthread.h>
#include <stm32f7xx.h>
#include
"drv_common.h"
#include "drv_gpio.h"
#ifdef __cplusplus
extern "C"
{
#endif
#define STM32_FLASH_START_ADRESS
((uint32_t)0x08000000)
#define STM32_FLASH_SIZE (1024 *
#define STM32_FLASH_END_ADDRESS
((uint32_t)(STM32_FLASH_START_ADRESS + STM32_FLASH_SIZE))
#define
STM32_SRAM_SIZE (512)
#define STM32_SRAM_END (0x20000000
/*
- Copyright (c) 2006-2022, RT-Thread Development Team
SPDX-License-Identifier: Apache-2.0
*
Date Author Notes
- 2022-03-11 RealThread first
version
/
#ifndef BOARD_H
#define BOARD_H
#include
<stm32f7xx.h>
#include <drv_common.h>
#ifdef
__cplusplus
extern "C"
{
#endif
/-------------------------- CHIP
CONFIG BEGIN --------------------------/
#define
CHIP_FAMILY_STM32
#define CHIP_SERIES_STM32F7
#define
CHIP_NAME_STM32F767IG
/-------------------------- CHIP CONFIG END
--------------------------/
/-------------------------- ROM/RAM CONFIG
BEGIN --------------------------*/
#define ROM_START
((uint32_t)0x08000000)
#define ROM_SIZE (1024 *
#define ROM_END ((uint32_t)(ROM_START +
ROM_SIZE))
#define RAM_START (0x20020000)
#define
RAM_SIZE (384 * 1024)
#define RAM_END (RAM_START
- RAM_SIZE)
/-------------------------- ROM/RAM CONFIG END
--------------------------/
/-------------------------- CLOCK CONFIG BEGIN
--------------------------/
#define BSP_CLOCK_SOURCE
("HSI")
#define BSP_CLOCK_SOURCE_FREQ_MHZ ((int32_t)0)
#define
BSP_CLOCK_SYSTEM_FREQ_MHZ ((int32_t)180)
/--------------------------
CLOCK CONFIG END --------------------------/
/--------------------------
UART CONFIG BEGIN --------------------------/
/** After configuring
corresponding UART or UART DMA, you can use it.
STEP 2, according to the corresponding pin of serial port, define the related
serial port information macro
BSP_UART1_TX_PIN "PA9"
BSP_UART1_RX_PIN "PA10"
*
- STEP 3, if you want using SERIAL DMA,
you must open it in the RT-Thread Settings.
-
RT-Thread
Setting -> Components -> Device Drivers -> Serial Device Drivers ->
Enable Serial DMA Mode
*
- STEP 4, according to serial port number to
define serial port tx/rx DMA function in the board.h file
such as #define BSP_UART1_RX_USING_DMA
*
/
#define
BSP_USING_UART1
#define BSP_UART1_TX_PIN "PA9"
#define
BSP_UART1_RX_PIN "PA10"
/-------------------------- UART CONFIG END
--------------------------/
/-------------------------- I2C CONFIG BEGIN
--------------------------*/
/** if you want to use i2c bus(soft simulate)
you can use the following instructions.
*
- STEP 1, open i2c driver
framework(soft simulate) support in the RT-Thread Settings file
- STEP
2, define macro related to the i2c bus
-
such as #define
BSP_USING_I2C1
*
- STEP 3, according to the corresponding pin of i2c
port, modify the related i2c port and pin information
-
such
as #define BSP_I2C1_SCL_PIN GET_PIN(port, pin) -> GET_PIN(C,
11)
pin) -> GET_PIN(C, 12)
/
/#define BSP_USING_I2C1*/
#ifdef
BSP_USING_I2C1
#define BSP_I2C1_SCL_PIN GET_PIN(port, pin)
#define
BSP_I2C1_SDA_PIN GET_PIN(port, pin)
#endif
/#define
BSP_USING_I2C2/
#ifdef BSP_USING_I2C2
#define BSP_I2C2_SCL_PIN
GET_PIN(port, pin)
#define BSP_I2C2_SDA_PIN GET_PIN(port,
pin)
#endif
/-------------------------- I2C CONFIG END
--------------------------/
/-------------------------- SPI CONFIG BEGIN
--------------------------/
/** if you want to use spi bus you can use the
following instructions.
*
HAL_SPI_MspInit(SPI_HandleTypeDef* hspi)
*
- STEP 4, modify your
stm32xxxx_hal_config.h file to support spi peripherals. define macro related to
the peripherals
-
such as #define
HAL_SPI_MODULE_ENABLED
/
/#define BSP_USING_SPI1*/
/#define
BSP_USING_SPI2/
/#define BSP_USING_SPI3/
/--------------------------
SPI CONFIG END --------------------------/
/-------------------------- QSPI
CONFIG BEGIN --------------------------/
/** if you want to use qspi you can
use the following instructions.
*
STEP 3, copy your qspi init function from stm32xxxx_hal_msp.c generated by
stm32cubemx to the end of board.c file
HAL_QSPI_MspInit(QSPI_HandleTypeDef* hqspi)
*
- STEP 4, modify your
stm32xxxx_hal_config.h file to support qspi peripherals. define macro related to
the peripherals
-
such as #define
HAL_QSPI_MODULE_ENABLED
*
/
/#define
BSP_USING_QSPI*/
/-------------------------- QSPI CONFIG END
--------------------------/
/-------------------------- PWM CONFIG BEGIN
--------------------------/
/** if you want to use pwm you can use the
following instructions.
*
HAL_TIM_Base_MspInit(TIM_HandleTypeDef* htim_base)
and
HAL_TIM_MspPostInit(TIM_HandleTypeDef* htim)
*
- STEP 4, modify your
stm32xxxx_hal_config.h file to support pwm peripherals. define macro related to
the peripherals
-
such as #define
HAL_TIM_MODULE_ENABLED
*
/
/#define BSP_USING_PWM1*/
/#define
BSP_USING_PWM2/
/#define BSP_USING_PWM3/
/--------------------------
PWM CONFIG END --------------------------/
/-------------------------- ADC
CONFIG BEGIN --------------------------/
/** if you want to use adc you can
use the following instructions.
*
STEP 3, copy your adc init function from stm32xxxx_hal_msp.c generated by
stm32cubemx to the end of board.c file
HAL_ADC_MspInit(ADC_HandleTypeDef* hadc)
*
- STEP 4, modify your
stm32xxxx_hal_config.h file to support adc peripherals. define macro related to
the peripherals
-
such as #define
HAL_ADC_MODULE_ENABLED
*
/
/#define BSP_USING_ADC1*/
/#define
BSP_USING_ADC2/
/#define BSP_USING_ADC3/
/--------------------------
ADC CONFIG END --------------------------/
/-------------------------- WDT
CONFIG BEGIN --------------------------/
/** if you want to use wdt you can
use the following instructions.
*
- STEP 1, open wdt driver framework
support in the RT-Thread Settings file
- STEP 2, modify your
stm32xxxx_hal_config.h file to support wdt peripherals. define macro related to
the peripherals
-
such as #define
HAL_IWDG_MODULE_ENABLED
*
/
/-------------------------- WDT CONFIG
END --------------------------/
/-------------------------- HARDWARE TIMER
CONFIG BEGIN --------------------------*/
/** if you want to use hardware
timer you can use the following instructions.
*
- STEP 1, open hwtimer
driver framework support in the RT-Thread Settings file
- STEP 2,
define macro related to the hwtimer
-
such as #define
BSP_USING_TIM and
BSP_USING_TIM1
*
- STEP 3, copy your hardwire timer init function from
stm32xxxx_hal_msp.c generated by stm32cubemx to the end of board.c
file
-
such as void
HAL_TIM_Base_MspInit(TIM_HandleTypeDef* htim_base)
*
- STEP 4, modify
your stm32xxxx_hal_config.h file to support hardwere timer peripherals. define
macro related to the peripherals
-
such as #define
HAL_TIM_MODULE_ENABLED
*
/
/#define BSP_USING_TIM*/
#ifdef
BSP_USING_TIM
/#define BSP_USING_TIM15/
/#define
BSP_USING_TIM16/
/#define
BSP_USING_TIM17/
#endif
/-------------------------- HAREWARE TIMER
CONFIG END --------------------------/
/-------------------------- RTC
CONFIG BEGIN --------------------------/
/** if you want to use
rtc(hardware) you can use the following instructions.
*
- STEP 1, open
rtc driver framework(hardware) support in the RT-Thread Settings
file
- STEP 2, define macro related to the rtc
such as BSP_USING_ONCHIP_RTC
*
- STEP 3, modify your
stm32xxxx_hal_config.h file to support rtc peripherals. define macro related to
the peripherals
-
such as #define
HAL_RTC_MODULE_ENABLED
*
/
/#define
BSP_USING_ONCHIP_RTC*/
/-------------------------- RTC CONFIG END
--------------------------/
/-------------------------- SDIO CONFIG BEGIN
--------------------------/
/** if you want to use sdio you can use the
following instructions.
*
- STEP 1, open sdio driver framework support
in the RT-Thread Settings file
- STEP 2, define macro related to the
sdio
-
such as BSP_USING_SDIO
- STEP 3, copy
your sdio init function from stm32xxxx_hal_msp.c generated by stm32cubemx to the
end of board.c file
-
such as void
HAL_SD_MspInit(SD_HandleTypeDef* hsd)
*
- STEP 4, modify your
stm32xxxx_hal_config.h file to support sdio peripherals. define macro related to
the peripherals
-
such as #define
HAL_SD_MODULE_ENABLED
*
- STEP 5, config your device file system or
another applications
/
/#define
BSP_USING_SDIO*/
/-------------------------- SDIO CONFIG END
--------------------------/
/-------------------------- ETH CONFIG BEGIN
--------------------------/
/** if you want to use eth you can use the
following instructions.
*
- STEP 1, define macro related to the
eth
-
such as BSP_USING_ETH
- STEP 2, copy your
eth init function from stm32xxxx_hal_msp.c generated by stm32cubemx to the end
if board.c file
-
such as void
HAL_ETH_MspInit(ETH_HandleTypeDef* heth)
*
- STEP 3, modify your
stm32xxxx_hal_config.h file to support eth peripherals. define macro related to
the peripherals
-
such as #define
HAL_ETH_MODULE_ENABLED
*
- STEP 4, config your phy
type
-
such as #define
PHY_USING_LAN8720A
PHY_USING_DM9161CEP
PHY_USING_DP83848C
- STEP 5, implement your phy reset function in the end of
board.c file
-
void phy_reset(void)
- STEP 6,
config your lwip or other network stack
/
/#define
BSP_USING_ETH*/
#ifdef BSP_USING_ETH
/#define
PHY_USING_LAN8720A/
/#define PHY_USING_DM9161CEP/
/#define
PHY_USING_DP83848C/
#endif
/-------------------------- ETH CONFIG END
--------------------------/
/-------------------------- USB HOST CONFIG
BEGIN --------------------------/
/** if you want to use usb host you can
use the following instructions.
*
- STEP 1, open usb host driver
framework support in the RT-Thread Settings file
- STEP 2, define
macro related to the usb host
-
such as
BSP_USING_USBHOST
*
hhcd)
*
- STEP 4, config your usb peripheral clock in
SystemClock_Config() generated by STM32CubeMX and replace this function in
board.c
- STEP 5, modify your stm32xxxx_hal_config.h file to support
usb host peripherals. define macro related to the
peripherals
-
such as #define
HAL_HCD_MODULE_ENABLED
*
/
/#define
BSP_USING_USBHOST*/
/-------------------------- USB HOST CONFIG END
--------------------------/
/-------------------------- USB DEVICE CONFIG
BEGIN --------------------------/
/** if you want to use usb device you can
use the following instructions.
*
- STEP 1, open usb device driver
framework support in the RT-Thread Settings file
- STEP 2 define macro
related to the usb device
-
such as
BSP_USING_USBDEVICE
*
hpcd)
*
- STEP 4, config your usb peripheral clock in
SystemClock_Config() generated by STM32CubeMX and replace this function in
board.c
- STEP 5, modify your stm32xxxx_hal_config.h file to support
usb device peripherals. define macro related to the
peripherals
-
such as #define
HAL_PCD_MODULE_ENABLED
*
/
/#define
BSP_USING_USBDEVICE*/
/-------------------------- USB DEVICE CONFIG END
--------------------------/
/-------------------------- ON_CHIP_FLASH
CONFIG BEGIN --------------------------/
/** if you want to use on chip
flash you can use the following instructions.
*
- STEP 1 define macro
related to the on chip flash
-
such as
BSP_USING_ON_CHIP_FLASH
*
- STEP 2, modify your stm32xxxx_hal_config.h
file to support on chip flash peripherals. define macro related to the
peripherals
-
such as #define
HAL_FLASH_MODULE_ENABLED
*
/
/#define
BSP_USING_ON_CHIP_FLASH*/
/-------------------------- ON_CHIP_FLASH CONFIG
END --------------------------/
#ifdef __cplusplus
}
#endif
#endif
/* BOARD_H */
串口配置的差别
/*
- Copyright (c) 2006-2018, RT-Thread Development Team
SPDX-License-Identifier: Apache-2.0
*
Date Author Notes
- 2018-10-30 SummerGift first
version
- 2019-01-03 zylx modify dma support
*/
#ifndef
UART_CONFIG_H
#define UART_CONFIG_H
#include
<rtthread.h>
#include <board.h>
#ifdef __cplusplus
extern
"C" {
#endif
#if defined(BSP_USING_UART1)
#ifndef
UART1_CONFIG
#define
UART1_CONFIG \
{ \
.name = "uart1", \
.Instance = USART1, \
.irq_type = USART1_IRQn, \
.tx_pin_name = BSP_UART1_TX_PIN, \
.rx_pin_name = BSP_UART1_RX_PIN,
}
#endif
/* UART1_CONFIG */
#if defined(BSP_UART1_RX_USING_DMA)
#ifndef
UART1_DMA_RX_CONFIG
#define
UART1_DMA_RX_CONFIG \
{ \
.Instance = UART1_RX_DMA_INSTANCE, \
.channel = UART1_RX_DMA_CHANNEL, \
.dma_rcc = UART1_RX_DMA_RCC, \
.dma_irq = UART1_RX_DMA_IRQ,
}
#endif
/* UART1_DMA_RX_CONFIG /
#endif / BSP_UART1_RX_USING_DMA */
#if
defined(BSP_UART1_TX_USING_DMA)
#ifndef UART1_DMA_TX_CONFIG
#define
UART1_DMA_TX_CONFIG \
{ \
.Instance = UART1_TX_DMA_INSTANCE, \
.channel = UART1_TX_DMA_CHANNEL, \
.dma_rcc = UART1_TX_DMA_RCC, \
.dma_irq = UART1_TX_DMA_IRQ,
}
#endif
/* UART1_DMA_TX_CONFIG /
#endif / BSP_UART1_TX_USING_DMA /
#endif /
BSP_USING_UART1 */
#if defined(BSP_USING_UART2)
#ifndef
UART2_CONFIG
#define
UART2_CONFIG \
{ \
.name = "uart2", \
.Instance = USART2, \
.irq_type = USART2_IRQn, \
.tx_pin_name = BSP_UART2_TX_PIN, \
.rx_pin_name = BSP_UART2_RX_PIN,
}
#endif
/* UART2_CONFIG */
#if defined(BSP_UART2_RX_USING_DMA)
#ifndef
UART2_DMA_RX_CONFIG
#define
UART2_DMA_RX_CONFIG \
{ \
.Instance = UART2_RX_DMA_INSTANCE, \
.channel = UART2_RX_DMA_CHANNEL, \
.dma_rcc = UART2_RX_DMA_RCC, \
.dma_irq = UART2_RX_DMA_IRQ,
}
#endif
/* UART2_DMA_RX_CONFIG /
#endif / BSP_UART2_RX_USING_DMA */
#if
defined(BSP_UART2_TX_USING_DMA)
#ifndef UART2_DMA_TX_CONFIG
#define
UART2_DMA_TX_CONFIG \
{ \
.Instance = UART2_TX_DMA_INSTANCE, \
.channel = UART2_TX_DMA_CHANNEL, \
.dma_rcc = UART2_TX_DMA_RCC, \
.dma_irq = UART2_TX_DMA_IRQ,
}
#endif
/* UART2_DMA_TX_CONFIG /
#endif / BSP_UART2_TX_USING_DMA /
#endif /
BSP_USING_UART2 */
#if defined(BSP_USING_UART3)
#ifndef
UART3_CONFIG
#define
UART3_CONFIG \
{ \
.name = "uart3", \
.Instance = USART3, \
.irq_type = USART3_IRQn, \
.tx_pin_name = BSP_UART3_TX_PIN, \
.rx_pin_name = BSP_UART3_RX_PIN,
}
#endif
/* UART3_CONFIG */
#if defined(BSP_UART3_RX_USING_DMA)
#ifndef
UART3_DMA_RX_CONFIG
#define
UART3_DMA_RX_CONFIG \
{ \
.Instance = UART3_RX_DMA_INSTANCE, \
.channel = UART3_RX_DMA_CHANNEL, \
.dma_rcc = UART3_RX_DMA_RCC, \
.dma_irq = UART3_RX_DMA_IRQ,
}
#endif
/* UART3_DMA_RX_CONFIG /
#endif / BSP_UART3_RX_USING_DMA */
#if
defined(BSP_UART3_TX_USING_DMA)
#ifndef UART3_DMA_TX_CONFIG
#define
UART3_DMA_TX_CONFIG \
{ \
.Instance = UART3_TX_DMA_INSTANCE, \
.channel = UART3_TX_DMA_CHANNEL, \
.dma_rcc = UART3_TX_DMA_RCC, \
.dma_irq = UART3_TX_DMA_IRQ,
}
#endif
/* UART3_DMA_TX_CONFIG /
#endif / BSP_UART3_TX_USING_DMA /
#endif /
BSP_USING_UART3 */
#if defined(BSP_USING_UART4)
#ifndef
UART4_CONFIG
#define
UART4_CONFIG \
{ \
.name = "uart4", \
.Instance = UART4, \
.irq_type = UART4_IRQn, \
.tx_pin_name = BSP_UART4_TX_PIN, \
.rx_pin_name = BSP_UART4_RX_PIN,
}
#endif
/* UART4_CONFIG */
#if defined(BSP_UART4_RX_USING_DMA)
#ifndef
UART4_DMA_RX_CONFIG
#define
UART4_DMA_RX_CONFIG \
{ \
.Instance = UART4_RX_DMA_INSTANCE, \
.channel = UART4_RX_DMA_CHANNEL, \
.dma_rcc = UART4_RX_DMA_RCC, \
.dma_irq = UART4_RX_DMA_IRQ,
}
#endif
/* UART4_DMA_RX_CONFIG /
#endif / BSP_UART4_RX_USING_DMA */
#if
defined(BSP_UART4_TX_USING_DMA)
#ifndef UART4_DMA_TX_CONFIG
#define
UART4_DMA_TX_CONFIG \
{ \
.Instance = UART4_TX_DMA_INSTANCE, \
.channel = UART4_TX_DMA_CHANNEL, \
.dma_rcc = UART4_TX_DMA_RCC, \
.dma_irq = UART4_TX_DMA_IRQ,
}
#endif
/* UART4_DMA_TX_CONFIG /
#endif / BSP_UART4_RX_USING_DMA /
#endif /
BSP_USING_UART4 */
#if defined(BSP_USING_UART5)
#ifndef
UART5_CONFIG
#define
UART5_CONFIG \
{ \
.name = "uart5", \
.Instance = UART5, \
.irq_type = UART5_IRQn, \
.tx_pin_name = BSP_UART5_TX_PIN, \
.rx_pin_name = BSP_UART5_RX_PIN,
}
#endif
/* UART5_CONFIG */
#if defined(BSP_UART5_RX_USING_DMA)
#ifndef
UART5_DMA_RX_CONFIG
#define
UART5_DMA_RX_CONFIG \
{ \
.Instance = UART5_RX_DMA_INSTANCE, \
.channel = UART5_RX_DMA_CHANNEL, \
.dma_rcc = UART5_RX_DMA_RCC, \
.dma_irq = UART5_RX_DMA_IRQ,
}
#endif
/* UART5_DMA_RX_CONFIG /
#endif / BSP_UART5_RX_USING_DMA */
#if
defined(BSP_UART5_TX_USING_DMA)
#ifndef UART5_DMA_TX_CONFIG
#define
UART5_DMA_TX_CONFIG \
{ \
.Instance = UART5_TX_DMA_INSTANCE, \
.channel = UART5_TX_DMA_CHANNEL, \
.dma_rcc = UART5_TX_DMA_RCC, \
.dma_irq = UART5_TX_DMA_IRQ,
}
#endif
/* UART5_DMA_TX_CONFIG /
#endif / BSP_UART5_TX_USING_DMA /
#endif /
BSP_USING_UART5 */
#if defined(BSP_USING_UART6)
#ifndef
UART6_CONFIG
#define
UART6_CONFIG \
{ \
.name = "uart6", \
.Instance = USART6, \
.irq_type = USART6_IRQn, \
.tx_pin_name = BSP_UART6_TX_PIN, \
.rx_pin_name = BSP_UART6_RX_PIN,
}
#endif
/* UART6_CONFIG */
#if defined(BSP_UART6_RX_USING_DMA)
#ifndef
UART6_DMA_RX_CONFIG
#define
UART6_DMA_RX_CONFIG \
{ \
.Instance = UART6_RX_DMA_INSTANCE, \
.channel = UART6_RX_DMA_CHANNEL, \
.dma_rcc = UART6_RX_DMA_RCC, \
.dma_irq = UART6_RX_DMA_IRQ,
}
#endif
/* UART6_DMA_RX_CONFIG /
#endif / BSP_UART6_RX_USING_DMA */
#if
defined(BSP_UART6_TX_USING_DMA)
#ifndef UART6_DMA_TX_CONFIG
#define
UART6_DMA_TX_CONFIG \
{ \
.Instance = UART6_TX_DMA_INSTANCE, \
.channel = UART6_TX_DMA_CHANNEL, \
.dma_rcc = UART6_TX_DMA_RCC, \
.dma_irq = UART6_TX_DMA_IRQ,
}
#endif
/* UART6_DMA_TX_CONFIG /
#endif / BSP_UART6_TX_USING_DMA /
#endif /
BSP_USING_UART6 */
#if defined(BSP_USING_UART7)
#ifndef
UART7_CONFIG
#define
UART7_CONFIG \
{ \
.name = "uart7", \
.Instance = UART7, \
.irq_type = UART7_IRQn, \
.tx_pin_name = BSP_UART7_TX_PIN, \
.rx_pin_name = BSP_UART7_RX_PIN,
}
#endif
/* UART7_CONFIG */
#if defined(BSP_UART7_RX_USING_DMA)
#ifndef
UART7_DMA_RX_CONFIG
#define
UART7_DMA_RX_CONFIG \
{ \
.Instance = UART7_RX_DMA_INSTANCE, \
.channel = UART7_RX_DMA_CHANNEL, \
.dma_rcc = UART7_RX_DMA_RCC, \
.dma_irq = UART7_RX_DMA_IRQ,
}
#endif
/* UART7_DMA_RX_CONFIG /
#endif / BSP_UART7_RX_USING_DMA */
#if
defined(BSP_UART7_TX_USING_DMA)
#ifndef UART7_DMA_TX_CONFIG
#define
UART7_DMA_TX_CONFIG \
{ \
.Instance = UART7_TX_DMA_INSTANCE, \
.channel = UART7_TX_DMA_CHANNEL, \
.dma_rcc = UART7_TX_DMA_RCC, \
.dma_irq = UART7_TX_DMA_IRQ,
}
#endif
/* UART7_DMA_TX_CONFIG /
#endif / BSP_UART7_TX_USING_DMA /
#endif /
BSP_USING_UART7 */
#if defined(BSP_USING_UART8)
#ifndef
UART8_CONFIG
#define
UART8_CONFIG \
{ \
.name = "uart8", \
.Instance = UART8, \
.irq_type = UART8_IRQn, \
.tx_pin_name = BSP_UART8_TX_PIN, \
.rx_pin_name = BSP_UART8_RX_PIN,
}
#endif
/* UART8_CONFIG */
#if defined(BSP_UART8_RX_USING_DMA)
#ifndef
UART8_DMA_RX_CONFIG
#define
UART8_DMA_RX_CONFIG \
{ \
.Instance = UART8_RX_DMA_INSTANCE, \
.channel = UART8_RX_DMA_CHANNEL, \
.dma_rcc = UART8_RX_DMA_RCC, \
.dma_irq = UART8_RX_DMA_IRQ,
}
#endif
/* UART8_DMA_RX_CONFIG /
#endif / BSP_UART8_RX_USING_DMA */
#if
defined(BSP_UART8_TX_USING_DMA)
#ifndef UART8_DMA_TX_CONFIG
#define
UART8_DMA_TX_CONFIG \
{ \
.Instance = UART8_TX_DMA_INSTANCE, \
.channel = UART8_TX_DMA_CHANNEL, \
.dma_rcc = UART8_TX_DMA_RCC, \
.dma_irq = UART8_TX_DMA_IRQ,
}
#endif
/* UART8_DMA_TX_CONFIG /
#endif / BSP_UART8_TX_USING_DMA /
#endif /
BSP_USING_UART8 /
#ifdef __cplusplus
}
#endif
#endif
/
Copyright (c) 2006-2021, RT-Thread Development Team
*
SPDX-License-Identifier: Apache-2.0
*
Date Author Notes
- 2018-10-30 SummerGift first
version
- 2019-01-05 zylx modify dma support
*/
#ifndef
UART_CONFIG_H
#define UART_CONFIG_H
#include
<rtthread.h>
#ifdef __cplusplus
extern "C" {
#endif
#if
defined(BSP_USING_UART1)
#ifndef UART1_CONFIG
#define
UART1_CONFIG \
{ \
.name = "uart1", \
.Instance = USART1, \
.irq_type = USART1_IRQn,
}
#endif
/* UART1_CONFIG /
#endif / BSP_USING_UART1 */
#if
defined(BSP_UART1_RX_USING_DMA)
#ifndef UART1_DMA_RX_CONFIG
#define
UART1_DMA_RX_CONFIG \
{ \
.Instance = UART1_RX_DMA_INSTANCE,
.channel
= UART1_RX_DMA_CHANNEL,
.dma_rcc =
UART1_RX_DMA_RCC,
.dma_irq =
UART1_RX_DMA_IRQ,
}
#endif /*
UART1_DMA_RX_CONFIG /
#endif / BSP_UART1_RX_USING_DMA */
#if
defined(BSP_USING_UART2)
#ifndef UART2_CONFIG
#define
UART2_CONFIG \
{ \
.name = "uart2", \
.Instance = USART2, \
.irq_type = USART2_IRQn,
}
#endif
/* UART2_CONFIG /
#endif / BSP_USING_UART2 */
#if
defined(BSP_UART2_RX_USING_DMA)
#ifndef UART2_DMA_RX_CONFIG
#define
UART2_DMA_RX_CONFIG \
{ \
.Instance = UART2_RX_DMA_INSTANCE,
.channel
= UART2_RX_DMA_CHANNEL,
.dma_rcc =
UART2_RX_DMA_RCC,
.dma_irq =
UART2_RX_DMA_IRQ,
}
#endif /*
UART2_DMA_RX_CONFIG /
#endif / BSP_UART2_RX_USING_DMA */
#if
defined(BSP_USING_UART3)
#ifndef UART3_CONFIG
#define
UART3_CONFIG \
{ \
.name = "uart3", \
.Instance = USART3, \
.irq_type = USART3_IRQn,
}
#endif
/* UART3_CONFIG /
#endif / BSP_USING_UART3 */
#if
defined(BSP_UART3_RX_USING_DMA)
#ifndef UART3_DMA_RX_CONFIG
#define
UART3_DMA_RX_CONFIG \
{ \
.Instance = UART3_RX_DMA_INSTANCE,
.channel
= UART3_RX_DMA_CHANNEL,
.dma_rcc =
UART3_RX_DMA_RCC,
.dma_irq =
UART3_RX_DMA_IRQ,
}
#endif /*
UART3_DMA_RX_CONFIG /
#endif / BSP_UART3_RX_USING_DMA */
#if
defined(BSP_USING_UART4)
#ifndef UART4_CONFIG
#define
UART4_CONFIG \
{ \
.name = "uart4", \
.Instance = UART4, \
.irq_type = UART4_IRQn,
}
#endif
/* UART4_CONFIG /
#endif / BSP_USING_UART4 */
#if
defined(BSP_UART4_RX_USING_DMA)
#ifndef UART4_DMA_RX_CONFIG
#define
UART4_DMA_RX_CONFIG \
{ \
.Instance = UART4_RX_DMA_INSTANCE,
.channel
= UART4_RX_DMA_CHANNEL,
.dma_rcc =
UART4_RX_DMA_RCC,
.dma_irq =
UART4_RX_DMA_IRQ,
}
#endif /*
UART4_DMA_RX_CONFIG /
#endif / BSP_UART4_RX_USING_DMA */
#if
defined(BSP_USING_UART5)
#ifndef UART5_CONFIG
#define
UART5_CONFIG \
{ \
.name = "uart5", \
.Instance = UART5, \
.irq_type = UART5_IRQn,
}
#endif
/* UART5_CONFIG /
#endif / BSP_USING_UART5 */
#if
defined(BSP_UART5_RX_USING_DMA)
#ifndef UART5_DMA_RX_CONFIG
#define
UART5_DMA_RX_CONFIG \
{ \
.Instance = UART5_RX_DMA_INSTANCE,
.channel
= UART5_RX_DMA_CHANNEL,
.dma_rcc =
UART5_RX_DMA_RCC,
.dma_irq =
UART5_RX_DMA_IRQ,
}
#endif /*
UART5_DMA_RX_CONFIG /
#endif / BSP_UART5_RX_USING_DMA */
#if
defined(BSP_USING_UART6)
#ifndef UART6_CONFIG
#define
UART6_CONFIG \
{ \
.name = "uart6", \
.Instance = USART6, \
.irq_type = USART6_IRQn, \
}
#endif /* UART6_CONFIG /
#endif / BSP_USING_UART6 */
#if
defined(BSP_UART6_RX_USING_DMA)
#ifndef UART6_DMA_RX_CONFIG
#define
UART6_DMA_RX_CONFIG \
{ \
.Instance = UART6_RX_DMA_INSTANCE,
.channel
= UART6_RX_DMA_CHANNEL,
.dma_rcc =
UART6_RX_DMA_RCC,
.dma_irq =
UART6_RX_DMA_IRQ,
}
#endif /*
UART6_DMA_RX_CONFIG /
#endif / BSP_UART6_RX_USING_DMA */
#ifdef
__cplusplus
}
#endif
#endif
对比一下明显少了TX和RX引脚的定义