Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
AdRainty
rt-thread
提交
d52a412f
R
rt-thread
项目概览
AdRainty
/
rt-thread
与 Fork 源项目一致
Fork自
RT-Thread / rt-thread
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rt-thread
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
d52a412f
编写于
5月 03, 2019
作者:
u010763290
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
增加串口DMA发送功能
上级
c2244a5c
变更
6
展开全部
隐藏空白更改
内联
并排
Showing
6 changed file
with
539 addition
and
168 deletion
+539
-168
bsp/stm32/libraries/HAL_Drivers/config/f4/dma_config.h
bsp/stm32/libraries/HAL_Drivers/config/f4/dma_config.h
+38
-1
bsp/stm32/libraries/HAL_Drivers/config/f4/uart_config.h
bsp/stm32/libraries/HAL_Drivers/config/f4/uart_config.h
+127
-55
bsp/stm32/libraries/HAL_Drivers/drv_usart.c
bsp/stm32/libraries/HAL_Drivers/drv_usart.c
+300
-110
bsp/stm32/libraries/HAL_Drivers/drv_usart.h
bsp/stm32/libraries/HAL_Drivers/drv_usart.h
+7
-2
bsp/stm32/stm32f407-atk-explorer/board/Kconfig
bsp/stm32/stm32f407-atk-explorer/board/Kconfig
+66
-0
components/drivers/serial/serial.c
components/drivers/serial/serial.c
+1
-0
未找到文件。
bsp/stm32/libraries/HAL_Drivers/config/f4/dma_config.h
浏览文件 @
d52a412f
...
@@ -64,6 +64,12 @@ extern "C" {
...
@@ -64,6 +64,12 @@ extern "C" {
#define SPI2_RX_DMA_INSTANCE DMA1_Stream3
#define SPI2_RX_DMA_INSTANCE DMA1_Stream3
#define SPI2_RX_DMA_CHANNEL DMA_CHANNEL_0
#define SPI2_RX_DMA_CHANNEL DMA_CHANNEL_0
#define SPI2_RX_DMA_IRQ DMA1_Stream3_IRQn
#define SPI2_RX_DMA_IRQ DMA1_Stream3_IRQn
#elif defined(BSP_UART3_TX_USING_DMA) && !defined(UART3_TX_DMA_INSTANCE)
#define UART3_DMA_TX_IRQHandler DMA1_Stream3_IRQHandler
#define UART3_TX_DMA_RCC RCC_AHB1ENR_DMA1EN
#define UART3_TX_DMA_INSTANCE DMA1_Stream3
#define UART3_TX_DMA_CHANNEL DMA_CHANNEL_4
#define UART3_TX_DMA_IRQ DMA1_Stream3_IRQn
#endif
#endif
/* DMA1 stream4 */
/* DMA1 stream4 */
...
@@ -73,6 +79,12 @@ extern "C" {
...
@@ -73,6 +79,12 @@ extern "C" {
#define SPI2_TX_DMA_INSTANCE DMA1_Stream4
#define SPI2_TX_DMA_INSTANCE DMA1_Stream4
#define SPI2_TX_DMA_CHANNEL DMA_CHANNEL_0
#define SPI2_TX_DMA_CHANNEL DMA_CHANNEL_0
#define SPI2_TX_DMA_IRQ DMA1_Stream4_IRQn
#define SPI2_TX_DMA_IRQ DMA1_Stream4_IRQn
#elif defined(BSP_UART4_TX_USING_DMA) && !defined(UART4_TX_DMA_INSTANCE)
#define UART4_DMA_TX_IRQHandler DMA1_Stream4_IRQHandler
#define UART4_TX_DMA_RCC RCC_AHB1ENR_DMA1EN
#define UART4_TX_DMA_INSTANCE DMA1_Stream4
#define UART4_TX_DMA_CHANNEL DMA_CHANNEL_4
#define UART4_TX_DMA_IRQ DMA1_Stream4_IRQn
#endif
#endif
/* DMA1 stream5 */
/* DMA1 stream5 */
...
@@ -91,6 +103,13 @@ extern "C" {
...
@@ -91,6 +103,13 @@ extern "C" {
#endif
#endif
/* DMA1 stream6 */
/* DMA1 stream6 */
#if defined(BSP_UART2_TX_USING_DMA) && !defined(UART2_TX_DMA_INSTANCE)
#define UART2_DMA_TX_IRQHandler DMA1_Stream6_IRQHandler
#define UART2_TX_DMA_RCC RCC_AHB1ENR_DMA1EN
#define UART2_TX_DMA_INSTANCE DMA1_Stream6
#define UART2_TX_DMA_CHANNEL DMA_CHANNEL_4
#define UART2_TX_DMA_IRQ DMA1_Stream6_IRQn
#endif
/* DMA1 stream7 */
/* DMA1 stream7 */
#if defined(BSP_SPI3_TX_USING_DMA) && !defined(SPI3_TX_DMA_INSTANCE)
#if defined(BSP_SPI3_TX_USING_DMA) && !defined(SPI3_TX_DMA_INSTANCE)
...
@@ -99,6 +118,12 @@ extern "C" {
...
@@ -99,6 +118,12 @@ extern "C" {
#define SPI3_TX_DMA_INSTANCE DMA1_Stream7
#define SPI3_TX_DMA_INSTANCE DMA1_Stream7
#define SPI3_TX_DMA_CHANNEL DMA_CHANNEL_0
#define SPI3_TX_DMA_CHANNEL DMA_CHANNEL_0
#define SPI3_TX_DMA_IRQ DMA1_Stream7_IRQn
#define SPI3_TX_DMA_IRQ DMA1_Stream7_IRQn
#elif defined(BSP_UART5_TX_USING_DMA) && !defined(UART5_TX_DMA_INSTANCE)
#define UART5_DMA_TX_IRQHandler DMA1_Stream7_IRQHandler
#define UART5_TX_DMA_RCC RCC_AHB1ENR_DMA1EN
#define UART5_TX_DMA_INSTANCE DMA1_Stream7
#define UART5_TX_DMA_CHANNEL DMA_CHANNEL_4
#define UART5_TX_DMA_IRQ DMA1_Stream7_IRQn
#endif
#endif
/* DMA2 stream0 */
/* DMA2 stream0 */
...
@@ -148,7 +173,6 @@ extern "C" {
...
@@ -148,7 +173,6 @@ extern "C" {
/* DMA2 stream3 */
/* DMA2 stream3 */
#if defined(BSP_SPI5_RX_USING_DMA) && !defined(SPI5_RX_DMA_INSTANCE)
#if defined(BSP_SPI5_RX_USING_DMA) && !defined(SPI5_RX_DMA_INSTANCE)
#define SPI5_DMA_RX_IRQHandler DMA2_Stream3_IRQHandler
#define SPI5_DMA_RX_IRQHandler DMA2_Stream3_IRQHandler
#define SPI5_RX_DMA_RCC RCC_AHB1ENR_DMA2EN
#define SPI5_RX_DMA_RCC RCC_AHB1ENR_DMA2EN
#define SPI5_RX_DMA_INSTANCE DMA2_Stream3
#define SPI5_RX_DMA_INSTANCE DMA2_Stream3
...
@@ -211,9 +235,22 @@ extern "C" {
...
@@ -211,9 +235,22 @@ extern "C" {
#define SPI5_TX_DMA_INSTANCE DMA2_Stream6
#define SPI5_TX_DMA_INSTANCE DMA2_Stream6
#define SPI5_TX_DMA_CHANNEL DMA_CHANNEL_7
#define SPI5_TX_DMA_CHANNEL DMA_CHANNEL_7
#define SPI5_TX_DMA_IRQ DMA2_Stream6_IRQn
#define SPI5_TX_DMA_IRQ DMA2_Stream6_IRQn
#elif defined(BSP_UART6_TX_USING_DMA) && !defined(UART6_TX_DMA_INSTANCE)
#define UART6_DMA_TX_IRQHandler DMA2_Stream6_IRQHandler
#define UART6_TX_DMA_RCC RCC_AHB1ENR_DMA2EN
#define UART6_TX_DMA_INSTANCE DMA2_Stream6
#define UART6_TX_DMA_CHANNEL DMA_CHANNEL_5
#define UART6_TX_DMA_IRQ DMA2_Stream6_IRQn
#endif
#endif
/* DMA2 stream7 */
/* DMA2 stream7 */
#if defined(BSP_UART1_TX_USING_DMA) && !defined(UART1_TX_DMA_INSTANCE)
#define UART1_DMA_TX_IRQHandler DMA2_Stream7_IRQHandler
#define UART1_TX_DMA_RCC RCC_AHB1ENR_DMA2EN
#define UART1_TX_DMA_INSTANCE DMA2_Stream7
#define UART1_TX_DMA_CHANNEL DMA_CHANNEL_4
#define UART1_TX_DMA_IRQ DMA2_Stream7_IRQn
#endif
#ifdef __cplusplus
#ifdef __cplusplus
}
}
...
...
bsp/stm32/libraries/HAL_Drivers/config/f4/uart_config.h
浏览文件 @
d52a412f
...
@@ -27,20 +27,32 @@ extern "C" {
...
@@ -27,20 +27,32 @@ extern "C" {
.irq_type = USART1_IRQn, \
.irq_type = USART1_IRQn, \
}
}
#endif
/* UART1_CONFIG */
#endif
/* UART1_CONFIG */
#endif
/* BSP_USING_UART1 */
#if defined(BSP_UART1_RX_USING_DMA)
#if defined(BSP_UART1_RX_USING_DMA)
#ifndef UART1_DMA_CONFIG
#ifndef UART1_DMA_
RX_
CONFIG
#define UART1_DMA_
CONFIG
\
#define UART1_DMA_
RX_CONFIG
\
{
\
{ \
.Instance = UART1_RX_DMA_INSTANCE,
\
.Instance = UART1_RX_DMA_INSTANCE, \
.channel = UART1_RX_DMA_CHANNEL,
\
.channel = UART1_RX_DMA_CHANNEL, \
.dma_rcc = UART1_RX_DMA_RCC,
\
.dma_rcc = UART1_RX_DMA_RCC, \
.dma_irq = UART1_RX_DMA_IRQ,
\
.dma_irq = UART1_RX_DMA_IRQ, \
}
}
#endif
/* UART1_DMA_CONFIG */
#endif
/* UART1_DMA_
RX_
CONFIG */
#endif
/* BSP_UART1_RX_USING_DMA */
#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)
#if defined(BSP_USING_UART2)
#ifndef UART2_CONFIG
#ifndef UART2_CONFIG
#define UART2_CONFIG \
#define UART2_CONFIG \
...
@@ -50,19 +62,31 @@ extern "C" {
...
@@ -50,19 +62,31 @@ extern "C" {
.irq_type = USART2_IRQn, \
.irq_type = USART2_IRQn, \
}
}
#endif
/* UART2_CONFIG */
#endif
/* UART2_CONFIG */
#endif
/* BSP_USING_UART2 */
#if defined(BSP_UART2_RX_USING_DMA)
#if defined(BSP_UART2_RX_USING_DMA)
#ifndef UART2_DMA_CONFIG
#ifndef UART2_DMA_
RX_
CONFIG
#define UART2_DMA_
CONFIG
\
#define UART2_DMA_
RX_CONFIG
\
{
\
{ \
.Instance = UART2_RX_DMA_INSTANCE,
\
.Instance = UART2_RX_DMA_INSTANCE, \
.channel = UART2_RX_DMA_CHANNEL,
\
.channel = UART2_RX_DMA_CHANNEL, \
.dma_rcc = UART2_RX_DMA_RCC,
\
.dma_rcc = UART2_RX_DMA_RCC, \
.dma_irq = UART2_RX_DMA_IRQ,
\
.dma_irq = UART2_RX_DMA_IRQ, \
}
}
#endif
/* UART2_DMA_CONFIG */
#endif
/* UART2_DMA_
RX_
CONFIG */
#endif
/* BSP_UART2_RX_USING_DMA */
#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)
#if defined(BSP_USING_UART3)
#ifndef UART3_CONFIG
#ifndef UART3_CONFIG
...
@@ -73,19 +97,31 @@ extern "C" {
...
@@ -73,19 +97,31 @@ extern "C" {
.irq_type = USART3_IRQn, \
.irq_type = USART3_IRQn, \
}
}
#endif
/* UART3_CONFIG */
#endif
/* UART3_CONFIG */
#endif
/* BSP_USING_UART3 */
#if defined(BSP_UART3_RX_USING_DMA)
#if defined(BSP_UART3_RX_USING_DMA)
#ifndef UART3_DMA_CONFIG
#ifndef UART3_DMA_
RX_
CONFIG
#define UART3_DMA_
CONFIG
\
#define UART3_DMA_
RX_CONFIG
\
{
\
{ \
.Instance = UART3_RX_DMA_INSTANCE,
\
.Instance = UART3_RX_DMA_INSTANCE, \
.channel = UART3_RX_DMA_CHANNEL,
\
.channel = UART3_RX_DMA_CHANNEL, \
.dma_rcc = UART3_RX_DMA_RCC,
\
.dma_rcc = UART3_RX_DMA_RCC, \
.dma_irq = UART3_RX_DMA_IRQ,
\
.dma_irq = UART3_RX_DMA_IRQ, \
}
}
#endif
/* UART3_DMA_CONFIG */
#endif
/* UART3_DMA_
RX_
CONFIG */
#endif
/* BSP_UART3_RX_USING_DMA */
#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)
#if defined(BSP_USING_UART4)
#ifndef UART4_CONFIG
#ifndef UART4_CONFIG
...
@@ -96,20 +132,32 @@ extern "C" {
...
@@ -96,20 +132,32 @@ extern "C" {
.irq_type = UART4_IRQn, \
.irq_type = UART4_IRQn, \
}
}
#endif
/* UART4_CONFIG */
#endif
/* UART4_CONFIG */
#endif
/* BSP_USING_UART4 */
#if defined(BSP_UART4_RX_USING_DMA)
#if defined(BSP_UART4_RX_USING_DMA)
#ifndef UART4_DMA_CONFIG
#ifndef UART4_DMA_
RX_
CONFIG
#define UART4_DMA_
CONFIG
\
#define UART4_DMA_
RX_CONFIG
\
{
\
{ \
.Instance = UART4_RX_DMA_INSTANCE,
\
.Instance = UART4_RX_DMA_INSTANCE, \
.channel = UART4_RX_DMA_CHANNEL,
\
.channel = UART4_RX_DMA_CHANNEL, \
.dma_rcc = UART4_RX_DMA_RCC,
\
.dma_rcc = UART4_RX_DMA_RCC, \
.dma_irq = UART4_RX_DMA_IRQ,
\
.dma_irq = UART4_RX_DMA_IRQ, \
}
}
#endif
/* UART4_DMA_CONFIG */
#endif
/* UART4_DMA_
RX_
CONFIG */
#endif
/* BSP_UART4_RX_USING_DMA */
#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)
#if defined(BSP_USING_UART5)
#ifndef UART5_CONFIG
#ifndef UART5_CONFIG
#define UART5_CONFIG \
#define UART5_CONFIG \
...
@@ -119,19 +167,31 @@ extern "C" {
...
@@ -119,19 +167,31 @@ extern "C" {
.irq_type = UART5_IRQn, \
.irq_type = UART5_IRQn, \
}
}
#endif
/* UART5_CONFIG */
#endif
/* UART5_CONFIG */
#endif
/* BSP_USING_UART5 */
#if defined(BSP_UART5_RX_USING_DMA)
#if defined(BSP_UART5_RX_USING_DMA)
#ifndef UART5_DMA_CONFIG
#ifndef UART5_DMA_
RX_
CONFIG
#define UART5_DMA_
CONFIG
\
#define UART5_DMA_
RX_CONFIG
\
{
\
{ \
.Instance = UART5_RX_DMA_INSTANCE,
\
.Instance = UART5_RX_DMA_INSTANCE, \
.channel = UART5_RX_DMA_CHANNEL,
\
.channel = UART5_RX_DMA_CHANNEL, \
.dma_rcc = UART5_RX_DMA_RCC,
\
.dma_rcc = UART5_RX_DMA_RCC, \
.dma_irq = UART5_RX_DMA_IRQ,
\
.dma_irq = UART5_RX_DMA_IRQ, \
}
}
#endif
/* UART5_DMA_CONFIG */
#endif
/* UART5_DMA_
RX_
CONFIG */
#endif
/* BSP_UART5_RX_USING_DMA */
#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)
#if defined(BSP_USING_UART6)
#ifndef UART6_CONFIG
#ifndef UART6_CONFIG
...
@@ -142,19 +202,31 @@ extern "C" {
...
@@ -142,19 +202,31 @@ extern "C" {
.irq_type = USART6_IRQn, \
.irq_type = USART6_IRQn, \
}
}
#endif
/* UART6_CONFIG */
#endif
/* UART6_CONFIG */
#endif
/* BSP_USING_UART6 */
#if defined(BSP_UART6_RX_USING_DMA)
#if defined(BSP_UART6_RX_USING_DMA)
#ifndef UART6_DMA_CONFIG
#ifndef UART6_DMA_
RX_
CONFIG
#define UART6_DMA_
CONFIG
\
#define UART6_DMA_
RX_CONFIG
\
{
\
{ \
.Instance = UART6_RX_DMA_INSTANCE,
\
.Instance = UART6_RX_DMA_INSTANCE, \
.channel = UART6_RX_DMA_CHANNEL,
\
.channel = UART6_RX_DMA_CHANNEL, \
.dma_rcc = UART6_RX_DMA_RCC,
\
.dma_rcc = UART6_RX_DMA_RCC, \
.dma_irq = UART6_RX_DMA_IRQ,
\
.dma_irq = UART6_RX_DMA_IRQ, \
}
}
#endif
/* UART6_DMA_CONFIG */
#endif
/* UART6_DMA_
RX_
CONFIG */
#endif
/* BSP_UART6_RX_USING_DMA */
#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 */
#ifdef __cplusplus
#ifdef __cplusplus
}
}
...
...
bsp/stm32/libraries/HAL_Drivers/drv_usart.c
浏览文件 @
d52a412f
此差异已折叠。
点击以展开。
bsp/stm32/libraries/HAL_Drivers/drv_usart.h
浏览文件 @
d52a412f
...
@@ -41,6 +41,7 @@ struct stm32_uart_config
...
@@ -41,6 +41,7 @@ struct stm32_uart_config
USART_TypeDef
*
Instance
;
USART_TypeDef
*
Instance
;
IRQn_Type
irq_type
;
IRQn_Type
irq_type
;
struct
dma_config
*
dma_rx
;
struct
dma_config
*
dma_rx
;
struct
dma_config
*
dma_tx
;
};
};
/* stm32 uart dirver class */
/* stm32 uart dirver class */
...
@@ -54,9 +55,13 @@ struct stm32_uart
...
@@ -54,9 +55,13 @@ struct stm32_uart
{
{
DMA_HandleTypeDef
handle
;
DMA_HandleTypeDef
handle
;
rt_size_t
last_index
;
rt_size_t
last_index
;
}
dma
;
}
dma_rx
;
struct
{
DMA_HandleTypeDef
handle
;
}
dma_tx
;
#endif
#endif
rt_uint
8
_t
uart_dma_flag
;
rt_uint
16
_t
uart_dma_flag
;
struct
rt_serial_device
serial
;
struct
rt_serial_device
serial
;
};
};
...
...
bsp/stm32/stm32f407-atk-explorer/board/Kconfig
浏览文件 @
d52a412f
...
@@ -83,6 +83,25 @@ menu "On-chip Peripheral Drivers"
...
@@ -83,6 +83,25 @@ menu "On-chip Peripheral Drivers"
depends on BSP_USING_UART1 && RT_SERIAL_USING_DMA
depends on BSP_USING_UART1 && RT_SERIAL_USING_DMA
default n
default n
config BSP_UART1_TX_USING_DMA
bool "Enable UART1 TX DMA"
depends on BSP_USING_UART1 && RT_SERIAL_USING_DMA
default n
config BSP_USING_UART2
bool "Enable UART2"
default n
config BSP_UART2_RX_USING_DMA
bool "Enable UART2 RX DMA"
depends on BSP_USING_UART2 && RT_SERIAL_USING_DMA
default n
config BSP_UART2_TX_USING_DMA
bool "Enable UART2 TX DMA"
depends on BSP_USING_UART2 && RT_SERIAL_USING_DMA
default n
config BSP_USING_UART3
config BSP_USING_UART3
bool "Enable UART3"
bool "Enable UART3"
default n
default n
...
@@ -90,6 +109,53 @@ menu "On-chip Peripheral Drivers"
...
@@ -90,6 +109,53 @@ menu "On-chip Peripheral Drivers"
config BSP_UART3_RX_USING_DMA
config BSP_UART3_RX_USING_DMA
bool "Enable UART3 RX DMA"
bool "Enable UART3 RX DMA"
depends on BSP_USING_UART3 && RT_SERIAL_USING_DMA
depends on BSP_USING_UART3 && RT_SERIAL_USING_DMA
default n
config BSP_UART3_TX_USING_DMA
bool "Enable UART3 TX DMA"
depends on BSP_USING_UART3 && RT_SERIAL_USING_DMA
default n
config BSP_USING_UART4
bool "Enable UART4"
default n
config BSP_UART4_RX_USING_DMA
bool "Enable UART4 RX DMA"
depends on BSP_USING_UART4 && RT_SERIAL_USING_DMA
default n
config BSP_UART4_TX_USING_DMA
bool "Enable UART4 TX DMA"
depends on BSP_USING_UART4 && RT_SERIAL_USING_DMA
default n
config BSP_USING_UART5
bool "Enable UART5"
default n
config BSP_UART5_RX_USING_DMA
bool "Enable UART5 RX DMA"
depends on BSP_USING_UART5 && RT_SERIAL_USING_DMA
default n
config BSP_UART5_TX_USING_DMA
bool "Enable UART5 TX DMA"
depends on BSP_USING_UART5 && RT_SERIAL_USING_DMA
default n
config BSP_USING_UART6
bool "Enable UART6"
default n
config BSP_UART6_RX_USING_DMA
bool "Enable UART6 RX DMA"
depends on BSP_USING_UART6 && RT_SERIAL_USING_DMA
default n
config BSP_UART6_TX_USING_DMA
bool "Enable UART6 TX DMA"
depends on BSP_USING_UART6 && RT_SERIAL_USING_DMA
default n
default n
endif
endif
...
...
components/drivers/serial/serial.c
浏览文件 @
d52a412f
...
@@ -675,6 +675,7 @@ static rt_err_t rt_serial_open(struct rt_device *dev, rt_uint16_t oflag)
...
@@ -675,6 +675,7 @@ static rt_err_t rt_serial_open(struct rt_device *dev, rt_uint16_t oflag)
serial
->
serial_tx
=
tx_dma
;
serial
->
serial_tx
=
tx_dma
;
dev
->
open_flag
|=
RT_DEVICE_FLAG_DMA_TX
;
dev
->
open_flag
|=
RT_DEVICE_FLAG_DMA_TX
;
serial
->
ops
->
control
(
serial
,
RT_DEVICE_CTRL_CONFIG
,
(
void
*
)
RT_DEVICE_FLAG_DMA_TX
);
}
}
#endif
/* RT_SERIAL_USING_DMA */
#endif
/* RT_SERIAL_USING_DMA */
else
else
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录