Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lfmiao0
rt-thread
提交
20d9ac45
R
rt-thread
项目概览
lfmiao0
/
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,发现更多精彩内容 >>
未验证
提交
20d9ac45
编写于
9月 15, 2019
作者:
B
Bernard Xiong
提交者:
GitHub
9月 15, 2019
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #3054 from a1012112796/writing_zzc_add_bsp_robomaster_a
[bsp][stm32] 更新stm32f427-robomaster-a外设驱动配置
上级
6db1bd45
60bda424
变更
14
隐藏空白更改
内联
并排
Showing
14 changed file
with
1118 addition
and
46 deletion
+1118
-46
bsp/stm32/README.md
bsp/stm32/README.md
+1
-0
bsp/stm32/libraries/HAL_Drivers/config/f4/dma_config.h
bsp/stm32/libraries/HAL_Drivers/config/f4/dma_config.h
+24
-0
bsp/stm32/libraries/HAL_Drivers/config/f4/pwm_config.h
bsp/stm32/libraries/HAL_Drivers/config/f4/pwm_config.h
+11
-0
bsp/stm32/libraries/HAL_Drivers/config/f4/uart_config.h
bsp/stm32/libraries/HAL_Drivers/config/f4/uart_config.h
+70
-0
bsp/stm32/libraries/HAL_Drivers/drv_pwm.c
bsp/stm32/libraries/HAL_Drivers/drv_pwm.c
+6
-0
bsp/stm32/libraries/HAL_Drivers/drv_usart.c
bsp/stm32/libraries/HAL_Drivers/drv_usart.c
+89
-2
bsp/stm32/stm32f427-robomaster-a/.config
bsp/stm32/stm32f427-robomaster-a/.config
+14
-2
bsp/stm32/stm32f427-robomaster-a/README.md
bsp/stm32/stm32f427-robomaster-a/README.md
+4
-4
bsp/stm32/stm32f427-robomaster-a/board/CubeMX_Config/CubeMX_Config.ioc
...32f427-robomaster-a/board/CubeMX_Config/CubeMX_Config.ioc
+133
-22
bsp/stm32/stm32f427-robomaster-a/board/CubeMX_Config/Inc/main.h
...m32/stm32f427-robomaster-a/board/CubeMX_Config/Inc/main.h
+2
-0
bsp/stm32/stm32f427-robomaster-a/board/CubeMX_Config/Inc/stm32f4xx_hal_conf.h
...robomaster-a/board/CubeMX_Config/Inc/stm32f4xx_hal_conf.h
+1
-1
bsp/stm32/stm32f427-robomaster-a/board/CubeMX_Config/Src/main.c
...m32/stm32f427-robomaster-a/board/CubeMX_Config/Src/main.c
+351
-2
bsp/stm32/stm32f427-robomaster-a/board/CubeMX_Config/Src/stm32f4xx_hal_msp.c
...-robomaster-a/board/CubeMX_Config/Src/stm32f4xx_hal_msp.c
+342
-3
bsp/stm32/stm32f427-robomaster-a/board/Kconfig
bsp/stm32/stm32f427-robomaster-a/board/Kconfig
+70
-10
未找到文件。
bsp/stm32/README.md
浏览文件 @
20d9ac45
...
@@ -21,6 +21,7 @@ STM32 系列 BSP 目前支持情况如下表所示:
...
@@ -21,6 +21,7 @@ STM32 系列 BSP 目前支持情况如下表所示:
|
[
stm32f407-st-discovery
](
stm32f407-st-discovery
)
| ST 官方 STM32F407-discovery 开发板 |
|
[
stm32f407-st-discovery
](
stm32f407-st-discovery
)
| ST 官方 STM32F407-discovery 开发板 |
|
[
stm32f407-atk-explorer
](
stm32f407-atk-explorer
)
| 正点原子 F407 探索者开发板 |
|
[
stm32f407-atk-explorer
](
stm32f407-atk-explorer
)
| 正点原子 F407 探索者开发板 |
|
[
stm32f411-st-nucleo
](
stm32f411-st-nucleo/
)
| ST 官方 STM32F411-Nucleo-64 开发板 |
|
[
stm32f411-st-nucleo
](
stm32f411-st-nucleo/
)
| ST 官方 STM32F411-Nucleo-64 开发板 |
|
[
stm32f427-robomaster-a
](
stm32f427-robomaster-a/
)
|大疆公司 RoboMaster A型开发板|
|
[
stm32f429-atk-apollo
](
stm32f429-atk-apollo
)
| 正点原子 F429 阿波罗开发板 |
|
[
stm32f429-atk-apollo
](
stm32f429-atk-apollo
)
| 正点原子 F429 阿波罗开发板 |
|
[
stm32f429-fire-challenger
](
stm32f429-fire-challenger/
)
| 野火 F429 挑战者开发板 |
|
[
stm32f429-fire-challenger
](
stm32f429-fire-challenger/
)
| 野火 F429 挑战者开发板 |
|
[
stm32f429-armfly-v6
](
stm32f429-armfly-v6
)
| 安富莱 F429-v6 开发板 |
|
[
stm32f429-armfly-v6
](
stm32f429-armfly-v6
)
| 安富莱 F429-v6 开发板 |
...
...
bsp/stm32/libraries/HAL_Drivers/config/f4/dma_config.h
浏览文件 @
20d9ac45
...
@@ -31,6 +31,12 @@ extern "C" {
...
@@ -31,6 +31,12 @@ extern "C" {
#define UART5_RX_DMA_INSTANCE DMA1_Stream0
#define UART5_RX_DMA_INSTANCE DMA1_Stream0
#define UART5_RX_DMA_CHANNEL DMA_CHANNEL_4
#define UART5_RX_DMA_CHANNEL DMA_CHANNEL_4
#define UART5_RX_DMA_IRQ DMA1_Stream0_IRQn
#define UART5_RX_DMA_IRQ DMA1_Stream0_IRQn
#elif defined(BSP_UART8_TX_USING_DMA) && !defined(UART8_TX_DMA_INSTANCE)
#define UART8_DMA_TX_IRQHandler DMA1_Stream0_IRQHandler
#define UART8_TX_DMA_RCC RCC_AHB1ENR_DMA1EN
#define UART8_TX_DMA_INSTANCE DMA1_Stream0
#define UART8_TX_DMA_CHANNEL DMA_CHANNEL_5
#define UART8_TX_DMA_IRQ DMA1_Stream0_IRQn
#endif
#endif
/* DMA1 stream1 */
/* DMA1 stream1 */
...
@@ -40,6 +46,12 @@ extern "C" {
...
@@ -40,6 +46,12 @@ extern "C" {
#define UART3_RX_DMA_INSTANCE DMA1_Stream1
#define UART3_RX_DMA_INSTANCE DMA1_Stream1
#define UART3_RX_DMA_CHANNEL DMA_CHANNEL_4
#define UART3_RX_DMA_CHANNEL DMA_CHANNEL_4
#define UART3_RX_DMA_IRQ DMA1_Stream1_IRQn
#define UART3_RX_DMA_IRQ DMA1_Stream1_IRQn
#elif defined(BSP_UART7_RX_USING_DMA) && !defined(UART7_RX_DMA_INSTANCE)
#define UART7_DMA_RX_IRQHandler DMA1_Stream1_IRQHandler
#define UART7_RX_DMA_RCC RCC_AHB1ENR_DMA1EN
#define UART7_RX_DMA_INSTANCE DMA1_Stream1
#define UART7_RX_DMA_CHANNEL DMA_CHANNEL_5
#define UART7_RX_DMA_IRQ DMA1_Stream1_IRQn
#endif
#endif
/* DMA1 stream2 */
/* DMA1 stream2 */
...
@@ -70,6 +82,12 @@ extern "C" {
...
@@ -70,6 +82,12 @@ extern "C" {
#define UART3_TX_DMA_INSTANCE DMA1_Stream3
#define UART3_TX_DMA_INSTANCE DMA1_Stream3
#define UART3_TX_DMA_CHANNEL DMA_CHANNEL_4
#define UART3_TX_DMA_CHANNEL DMA_CHANNEL_4
#define UART3_TX_DMA_IRQ DMA1_Stream3_IRQn
#define UART3_TX_DMA_IRQ DMA1_Stream3_IRQn
#elif defined(BSP_UART7_TX_USING_DMA) && !defined(UART7_TX_DMA_INSTANCE)
#define UART7_DMA_RX_IRQHandler DMA1_Stream3_IRQHandler
#define UART7_RX_DMA_RCC RCC_AHB1ENR_DMA1EN
#define UART7_RX_DMA_INSTANCE DMA1_Stream3
#define UART7_RX_DMA_CHANNEL DMA_CHANNEL_5
#define UART7_RX_DMA_IRQ DMA1_Stream3_IRQn
#endif
#endif
/* DMA1 stream4 */
/* DMA1 stream4 */
...
@@ -109,6 +127,12 @@ extern "C" {
...
@@ -109,6 +127,12 @@ extern "C" {
#define UART2_TX_DMA_INSTANCE DMA1_Stream6
#define UART2_TX_DMA_INSTANCE DMA1_Stream6
#define UART2_TX_DMA_CHANNEL DMA_CHANNEL_4
#define UART2_TX_DMA_CHANNEL DMA_CHANNEL_4
#define UART2_TX_DMA_IRQ DMA1_Stream6_IRQn
#define UART2_TX_DMA_IRQ DMA1_Stream6_IRQn
#elif defined(BSP_UART8_RX_USING_DMA) && !defined(UART8_RX_DMA_INSTANCE)
#define UART8_DMA_RX_IRQHandler DMA1_Stream6_IRQHandler
#define UART8_RX_DMA_RCC RCC_AHB1ENR_DMA1EN
#define UART8_RX_DMA_INSTANCE DMA1_Stream6
#define UART8_RX_DMA_CHANNEL DMA_CHANNEL_5
#define UART8_RX_DMA_IRQ DMA1_Stream6_IRQn
#endif
#endif
/* DMA1 stream7 */
/* DMA1 stream7 */
...
...
bsp/stm32/libraries/HAL_Drivers/config/f4/pwm_config.h
浏览文件 @
20d9ac45
...
@@ -61,6 +61,17 @@ extern "C" {
...
@@ -61,6 +61,17 @@ extern "C" {
#endif
/* PWM5_CONFIG */
#endif
/* PWM5_CONFIG */
#endif
/* BSP_USING_PWM5 */
#endif
/* BSP_USING_PWM5 */
#ifdef BSP_USING_PWM12
#ifndef PWM12_CONFIG
#define PWM12_CONFIG \
{ \
.tim_handle.Instance = TIM12, \
.name = "pwm12", \
.channel = 0 \
}
#endif
/* PWM12_CONFIG */
#endif
/* BSP_USING_PWM12 */
#ifdef __cplusplus
#ifdef __cplusplus
}
}
#endif
#endif
...
...
bsp/stm32/libraries/HAL_Drivers/config/f4/uart_config.h
浏览文件 @
20d9ac45
...
@@ -228,6 +228,76 @@ extern "C" {
...
@@ -228,6 +228,76 @@ extern "C" {
#endif
/* BSP_UART6_TX_USING_DMA */
#endif
/* BSP_UART6_TX_USING_DMA */
#endif
/* BSP_USING_UART6 */
#endif
/* BSP_USING_UART6 */
#if defined(BSP_USING_UART7)
#ifndef UART7_CONFIG
#define UART7_CONFIG \
{ \
.name = "uart7", \
.Instance = UART7, \
.irq_type = UART7_IRQn, \
}
#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, \
}
#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
#ifdef __cplusplus
}
}
#endif
#endif
...
...
bsp/stm32/libraries/HAL_Drivers/drv_pwm.c
浏览文件 @
20d9ac45
...
@@ -520,6 +520,12 @@ static void pwm_get_channel(void)
...
@@ -520,6 +520,12 @@ static void pwm_get_channel(void)
#ifdef BSP_USING_PWM9_CH4
#ifdef BSP_USING_PWM9_CH4
stm32_pwm_obj
[
PWM9_INDEX
].
channel
|=
1
<<
3
;
stm32_pwm_obj
[
PWM9_INDEX
].
channel
|=
1
<<
3
;
#endif
#endif
#ifdef BSP_USING_PWM12_CH1
stm32_pwm_obj
[
PWM12_INDEX
].
channel
|=
1
<<
0
;
#endif
#ifdef BSP_USING_PWM12_CH2
stm32_pwm_obj
[
PWM12_INDEX
].
channel
|=
1
<<
1
;
#endif
}
}
static
int
stm32_pwm_init
(
void
)
static
int
stm32_pwm_init
(
void
)
...
...
bsp/stm32/libraries/HAL_Drivers/drv_usart.c
浏览文件 @
20d9ac45
...
@@ -18,8 +18,9 @@
...
@@ -18,8 +18,9 @@
#define LOG_TAG "drv.usart"
#define LOG_TAG "drv.usart"
#include <drv_log.h>
#include <drv_log.h>
#if !defined(BSP_USING_UART1) && !defined(BSP_USING_UART2) && !defined(BSP_USING_UART3) \
#if !defined(BSP_USING_UART1) && !defined(BSP_USING_UART2) && !defined(BSP_USING_UART3) && \
&& !defined(BSP_USING_UART4) && !defined(BSP_USING_UART5) && !defined(BSP_USING_UART6) && !defined(BSP_USING_LPUART1)
!defined(BSP_USING_UART4) && !defined(BSP_USING_UART5) && !defined(BSP_USING_UART6) && \
!defined(BSP_USING_UART7) && !defined(BSP_USING_UART8) && !defined(BSP_USING_LPUART1)
#error "Please define at least one BSP_USING_UARTx"
#error "Please define at least one BSP_USING_UARTx"
/* this driver can be disabled at menuconfig → RT-Thread Components → Device Drivers */
/* this driver can be disabled at menuconfig → RT-Thread Components → Device Drivers */
#endif
#endif
...
@@ -48,6 +49,12 @@ enum
...
@@ -48,6 +49,12 @@ enum
#ifdef BSP_USING_UART6
#ifdef BSP_USING_UART6
UART6_INDEX
,
UART6_INDEX
,
#endif
#endif
#ifdef BSP_USING_UART7
UART7_INDEX
,
#endif
#ifdef BSP_USING_UART8
UART8_INDEX
,
#endif
#ifdef BSP_USING_LPUART1
#ifdef BSP_USING_LPUART1
LPUART1_INDEX
,
LPUART1_INDEX
,
#endif
#endif
...
@@ -73,6 +80,12 @@ static struct stm32_uart_config uart_config[] =
...
@@ -73,6 +80,12 @@ static struct stm32_uart_config uart_config[] =
#ifdef BSP_USING_UART6
#ifdef BSP_USING_UART6
UART6_CONFIG
,
UART6_CONFIG
,
#endif
#endif
#ifdef BSP_USING_UART7
UART7_CONFIG
,
#endif
#ifdef BSP_USING_UART8
UART8_CONFIG
,
#endif
#ifdef BSP_USING_LPUART1
#ifdef BSP_USING_LPUART1
LPUART1_CONFIG
,
LPUART1_CONFIG
,
#endif
#endif
...
@@ -606,6 +619,80 @@ void UART6_DMA_TX_IRQHandler(void)
...
@@ -606,6 +619,80 @@ void UART6_DMA_TX_IRQHandler(void)
#endif
/* defined(RT_SERIAL_USING_DMA) && defined(BSP_UART6_TX_USING_DMA) */
#endif
/* defined(RT_SERIAL_USING_DMA) && defined(BSP_UART6_TX_USING_DMA) */
#endif
/* BSP_USING_UART6*/
#endif
/* BSP_USING_UART6*/
#if defined(BSP_USING_UART7)
void
UART7_IRQHandler
(
void
)
{
/* enter interrupt */
rt_interrupt_enter
();
uart_isr
(
&
(
uart_obj
[
UART7_INDEX
].
serial
));
/* leave interrupt */
rt_interrupt_leave
();
}
#if defined(RT_SERIAL_USING_DMA) && defined(BSP_UART7_RX_USING_DMA)
void
UART7_DMA_RX_IRQHandler
(
void
)
{
/* enter interrupt */
rt_interrupt_enter
();
HAL_DMA_IRQHandler
(
&
uart_obj
[
UART7_INDEX
].
dma_rx
.
handle
);
/* leave interrupt */
rt_interrupt_leave
();
}
#endif
/* defined(RT_SERIAL_USING_DMA) && defined(BSP_UART7_RX_USING_DMA) */
#if defined(RT_SERIAL_USING_DMA) && defined(BSP_UART7_TX_USING_DMA)
void
UART7_DMA_TX_IRQHandler
(
void
)
{
/* enter interrupt */
rt_interrupt_enter
();
HAL_DMA_IRQHandler
(
&
uart_obj
[
UART7_INDEX
].
dma_tx
.
handle
);
/* leave interrupt */
rt_interrupt_leave
();
}
#endif
/* defined(RT_SERIAL_USING_DMA) && defined(BSP_UART7_TX_USING_DMA) */
#endif
/* BSP_USING_UART7*/
#if defined(BSP_USING_UART8)
void
UART8_IRQHandler
(
void
)
{
/* enter interrupt */
rt_interrupt_enter
();
uart_isr
(
&
(
uart_obj
[
UART8_INDEX
].
serial
));
/* leave interrupt */
rt_interrupt_leave
();
}
#if defined(RT_SERIAL_USING_DMA) && defined(BSP_UART8_RX_USING_DMA)
void
UART8_DMA_RX_IRQHandler
(
void
)
{
/* enter interrupt */
rt_interrupt_enter
();
HAL_DMA_IRQHandler
(
&
uart_obj
[
UART8_INDEX
].
dma_rx
.
handle
);
/* leave interrupt */
rt_interrupt_leave
();
}
#endif
/* defined(RT_SERIAL_USING_DMA) && defined(BSP_UART8_RX_USING_DMA) */
#if defined(RT_SERIAL_USING_DMA) && defined(BSP_UART8_TX_USING_DMA)
void
UART8_DMA_TX_IRQHandler
(
void
)
{
/* enter interrupt */
rt_interrupt_enter
();
HAL_DMA_IRQHandler
(
&
uart_obj
[
UART8_INDEX
].
dma_tx
.
handle
);
/* leave interrupt */
rt_interrupt_leave
();
}
#endif
/* defined(RT_SERIAL_USING_DMA) && defined(BSP_UART8_TX_USING_DMA) */
#endif
/* BSP_USING_UART8*/
#if defined(BSP_USING_LPUART1)
#if defined(BSP_USING_LPUART1)
void
LPUART1_IRQHandler
(
void
)
void
LPUART1_IRQHandler
(
void
)
{
{
...
...
bsp/stm32/stm32f427-robomaster-a/.config
浏览文件 @
20d9ac45
...
@@ -123,7 +123,7 @@ CONFIG_RT_SERIAL_RB_BUFSZ=64
...
@@ -123,7 +123,7 @@ CONFIG_RT_SERIAL_RB_BUFSZ=64
# CONFIG_RT_USING_I2C is not set
# CONFIG_RT_USING_I2C is not set
CONFIG_RT_USING_PIN
=
y
CONFIG_RT_USING_PIN
=
y
# CONFIG_RT_USING_ADC is not set
# CONFIG_RT_USING_ADC is not set
# CONFIG_RT_USING_PWM is not set
CONFIG_RT_USING_PWM
=
y
# CONFIG_RT_USING_MTD_NOR is not set
# CONFIG_RT_USING_MTD_NOR is not set
# CONFIG_RT_USING_MTD_NAND is not set
# CONFIG_RT_USING_MTD_NAND is not set
# CONFIG_RT_USING_PM is not set
# CONFIG_RT_USING_PM is not set
...
@@ -136,7 +136,7 @@ CONFIG_RT_USING_SENSOR=y
...
@@ -136,7 +136,7 @@ CONFIG_RT_USING_SENSOR=y
CONFIG_RT_USING_SENSOR_CMD
=
y
CONFIG_RT_USING_SENSOR_CMD
=
y
# CONFIG_RT_USING_TOUCH is not set
# CONFIG_RT_USING_TOUCH is not set
# CONFIG_RT_USING_HWCRYPTO is not set
# CONFIG_RT_USING_HWCRYPTO is not set
# CONFIG_RT_USING_ENCODER is not set
# CONFIG_RT_USING_
PULSE_
ENCODER is not set
# CONFIG_RT_USING_INPUT_CAPTURE is not set
# CONFIG_RT_USING_INPUT_CAPTURE is not set
# CONFIG_RT_USING_WIFI is not set
# CONFIG_RT_USING_WIFI is not set
...
@@ -413,6 +413,18 @@ CONFIG_BSP_USING_UART6=y
...
@@ -413,6 +413,18 @@ CONFIG_BSP_USING_UART6=y
# CONFIG_BSP_UART6_RX_USING_DMA is not set
# CONFIG_BSP_UART6_RX_USING_DMA is not set
CONFIG_BSP_USING_UART3
=
y
CONFIG_BSP_USING_UART3
=
y
# CONFIG_BSP_UART3_RX_USING_DMA is not set
# CONFIG_BSP_UART3_RX_USING_DMA is not set
# CONFIG_BSP_USING_UART7 is not set
# CONFIG_BSP_USING_UART8 is not set
# CONFIG_BSP_USING_UART1 is not set
CONFIG_BSP_USING_PWM
=
y
CONFIG_BSP_USING_PWM12
=
y
CONFIG_BSP_USING_PWM12_CH1
=
y
CONFIG_BSP_USING_PWM4
=
y
CONFIG_BSP_USING_PWM4_CH1
=
y
CONFIG_BSP_USING_PWM4_CH2
=
y
# CONFIG_BSP_USING_PWM4_CH3 is not set
# CONFIG_BSP_USING_PWM4_CH4 is not set
# CONFIG_BSP_USING_PWM5 is not set
# CONFIG_BSP_USING_RNG is not set
# CONFIG_BSP_USING_RNG is not set
# CONFIG_BSP_USING_UDID is not set
# CONFIG_BSP_USING_UDID is not set
...
...
bsp/stm32/stm32f427-robomaster-a/README.md
浏览文件 @
20d9ac45
...
@@ -38,14 +38,14 @@ RoboMaster开发板套件是一款面向机器人DIY的开源主控套件。开
...
@@ -38,14 +38,14 @@ RoboMaster开发板套件是一款面向机器人DIY的开源主控套件。开
|
**板载外设**
|
**支持情况**
|
**备注**
|
|
**板载外设**
|
**支持情况**
|
**备注**
|
| :----------------- | :----------: | :------------------------------------- |
| :----------------- | :----------: | :------------------------------------- |
| SD卡 | 暂不支持 | |
| SD卡 | 暂不支持 | |
| CAN |
支持
| |
| CAN |
暂不支持
| |
|
**片上外设**
|
**支持情况**
|
**备注**
|
|
**片上外设**
|
**支持情况**
|
**备注**
|
| GPIO | 支持 | PA0, PA1... PK15 ---> PIN: 0, 1...176 |
| GPIO | 支持 | PA0, PA1... PK15 ---> PIN: 0, 1...176 |
| UART | 支持 | UART
3/6
|
| UART | 支持 | UART
1/3/6/7/8
|
| SPI | 暂不支持 | SPI5
/
|
| SPI | 暂不支持 | SPI5
|
| I2C | 暂不支持 | |
| I2C | 暂不支持 | |
| SDIO | 暂不支持 | 即将支持 |
| SDIO | 暂不支持 | 即将支持 |
| RTC |
暂不支持 | 即将支持
|
| RTC |
不支持 |
|
| PWM | 暂不支持 | 即将支持 |
| PWM | 暂不支持 | 即将支持 |
|
**扩展模块**
|
**支持情况**
|
**备注**
|
|
**扩展模块**
|
**支持情况**
|
**备注**
|
| 无 |... | ...
| 无 |... | ...
...
...
bsp/stm32/stm32f427-robomaster-a/board/CubeMX_Config/CubeMX_Config.ioc
浏览文件 @
20d9ac45
...
@@ -8,37 +8,64 @@ KeepUserPlacement=true
...
@@ -8,37 +8,64 @@ KeepUserPlacement=true
Mcu.Family=STM32F4
Mcu.Family=STM32F4
Mcu.IP0=CAN1
Mcu.IP0=CAN1
Mcu.IP1=CAN2
Mcu.IP1=CAN2
Mcu.IP10=UART8
Mcu.IP11=USART1
Mcu.IP12=USART3
Mcu.IP13=USART6
Mcu.IP2=NVIC
Mcu.IP2=NVIC
Mcu.IP3=RCC
Mcu.IP3=RCC
Mcu.IP4=SPI5
Mcu.IP4=SPI5
Mcu.IP5=SYS
Mcu.IP5=SYS
Mcu.IP6=USART6
Mcu.IP6=TIM4
Mcu.IPNb=7
Mcu.IP7=TIM5
Mcu.IP8=TIM12
Mcu.IP9=UART7
Mcu.IPNb=14
Mcu.Name=STM32F427I(G-I)Hx
Mcu.Name=STM32F427I(G-I)Hx
Mcu.Package=UFBGA176
Mcu.Package=UFBGA176
Mcu.Pin0=PG14
Mcu.Pin0=PE1
Mcu.Pin1=PA14
Mcu.Pin1=PE0
Mcu.Pin10=PF9
Mcu.Pin10=PI0
Mcu.Pin11=PF8
Mcu.Pin11=PH0/OSC_IN
Mcu.Pin12=PE11
Mcu.Pin12=PH1/OSC_OUT
Mcu.Pin13=PB12
Mcu.Pin13=PF7
Mcu.Pin14=PB13
Mcu.Pin14=PF6
Mcu.Pin15=PF14
Mcu.Pin15=PH12
Mcu.Pin16=VP_SYS_VS_Systick
Mcu.Pin16=PF9
Mcu.Pin2=PA13
Mcu.Pin17=PF8
Mcu.Pin3=PD0
Mcu.Pin18=PH11
Mcu.Pin4=PG9
Mcu.Pin19=PH10
Mcu.Pin5=PD1
Mcu.Pin2=PG14
Mcu.Pin6=PH0/OSC_IN
Mcu.Pin20=PD15
Mcu.Pin7=PH1/OSC_OUT
Mcu.Pin21=PH6
Mcu.Pin8=PF7
Mcu.Pin22=PD14
Mcu.Pin9=PF6
Mcu.Pin23=PD13
Mcu.PinsNb=17
Mcu.Pin24=PD12
Mcu.Pin25=PE8
Mcu.Pin26=PE11
Mcu.Pin27=PB12
Mcu.Pin28=PB13
Mcu.Pin29=PD9
Mcu.Pin3=PA14
Mcu.Pin30=PD8
Mcu.Pin31=PF14
Mcu.Pin32=PE7
Mcu.Pin33=VP_SYS_VS_Systick
Mcu.Pin34=VP_TIM4_VS_ClockSourceINT
Mcu.Pin35=VP_TIM5_VS_ClockSourceINT
Mcu.Pin36=VP_TIM12_VS_ClockSourceINT
Mcu.Pin4=PA13
Mcu.Pin5=PB7
Mcu.Pin6=PB6
Mcu.Pin7=PD0
Mcu.Pin8=PG9
Mcu.Pin9=PD1
Mcu.PinsNb=37
Mcu.ThirdPartyNb=0
Mcu.ThirdPartyNb=0
Mcu.UserConstants=
Mcu.UserConstants=
Mcu.UserName=STM32F427IIHx
Mcu.UserName=STM32F427IIHx
MxCube.Version=5.
2.1
MxCube.Version=5.
3.0
MxDb.Version=DB.5.0.
21
MxDb.Version=DB.5.0.
30
NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false
NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false
NVIC.DebugMonitor_IRQn=true\:0\:0\:false\:false\:true\:false\:false
NVIC.DebugMonitor_IRQn=true\:0\:0\:false\:false\:true\:false\:false
NVIC.HardFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false
NVIC.HardFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false
...
@@ -60,6 +87,11 @@ PB12.Signal=CAN2_RX
...
@@ -60,6 +87,11 @@ PB12.Signal=CAN2_RX
PB13.Locked=true
PB13.Locked=true
PB13.Mode=Slave
PB13.Mode=Slave
PB13.Signal=CAN2_TX
PB13.Signal=CAN2_TX
PB6.Mode=Asynchronous
PB6.Signal=USART1_TX
PB7.Locked=true
PB7.Mode=Asynchronous
PB7.Signal=USART1_RX
PCC.Checker=false
PCC.Checker=false
PCC.Line=STM32F427/437
PCC.Line=STM32F427/437
PCC.MCU=STM32F427I(G-I)Hx
PCC.MCU=STM32F427I(G-I)Hx
...
@@ -73,10 +105,36 @@ PD0.Mode=Master
...
@@ -73,10 +105,36 @@ PD0.Mode=Master
PD0.Signal=CAN1_RX
PD0.Signal=CAN1_RX
PD1.Mode=Master
PD1.Mode=Master
PD1.Signal=CAN1_TX
PD1.Signal=CAN1_TX
PD12.Locked=true
PD12.Signal=S_TIM4_CH1
PD13.Locked=true
PD13.Signal=S_TIM4_CH2
PD14.Locked=true
PD14.Signal=S_TIM4_CH3
PD15.Locked=true
PD15.Signal=S_TIM4_CH4
PD8.Locked=true
PD8.Mode=Asynchronous
PD8.Signal=USART3_TX
PD9.Locked=true
PD9.Mode=Asynchronous
PD9.Signal=USART3_RX
PE0.Locked=true
PE0.Mode=Asynchronous
PE0.Signal=UART8_RX
PE1.Locked=true
PE1.Mode=Asynchronous
PE1.Signal=UART8_TX
PE11.GPIOParameters=GPIO_Label
PE11.GPIOParameters=GPIO_Label
PE11.GPIO_Label=LED_RED
PE11.GPIO_Label=LED_RED
PE11.Locked=true
PE11.Locked=true
PE11.Signal=GPIO_Output
PE11.Signal=GPIO_Output
PE7.Locked=true
PE7.Mode=Asynchronous
PE7.Signal=UART7_RX
PE8.Locked=true
PE8.Mode=Asynchronous
PE8.Signal=UART7_TX
PF14.GPIOParameters=GPIO_Label
PF14.GPIOParameters=GPIO_Label
PF14.GPIO_Label=LED_GREEN
PF14.GPIO_Label=LED_GREEN
PF14.Locked=true
PF14.Locked=true
...
@@ -97,6 +155,15 @@ PH0/OSC_IN.Mode=HSE-External-Oscillator
...
@@ -97,6 +155,15 @@ PH0/OSC_IN.Mode=HSE-External-Oscillator
PH0/OSC_IN.Signal=RCC_OSC_IN
PH0/OSC_IN.Signal=RCC_OSC_IN
PH1/OSC_OUT.Mode=HSE-External-Oscillator
PH1/OSC_OUT.Mode=HSE-External-Oscillator
PH1/OSC_OUT.Signal=RCC_OSC_OUT
PH1/OSC_OUT.Signal=RCC_OSC_OUT
PH10.Locked=true
PH10.Signal=S_TIM5_CH1
PH11.Locked=true
PH11.Signal=S_TIM5_CH2
PH12.Locked=true
PH12.Signal=S_TIM5_CH3
PH6.Signal=S_TIM12_CH1
PI0.Locked=true
PI0.Signal=S_TIM5_CH4
PinOutPanel.CurrentBGAView=Top
PinOutPanel.CurrentBGAView=Top
PinOutPanel.RotationAngle=0
PinOutPanel.RotationAngle=0
ProjectManager.AskForMigrate=true
ProjectManager.AskForMigrate=true
...
@@ -164,14 +231,58 @@ RCC.VCOSAIOutputFreq_Value=98000000
...
@@ -164,14 +231,58 @@ RCC.VCOSAIOutputFreq_Value=98000000
RCC.VCOSAIOutputFreq_ValueQ=24500000
RCC.VCOSAIOutputFreq_ValueQ=24500000
RCC.VcooutputI2S=192000000
RCC.VcooutputI2S=192000000
RCC.VcooutputI2SQ=192000000
RCC.VcooutputI2SQ=192000000
SH.S_TIM12_CH1.0=TIM12_CH1,PWM Generation1 CH1
SH.S_TIM12_CH1.ConfNb=1
SH.S_TIM4_CH1.0=TIM4_CH1,PWM Generation1 CH1
SH.S_TIM4_CH1.ConfNb=1
SH.S_TIM4_CH2.0=TIM4_CH2,PWM Generation2 CH2
SH.S_TIM4_CH2.ConfNb=1
SH.S_TIM4_CH3.0=TIM4_CH3,PWM Generation3 CH3
SH.S_TIM4_CH3.ConfNb=1
SH.S_TIM4_CH4.0=TIM4_CH4,PWM Generation4 CH4
SH.S_TIM4_CH4.ConfNb=1
SH.S_TIM5_CH1.0=TIM5_CH1,PWM Generation1 CH1
SH.S_TIM5_CH1.ConfNb=1
SH.S_TIM5_CH2.0=TIM5_CH2,PWM Generation2 CH2
SH.S_TIM5_CH2.ConfNb=1
SH.S_TIM5_CH3.0=TIM5_CH3,PWM Generation3 CH3
SH.S_TIM5_CH3.ConfNb=1
SH.S_TIM5_CH4.0=TIM5_CH4,PWM Generation4 CH4
SH.S_TIM5_CH4.ConfNb=1
SPI5.BaudRatePrescaler=SPI_BAUDRATEPRESCALER_128
SPI5.BaudRatePrescaler=SPI_BAUDRATEPRESCALER_128
SPI5.CalculateBaudRate=656.25 KBits/s
SPI5.CalculateBaudRate=656.25 KBits/s
SPI5.Direction=SPI_DIRECTION_2LINES
SPI5.Direction=SPI_DIRECTION_2LINES
SPI5.IPParameters=VirtualType,Mode,Direction,CalculateBaudRate,BaudRatePrescaler
SPI5.IPParameters=VirtualType,Mode,Direction,CalculateBaudRate,BaudRatePrescaler
SPI5.Mode=SPI_MODE_MASTER
SPI5.Mode=SPI_MODE_MASTER
SPI5.VirtualType=VM_MASTER
SPI5.VirtualType=VM_MASTER
TIM12.Channel-PWM\ Generation1\ CH1=TIM_CHANNEL_1
TIM12.IPParameters=Channel-PWM Generation1 CH1
TIM4.Channel-PWM\ Generation1\ CH1=TIM_CHANNEL_1
TIM4.Channel-PWM\ Generation2\ CH2=TIM_CHANNEL_2
TIM4.Channel-PWM\ Generation3\ CH3=TIM_CHANNEL_3
TIM4.Channel-PWM\ Generation4\ CH4=TIM_CHANNEL_4
TIM4.IPParameters=Channel-PWM Generation1 CH1,Channel-PWM Generation2 CH2,Channel-PWM Generation3 CH3,Channel-PWM Generation4 CH4
TIM5.Channel-PWM\ Generation1\ CH1=TIM_CHANNEL_1
TIM5.Channel-PWM\ Generation2\ CH2=TIM_CHANNEL_2
TIM5.Channel-PWM\ Generation3\ CH3=TIM_CHANNEL_3
TIM5.Channel-PWM\ Generation4\ CH4=TIM_CHANNEL_4
TIM5.IPParameters=Channel-PWM Generation1 CH1,Channel-PWM Generation2 CH2,Channel-PWM Generation3 CH3,Channel-PWM Generation4 CH4
UART7.IPParameters=VirtualMode
UART7.VirtualMode=Asynchronous
UART8.IPParameters=VirtualMode
UART8.VirtualMode=Asynchronous
USART1.IPParameters=VirtualMode
USART1.VirtualMode=VM_ASYNC
USART3.IPParameters=VirtualMode
USART3.VirtualMode=VM_ASYNC
USART6.IPParameters=VirtualMode
USART6.IPParameters=VirtualMode
USART6.VirtualMode=VM_ASYNC
USART6.VirtualMode=VM_ASYNC
VP_SYS_VS_Systick.Mode=SysTick
VP_SYS_VS_Systick.Mode=SysTick
VP_SYS_VS_Systick.Signal=SYS_VS_Systick
VP_SYS_VS_Systick.Signal=SYS_VS_Systick
VP_TIM12_VS_ClockSourceINT.Mode=Internal
VP_TIM12_VS_ClockSourceINT.Signal=TIM12_VS_ClockSourceINT
VP_TIM4_VS_ClockSourceINT.Mode=Internal
VP_TIM4_VS_ClockSourceINT.Signal=TIM4_VS_ClockSourceINT
VP_TIM5_VS_ClockSourceINT.Mode=Internal
VP_TIM5_VS_ClockSourceINT.Signal=TIM5_VS_ClockSourceINT
board=Imu
board=Imu
bsp/stm32/stm32f427-robomaster-a/board/CubeMX_Config/Inc/main.h
浏览文件 @
20d9ac45
...
@@ -70,6 +70,8 @@ extern "C" {
...
@@ -70,6 +70,8 @@ extern "C" {
/* USER CODE END EM */
/* USER CODE END EM */
void
HAL_TIM_MspPostInit
(
TIM_HandleTypeDef
*
htim
);
/* Exported functions prototypes ---------------------------------------------*/
/* Exported functions prototypes ---------------------------------------------*/
void
Error_Handler
(
void
);
void
Error_Handler
(
void
);
...
...
bsp/stm32/stm32f427-robomaster-a/board/CubeMX_Config/Inc/stm32f4xx_hal_conf.h
浏览文件 @
20d9ac45
...
@@ -61,7 +61,7 @@
...
@@ -61,7 +61,7 @@
/* #define HAL_SD_MODULE_ENABLED */
/* #define HAL_SD_MODULE_ENABLED */
/* #define HAL_MMC_MODULE_ENABLED */
/* #define HAL_MMC_MODULE_ENABLED */
#define HAL_SPI_MODULE_ENABLED
#define HAL_SPI_MODULE_ENABLED
/* #define HAL_TIM_MODULE_ENABLED */
#define HAL_TIM_MODULE_ENABLED
#define HAL_UART_MODULE_ENABLED
#define HAL_UART_MODULE_ENABLED
/* #define HAL_USART_MODULE_ENABLED */
/* #define HAL_USART_MODULE_ENABLED */
/* #define HAL_IRDA_MODULE_ENABLED */
/* #define HAL_IRDA_MODULE_ENABLED */
...
...
bsp/stm32/stm32f427-robomaster-a/board/CubeMX_Config/Src/main.c
浏览文件 @
20d9ac45
...
@@ -67,6 +67,14 @@ CAN_HandleTypeDef hcan2;
...
@@ -67,6 +67,14 @@ CAN_HandleTypeDef hcan2;
SPI_HandleTypeDef
hspi5
;
SPI_HandleTypeDef
hspi5
;
TIM_HandleTypeDef
htim4
;
TIM_HandleTypeDef
htim5
;
TIM_HandleTypeDef
htim12
;
UART_HandleTypeDef
huart7
;
UART_HandleTypeDef
huart8
;
UART_HandleTypeDef
huart1
;
UART_HandleTypeDef
huart3
;
UART_HandleTypeDef
huart6
;
UART_HandleTypeDef
huart6
;
/* USER CODE BEGIN PV */
/* USER CODE BEGIN PV */
...
@@ -80,6 +88,13 @@ static void MX_SPI5_Init(void);
...
@@ -80,6 +88,13 @@ static void MX_SPI5_Init(void);
static
void
MX_USART6_UART_Init
(
void
);
static
void
MX_USART6_UART_Init
(
void
);
static
void
MX_CAN1_Init
(
void
);
static
void
MX_CAN1_Init
(
void
);
static
void
MX_CAN2_Init
(
void
);
static
void
MX_CAN2_Init
(
void
);
static
void
MX_TIM4_Init
(
void
);
static
void
MX_TIM5_Init
(
void
);
static
void
MX_TIM12_Init
(
void
);
static
void
MX_UART7_Init
(
void
);
static
void
MX_UART8_Init
(
void
);
static
void
MX_USART1_UART_Init
(
void
);
static
void
MX_USART3_UART_Init
(
void
);
/* USER CODE BEGIN PFP */
/* USER CODE BEGIN PFP */
/* USER CODE END PFP */
/* USER CODE END PFP */
...
@@ -122,6 +137,13 @@ int main(void)
...
@@ -122,6 +137,13 @@ int main(void)
MX_USART6_UART_Init
();
MX_USART6_UART_Init
();
MX_CAN1_Init
();
MX_CAN1_Init
();
MX_CAN2_Init
();
MX_CAN2_Init
();
MX_TIM4_Init
();
MX_TIM5_Init
();
MX_TIM12_Init
();
MX_UART7_Init
();
MX_UART8_Init
();
MX_USART1_UART_Init
();
MX_USART3_UART_Init
();
/* USER CODE BEGIN 2 */
/* USER CODE BEGIN 2 */
/* USER CODE END 2 */
/* USER CODE END 2 */
...
@@ -291,6 +313,332 @@ static void MX_SPI5_Init(void)
...
@@ -291,6 +313,332 @@ static void MX_SPI5_Init(void)
}
}
/**
* @brief TIM4 Initialization Function
* @param None
* @retval None
*/
static
void
MX_TIM4_Init
(
void
)
{
/* USER CODE BEGIN TIM4_Init 0 */
/* USER CODE END TIM4_Init 0 */
TIM_ClockConfigTypeDef
sClockSourceConfig
=
{
0
};
TIM_MasterConfigTypeDef
sMasterConfig
=
{
0
};
TIM_OC_InitTypeDef
sConfigOC
=
{
0
};
/* USER CODE BEGIN TIM4_Init 1 */
/* USER CODE END TIM4_Init 1 */
htim4
.
Instance
=
TIM4
;
htim4
.
Init
.
Prescaler
=
0
;
htim4
.
Init
.
CounterMode
=
TIM_COUNTERMODE_UP
;
htim4
.
Init
.
Period
=
0
;
htim4
.
Init
.
ClockDivision
=
TIM_CLOCKDIVISION_DIV1
;
htim4
.
Init
.
AutoReloadPreload
=
TIM_AUTORELOAD_PRELOAD_DISABLE
;
if
(
HAL_TIM_Base_Init
(
&
htim4
)
!=
HAL_OK
)
{
Error_Handler
();
}
sClockSourceConfig
.
ClockSource
=
TIM_CLOCKSOURCE_INTERNAL
;
if
(
HAL_TIM_ConfigClockSource
(
&
htim4
,
&
sClockSourceConfig
)
!=
HAL_OK
)
{
Error_Handler
();
}
if
(
HAL_TIM_PWM_Init
(
&
htim4
)
!=
HAL_OK
)
{
Error_Handler
();
}
sMasterConfig
.
MasterOutputTrigger
=
TIM_TRGO_RESET
;
sMasterConfig
.
MasterSlaveMode
=
TIM_MASTERSLAVEMODE_DISABLE
;
if
(
HAL_TIMEx_MasterConfigSynchronization
(
&
htim4
,
&
sMasterConfig
)
!=
HAL_OK
)
{
Error_Handler
();
}
sConfigOC
.
OCMode
=
TIM_OCMODE_PWM1
;
sConfigOC
.
Pulse
=
0
;
sConfigOC
.
OCPolarity
=
TIM_OCPOLARITY_HIGH
;
sConfigOC
.
OCFastMode
=
TIM_OCFAST_DISABLE
;
if
(
HAL_TIM_PWM_ConfigChannel
(
&
htim4
,
&
sConfigOC
,
TIM_CHANNEL_1
)
!=
HAL_OK
)
{
Error_Handler
();
}
if
(
HAL_TIM_PWM_ConfigChannel
(
&
htim4
,
&
sConfigOC
,
TIM_CHANNEL_2
)
!=
HAL_OK
)
{
Error_Handler
();
}
if
(
HAL_TIM_PWM_ConfigChannel
(
&
htim4
,
&
sConfigOC
,
TIM_CHANNEL_3
)
!=
HAL_OK
)
{
Error_Handler
();
}
if
(
HAL_TIM_PWM_ConfigChannel
(
&
htim4
,
&
sConfigOC
,
TIM_CHANNEL_4
)
!=
HAL_OK
)
{
Error_Handler
();
}
/* USER CODE BEGIN TIM4_Init 2 */
/* USER CODE END TIM4_Init 2 */
HAL_TIM_MspPostInit
(
&
htim4
);
}
/**
* @brief TIM5 Initialization Function
* @param None
* @retval None
*/
static
void
MX_TIM5_Init
(
void
)
{
/* USER CODE BEGIN TIM5_Init 0 */
/* USER CODE END TIM5_Init 0 */
TIM_ClockConfigTypeDef
sClockSourceConfig
=
{
0
};
TIM_MasterConfigTypeDef
sMasterConfig
=
{
0
};
TIM_OC_InitTypeDef
sConfigOC
=
{
0
};
/* USER CODE BEGIN TIM5_Init 1 */
/* USER CODE END TIM5_Init 1 */
htim5
.
Instance
=
TIM5
;
htim5
.
Init
.
Prescaler
=
0
;
htim5
.
Init
.
CounterMode
=
TIM_COUNTERMODE_UP
;
htim5
.
Init
.
Period
=
0
;
htim5
.
Init
.
ClockDivision
=
TIM_CLOCKDIVISION_DIV1
;
htim5
.
Init
.
AutoReloadPreload
=
TIM_AUTORELOAD_PRELOAD_DISABLE
;
if
(
HAL_TIM_Base_Init
(
&
htim5
)
!=
HAL_OK
)
{
Error_Handler
();
}
sClockSourceConfig
.
ClockSource
=
TIM_CLOCKSOURCE_INTERNAL
;
if
(
HAL_TIM_ConfigClockSource
(
&
htim5
,
&
sClockSourceConfig
)
!=
HAL_OK
)
{
Error_Handler
();
}
if
(
HAL_TIM_PWM_Init
(
&
htim5
)
!=
HAL_OK
)
{
Error_Handler
();
}
sMasterConfig
.
MasterOutputTrigger
=
TIM_TRGO_RESET
;
sMasterConfig
.
MasterSlaveMode
=
TIM_MASTERSLAVEMODE_DISABLE
;
if
(
HAL_TIMEx_MasterConfigSynchronization
(
&
htim5
,
&
sMasterConfig
)
!=
HAL_OK
)
{
Error_Handler
();
}
sConfigOC
.
OCMode
=
TIM_OCMODE_PWM1
;
sConfigOC
.
Pulse
=
0
;
sConfigOC
.
OCPolarity
=
TIM_OCPOLARITY_HIGH
;
sConfigOC
.
OCFastMode
=
TIM_OCFAST_DISABLE
;
if
(
HAL_TIM_PWM_ConfigChannel
(
&
htim5
,
&
sConfigOC
,
TIM_CHANNEL_1
)
!=
HAL_OK
)
{
Error_Handler
();
}
if
(
HAL_TIM_PWM_ConfigChannel
(
&
htim5
,
&
sConfigOC
,
TIM_CHANNEL_2
)
!=
HAL_OK
)
{
Error_Handler
();
}
if
(
HAL_TIM_PWM_ConfigChannel
(
&
htim5
,
&
sConfigOC
,
TIM_CHANNEL_3
)
!=
HAL_OK
)
{
Error_Handler
();
}
if
(
HAL_TIM_PWM_ConfigChannel
(
&
htim5
,
&
sConfigOC
,
TIM_CHANNEL_4
)
!=
HAL_OK
)
{
Error_Handler
();
}
/* USER CODE BEGIN TIM5_Init 2 */
/* USER CODE END TIM5_Init 2 */
HAL_TIM_MspPostInit
(
&
htim5
);
}
/**
* @brief TIM12 Initialization Function
* @param None
* @retval None
*/
static
void
MX_TIM12_Init
(
void
)
{
/* USER CODE BEGIN TIM12_Init 0 */
/* USER CODE END TIM12_Init 0 */
TIM_ClockConfigTypeDef
sClockSourceConfig
=
{
0
};
TIM_OC_InitTypeDef
sConfigOC
=
{
0
};
/* USER CODE BEGIN TIM12_Init 1 */
/* USER CODE END TIM12_Init 1 */
htim12
.
Instance
=
TIM12
;
htim12
.
Init
.
Prescaler
=
0
;
htim12
.
Init
.
CounterMode
=
TIM_COUNTERMODE_UP
;
htim12
.
Init
.
Period
=
0
;
htim12
.
Init
.
ClockDivision
=
TIM_CLOCKDIVISION_DIV1
;
htim12
.
Init
.
AutoReloadPreload
=
TIM_AUTORELOAD_PRELOAD_DISABLE
;
if
(
HAL_TIM_Base_Init
(
&
htim12
)
!=
HAL_OK
)
{
Error_Handler
();
}
sClockSourceConfig
.
ClockSource
=
TIM_CLOCKSOURCE_INTERNAL
;
if
(
HAL_TIM_ConfigClockSource
(
&
htim12
,
&
sClockSourceConfig
)
!=
HAL_OK
)
{
Error_Handler
();
}
if
(
HAL_TIM_PWM_Init
(
&
htim12
)
!=
HAL_OK
)
{
Error_Handler
();
}
sConfigOC
.
OCMode
=
TIM_OCMODE_PWM1
;
sConfigOC
.
Pulse
=
0
;
sConfigOC
.
OCPolarity
=
TIM_OCPOLARITY_HIGH
;
sConfigOC
.
OCFastMode
=
TIM_OCFAST_DISABLE
;
if
(
HAL_TIM_PWM_ConfigChannel
(
&
htim12
,
&
sConfigOC
,
TIM_CHANNEL_1
)
!=
HAL_OK
)
{
Error_Handler
();
}
/* USER CODE BEGIN TIM12_Init 2 */
/* USER CODE END TIM12_Init 2 */
HAL_TIM_MspPostInit
(
&
htim12
);
}
/**
* @brief UART7 Initialization Function
* @param None
* @retval None
*/
static
void
MX_UART7_Init
(
void
)
{
/* USER CODE BEGIN UART7_Init 0 */
/* USER CODE END UART7_Init 0 */
/* USER CODE BEGIN UART7_Init 1 */
/* USER CODE END UART7_Init 1 */
huart7
.
Instance
=
UART7
;
huart7
.
Init
.
BaudRate
=
115200
;
huart7
.
Init
.
WordLength
=
UART_WORDLENGTH_8B
;
huart7
.
Init
.
StopBits
=
UART_STOPBITS_1
;
huart7
.
Init
.
Parity
=
UART_PARITY_NONE
;
huart7
.
Init
.
Mode
=
UART_MODE_TX_RX
;
huart7
.
Init
.
HwFlowCtl
=
UART_HWCONTROL_NONE
;
huart7
.
Init
.
OverSampling
=
UART_OVERSAMPLING_16
;
if
(
HAL_UART_Init
(
&
huart7
)
!=
HAL_OK
)
{
Error_Handler
();
}
/* USER CODE BEGIN UART7_Init 2 */
/* USER CODE END UART7_Init 2 */
}
/**
* @brief UART8 Initialization Function
* @param None
* @retval None
*/
static
void
MX_UART8_Init
(
void
)
{
/* USER CODE BEGIN UART8_Init 0 */
/* USER CODE END UART8_Init 0 */
/* USER CODE BEGIN UART8_Init 1 */
/* USER CODE END UART8_Init 1 */
huart8
.
Instance
=
UART8
;
huart8
.
Init
.
BaudRate
=
115200
;
huart8
.
Init
.
WordLength
=
UART_WORDLENGTH_8B
;
huart8
.
Init
.
StopBits
=
UART_STOPBITS_1
;
huart8
.
Init
.
Parity
=
UART_PARITY_NONE
;
huart8
.
Init
.
Mode
=
UART_MODE_TX_RX
;
huart8
.
Init
.
HwFlowCtl
=
UART_HWCONTROL_NONE
;
huart8
.
Init
.
OverSampling
=
UART_OVERSAMPLING_16
;
if
(
HAL_UART_Init
(
&
huart8
)
!=
HAL_OK
)
{
Error_Handler
();
}
/* USER CODE BEGIN UART8_Init 2 */
/* USER CODE END UART8_Init 2 */
}
/**
* @brief USART1 Initialization Function
* @param None
* @retval None
*/
static
void
MX_USART1_UART_Init
(
void
)
{
/* USER CODE BEGIN USART1_Init 0 */
/* USER CODE END USART1_Init 0 */
/* USER CODE BEGIN USART1_Init 1 */
/* USER CODE END USART1_Init 1 */
huart1
.
Instance
=
USART1
;
huart1
.
Init
.
BaudRate
=
115200
;
huart1
.
Init
.
WordLength
=
UART_WORDLENGTH_8B
;
huart1
.
Init
.
StopBits
=
UART_STOPBITS_1
;
huart1
.
Init
.
Parity
=
UART_PARITY_NONE
;
huart1
.
Init
.
Mode
=
UART_MODE_TX_RX
;
huart1
.
Init
.
HwFlowCtl
=
UART_HWCONTROL_NONE
;
huart1
.
Init
.
OverSampling
=
UART_OVERSAMPLING_16
;
if
(
HAL_UART_Init
(
&
huart1
)
!=
HAL_OK
)
{
Error_Handler
();
}
/* USER CODE BEGIN USART1_Init 2 */
/* USER CODE END USART1_Init 2 */
}
/**
* @brief USART3 Initialization Function
* @param None
* @retval None
*/
static
void
MX_USART3_UART_Init
(
void
)
{
/* USER CODE BEGIN USART3_Init 0 */
/* USER CODE END USART3_Init 0 */
/* USER CODE BEGIN USART3_Init 1 */
/* USER CODE END USART3_Init 1 */
huart3
.
Instance
=
USART3
;
huart3
.
Init
.
BaudRate
=
115200
;
huart3
.
Init
.
WordLength
=
UART_WORDLENGTH_8B
;
huart3
.
Init
.
StopBits
=
UART_STOPBITS_1
;
huart3
.
Init
.
Parity
=
UART_PARITY_NONE
;
huart3
.
Init
.
Mode
=
UART_MODE_TX_RX
;
huart3
.
Init
.
HwFlowCtl
=
UART_HWCONTROL_NONE
;
huart3
.
Init
.
OverSampling
=
UART_OVERSAMPLING_16
;
if
(
HAL_UART_Init
(
&
huart3
)
!=
HAL_OK
)
{
Error_Handler
();
}
/* USER CODE BEGIN USART3_Init 2 */
/* USER CODE END USART3_Init 2 */
}
/**
/**
* @brief USART6 Initialization Function
* @brief USART6 Initialization Function
* @param None
* @param None
...
@@ -334,13 +682,14 @@ static void MX_GPIO_Init(void)
...
@@ -334,13 +682,14 @@ static void MX_GPIO_Init(void)
GPIO_InitTypeDef
GPIO_InitStruct
=
{
0
};
GPIO_InitTypeDef
GPIO_InitStruct
=
{
0
};
/* GPIO Ports Clock Enable */
/* GPIO Ports Clock Enable */
__HAL_RCC_GPIOE_CLK_ENABLE
();
__HAL_RCC_GPIOG_CLK_ENABLE
();
__HAL_RCC_GPIOG_CLK_ENABLE
();
__HAL_RCC_GPIOA_CLK_ENABLE
();
__HAL_RCC_GPIOA_CLK_ENABLE
();
__HAL_RCC_GPIOB_CLK_ENABLE
();
__HAL_RCC_GPIOD_CLK_ENABLE
();
__HAL_RCC_GPIOD_CLK_ENABLE
();
__HAL_RCC_GPIOI_CLK_ENABLE
();
__HAL_RCC_GPIOH_CLK_ENABLE
();
__HAL_RCC_GPIOH_CLK_ENABLE
();
__HAL_RCC_GPIOF_CLK_ENABLE
();
__HAL_RCC_GPIOF_CLK_ENABLE
();
__HAL_RCC_GPIOE_CLK_ENABLE
();
__HAL_RCC_GPIOB_CLK_ENABLE
();
/*Configure GPIO pin Output Level */
/*Configure GPIO pin Output Level */
HAL_GPIO_WritePin
(
GPIOF
,
GPIO_PIN_6
|
LED_GREEN_Pin
,
GPIO_PIN_RESET
);
HAL_GPIO_WritePin
(
GPIOF
,
GPIO_PIN_6
|
LED_GREEN_Pin
,
GPIO_PIN_RESET
);
...
...
bsp/stm32/stm32f427-robomaster-a/board/CubeMX_Config/Src/stm32f4xx_hal_msp.c
浏览文件 @
20d9ac45
...
@@ -78,7 +78,9 @@
...
@@ -78,7 +78,9 @@
/* USER CODE BEGIN 0 */
/* USER CODE BEGIN 0 */
/* USER CODE END 0 */
/* USER CODE END 0 */
/**
void
HAL_TIM_MspPostInit
(
TIM_HandleTypeDef
*
htim
);
/**
* Initializes the Global MSP.
* Initializes the Global MSP.
*/
*/
void
HAL_MspInit
(
void
)
void
HAL_MspInit
(
void
)
...
@@ -287,6 +289,175 @@ void HAL_SPI_MspDeInit(SPI_HandleTypeDef* hspi)
...
@@ -287,6 +289,175 @@ void HAL_SPI_MspDeInit(SPI_HandleTypeDef* hspi)
}
}
/**
* @brief TIM_Base MSP Initialization
* This function configures the hardware resources used in this example
* @param htim_base: TIM_Base handle pointer
* @retval None
*/
void
HAL_TIM_Base_MspInit
(
TIM_HandleTypeDef
*
htim_base
)
{
if
(
htim_base
->
Instance
==
TIM4
)
{
/* USER CODE BEGIN TIM4_MspInit 0 */
/* USER CODE END TIM4_MspInit 0 */
/* Peripheral clock enable */
__HAL_RCC_TIM4_CLK_ENABLE
();
/* USER CODE BEGIN TIM4_MspInit 1 */
/* USER CODE END TIM4_MspInit 1 */
}
else
if
(
htim_base
->
Instance
==
TIM5
)
{
/* USER CODE BEGIN TIM5_MspInit 0 */
/* USER CODE END TIM5_MspInit 0 */
/* Peripheral clock enable */
__HAL_RCC_TIM5_CLK_ENABLE
();
/* USER CODE BEGIN TIM5_MspInit 1 */
/* USER CODE END TIM5_MspInit 1 */
}
else
if
(
htim_base
->
Instance
==
TIM12
)
{
/* USER CODE BEGIN TIM12_MspInit 0 */
/* USER CODE END TIM12_MspInit 0 */
/* Peripheral clock enable */
__HAL_RCC_TIM12_CLK_ENABLE
();
/* USER CODE BEGIN TIM12_MspInit 1 */
/* USER CODE END TIM12_MspInit 1 */
}
}
void
HAL_TIM_MspPostInit
(
TIM_HandleTypeDef
*
htim
)
{
GPIO_InitTypeDef
GPIO_InitStruct
=
{
0
};
if
(
htim
->
Instance
==
TIM4
)
{
/* USER CODE BEGIN TIM4_MspPostInit 0 */
/* USER CODE END TIM4_MspPostInit 0 */
__HAL_RCC_GPIOD_CLK_ENABLE
();
/**TIM4 GPIO Configuration
PD15 ------> TIM4_CH4
PD14 ------> TIM4_CH3
PD13 ------> TIM4_CH2
PD12 ------> TIM4_CH1
*/
GPIO_InitStruct
.
Pin
=
GPIO_PIN_15
|
GPIO_PIN_14
|
GPIO_PIN_13
|
GPIO_PIN_12
;
GPIO_InitStruct
.
Mode
=
GPIO_MODE_AF_PP
;
GPIO_InitStruct
.
Pull
=
GPIO_NOPULL
;
GPIO_InitStruct
.
Speed
=
GPIO_SPEED_FREQ_LOW
;
GPIO_InitStruct
.
Alternate
=
GPIO_AF2_TIM4
;
HAL_GPIO_Init
(
GPIOD
,
&
GPIO_InitStruct
);
/* USER CODE BEGIN TIM4_MspPostInit 1 */
/* USER CODE END TIM4_MspPostInit 1 */
}
else
if
(
htim
->
Instance
==
TIM5
)
{
/* USER CODE BEGIN TIM5_MspPostInit 0 */
/* USER CODE END TIM5_MspPostInit 0 */
__HAL_RCC_GPIOI_CLK_ENABLE
();
__HAL_RCC_GPIOH_CLK_ENABLE
();
/**TIM5 GPIO Configuration
PI0 ------> TIM5_CH4
PH12 ------> TIM5_CH3
PH11 ------> TIM5_CH2
PH10 ------> TIM5_CH1
*/
GPIO_InitStruct
.
Pin
=
GPIO_PIN_0
;
GPIO_InitStruct
.
Mode
=
GPIO_MODE_AF_PP
;
GPIO_InitStruct
.
Pull
=
GPIO_NOPULL
;
GPIO_InitStruct
.
Speed
=
GPIO_SPEED_FREQ_LOW
;
GPIO_InitStruct
.
Alternate
=
GPIO_AF2_TIM5
;
HAL_GPIO_Init
(
GPIOI
,
&
GPIO_InitStruct
);
GPIO_InitStruct
.
Pin
=
GPIO_PIN_12
|
GPIO_PIN_11
|
GPIO_PIN_10
;
GPIO_InitStruct
.
Mode
=
GPIO_MODE_AF_PP
;
GPIO_InitStruct
.
Pull
=
GPIO_NOPULL
;
GPIO_InitStruct
.
Speed
=
GPIO_SPEED_FREQ_LOW
;
GPIO_InitStruct
.
Alternate
=
GPIO_AF2_TIM5
;
HAL_GPIO_Init
(
GPIOH
,
&
GPIO_InitStruct
);
/* USER CODE BEGIN TIM5_MspPostInit 1 */
/* USER CODE END TIM5_MspPostInit 1 */
}
else
if
(
htim
->
Instance
==
TIM12
)
{
/* USER CODE BEGIN TIM12_MspPostInit 0 */
/* USER CODE END TIM12_MspPostInit 0 */
__HAL_RCC_GPIOH_CLK_ENABLE
();
/**TIM12 GPIO Configuration
PH6 ------> TIM12_CH1
*/
GPIO_InitStruct
.
Pin
=
GPIO_PIN_6
;
GPIO_InitStruct
.
Mode
=
GPIO_MODE_AF_PP
;
GPIO_InitStruct
.
Pull
=
GPIO_NOPULL
;
GPIO_InitStruct
.
Speed
=
GPIO_SPEED_FREQ_LOW
;
GPIO_InitStruct
.
Alternate
=
GPIO_AF9_TIM12
;
HAL_GPIO_Init
(
GPIOH
,
&
GPIO_InitStruct
);
/* USER CODE BEGIN TIM12_MspPostInit 1 */
/* USER CODE END TIM12_MspPostInit 1 */
}
}
/**
* @brief TIM_Base MSP De-Initialization
* This function freeze the hardware resources used in this example
* @param htim_base: TIM_Base handle pointer
* @retval None
*/
void
HAL_TIM_Base_MspDeInit
(
TIM_HandleTypeDef
*
htim_base
)
{
if
(
htim_base
->
Instance
==
TIM4
)
{
/* USER CODE BEGIN TIM4_MspDeInit 0 */
/* USER CODE END TIM4_MspDeInit 0 */
/* Peripheral clock disable */
__HAL_RCC_TIM4_CLK_DISABLE
();
/* USER CODE BEGIN TIM4_MspDeInit 1 */
/* USER CODE END TIM4_MspDeInit 1 */
}
else
if
(
htim_base
->
Instance
==
TIM5
)
{
/* USER CODE BEGIN TIM5_MspDeInit 0 */
/* USER CODE END TIM5_MspDeInit 0 */
/* Peripheral clock disable */
__HAL_RCC_TIM5_CLK_DISABLE
();
/* USER CODE BEGIN TIM5_MspDeInit 1 */
/* USER CODE END TIM5_MspDeInit 1 */
}
else
if
(
htim_base
->
Instance
==
TIM12
)
{
/* USER CODE BEGIN TIM12_MspDeInit 0 */
/* USER CODE END TIM12_MspDeInit 0 */
/* Peripheral clock disable */
__HAL_RCC_TIM12_CLK_DISABLE
();
/* USER CODE BEGIN TIM12_MspDeInit 1 */
/* USER CODE END TIM12_MspDeInit 1 */
}
}
/**
/**
* @brief UART MSP Initialization
* @brief UART MSP Initialization
* This function configures the hardware resources used in this example
* This function configures the hardware resources used in this example
...
@@ -296,7 +467,103 @@ void HAL_SPI_MspDeInit(SPI_HandleTypeDef* hspi)
...
@@ -296,7 +467,103 @@ void HAL_SPI_MspDeInit(SPI_HandleTypeDef* hspi)
void
HAL_UART_MspInit
(
UART_HandleTypeDef
*
huart
)
void
HAL_UART_MspInit
(
UART_HandleTypeDef
*
huart
)
{
{
GPIO_InitTypeDef
GPIO_InitStruct
=
{
0
};
GPIO_InitTypeDef
GPIO_InitStruct
=
{
0
};
if
(
huart
->
Instance
==
USART6
)
if
(
huart
->
Instance
==
UART7
)
{
/* USER CODE BEGIN UART7_MspInit 0 */
/* USER CODE END UART7_MspInit 0 */
/* Peripheral clock enable */
__HAL_RCC_UART7_CLK_ENABLE
();
__HAL_RCC_GPIOE_CLK_ENABLE
();
/**UART7 GPIO Configuration
PE8 ------> UART7_TX
PE7 ------> UART7_RX
*/
GPIO_InitStruct
.
Pin
=
GPIO_PIN_8
|
GPIO_PIN_7
;
GPIO_InitStruct
.
Mode
=
GPIO_MODE_AF_PP
;
GPIO_InitStruct
.
Pull
=
GPIO_PULLUP
;
GPIO_InitStruct
.
Speed
=
GPIO_SPEED_FREQ_VERY_HIGH
;
GPIO_InitStruct
.
Alternate
=
GPIO_AF8_UART7
;
HAL_GPIO_Init
(
GPIOE
,
&
GPIO_InitStruct
);
/* USER CODE BEGIN UART7_MspInit 1 */
/* USER CODE END UART7_MspInit 1 */
}
else
if
(
huart
->
Instance
==
UART8
)
{
/* USER CODE BEGIN UART8_MspInit 0 */
/* USER CODE END UART8_MspInit 0 */
/* Peripheral clock enable */
__HAL_RCC_UART8_CLK_ENABLE
();
__HAL_RCC_GPIOE_CLK_ENABLE
();
/**UART8 GPIO Configuration
PE1 ------> UART8_TX
PE0 ------> UART8_RX
*/
GPIO_InitStruct
.
Pin
=
GPIO_PIN_1
|
GPIO_PIN_0
;
GPIO_InitStruct
.
Mode
=
GPIO_MODE_AF_PP
;
GPIO_InitStruct
.
Pull
=
GPIO_PULLUP
;
GPIO_InitStruct
.
Speed
=
GPIO_SPEED_FREQ_VERY_HIGH
;
GPIO_InitStruct
.
Alternate
=
GPIO_AF8_UART8
;
HAL_GPIO_Init
(
GPIOE
,
&
GPIO_InitStruct
);
/* USER CODE BEGIN UART8_MspInit 1 */
/* USER CODE END UART8_MspInit 1 */
}
else
if
(
huart
->
Instance
==
USART1
)
{
/* USER CODE BEGIN USART1_MspInit 0 */
/* USER CODE END USART1_MspInit 0 */
/* Peripheral clock enable */
__HAL_RCC_USART1_CLK_ENABLE
();
__HAL_RCC_GPIOB_CLK_ENABLE
();
/**USART1 GPIO Configuration
PB7 ------> USART1_RX
PB6 ------> USART1_TX
*/
GPIO_InitStruct
.
Pin
=
GPIO_PIN_7
|
GPIO_PIN_6
;
GPIO_InitStruct
.
Mode
=
GPIO_MODE_AF_PP
;
GPIO_InitStruct
.
Pull
=
GPIO_PULLUP
;
GPIO_InitStruct
.
Speed
=
GPIO_SPEED_FREQ_VERY_HIGH
;
GPIO_InitStruct
.
Alternate
=
GPIO_AF7_USART1
;
HAL_GPIO_Init
(
GPIOB
,
&
GPIO_InitStruct
);
/* USER CODE BEGIN USART1_MspInit 1 */
/* USER CODE END USART1_MspInit 1 */
}
else
if
(
huart
->
Instance
==
USART3
)
{
/* USER CODE BEGIN USART3_MspInit 0 */
/* USER CODE END USART3_MspInit 0 */
/* Peripheral clock enable */
__HAL_RCC_USART3_CLK_ENABLE
();
__HAL_RCC_GPIOD_CLK_ENABLE
();
/**USART3 GPIO Configuration
PD9 ------> USART3_RX
PD8 ------> USART3_TX
*/
GPIO_InitStruct
.
Pin
=
GPIO_PIN_9
|
GPIO_PIN_8
;
GPIO_InitStruct
.
Mode
=
GPIO_MODE_AF_PP
;
GPIO_InitStruct
.
Pull
=
GPIO_PULLUP
;
GPIO_InitStruct
.
Speed
=
GPIO_SPEED_FREQ_VERY_HIGH
;
GPIO_InitStruct
.
Alternate
=
GPIO_AF7_USART3
;
HAL_GPIO_Init
(
GPIOD
,
&
GPIO_InitStruct
);
/* USER CODE BEGIN USART3_MspInit 1 */
/* USER CODE END USART3_MspInit 1 */
}
else
if
(
huart
->
Instance
==
USART6
)
{
{
/* USER CODE BEGIN USART6_MspInit 0 */
/* USER CODE BEGIN USART6_MspInit 0 */
...
@@ -334,7 +601,79 @@ void HAL_UART_MspInit(UART_HandleTypeDef* huart)
...
@@ -334,7 +601,79 @@ void HAL_UART_MspInit(UART_HandleTypeDef* huart)
*/
*/
void
HAL_UART_MspDeInit
(
UART_HandleTypeDef
*
huart
)
void
HAL_UART_MspDeInit
(
UART_HandleTypeDef
*
huart
)
{
{
if
(
huart
->
Instance
==
USART6
)
if
(
huart
->
Instance
==
UART7
)
{
/* USER CODE BEGIN UART7_MspDeInit 0 */
/* USER CODE END UART7_MspDeInit 0 */
/* Peripheral clock disable */
__HAL_RCC_UART7_CLK_DISABLE
();
/**UART7 GPIO Configuration
PE8 ------> UART7_TX
PE7 ------> UART7_RX
*/
HAL_GPIO_DeInit
(
GPIOE
,
GPIO_PIN_8
|
GPIO_PIN_7
);
/* USER CODE BEGIN UART7_MspDeInit 1 */
/* USER CODE END UART7_MspDeInit 1 */
}
else
if
(
huart
->
Instance
==
UART8
)
{
/* USER CODE BEGIN UART8_MspDeInit 0 */
/* USER CODE END UART8_MspDeInit 0 */
/* Peripheral clock disable */
__HAL_RCC_UART8_CLK_DISABLE
();
/**UART8 GPIO Configuration
PE1 ------> UART8_TX
PE0 ------> UART8_RX
*/
HAL_GPIO_DeInit
(
GPIOE
,
GPIO_PIN_1
|
GPIO_PIN_0
);
/* USER CODE BEGIN UART8_MspDeInit 1 */
/* USER CODE END UART8_MspDeInit 1 */
}
else
if
(
huart
->
Instance
==
USART1
)
{
/* USER CODE BEGIN USART1_MspDeInit 0 */
/* USER CODE END USART1_MspDeInit 0 */
/* Peripheral clock disable */
__HAL_RCC_USART1_CLK_DISABLE
();
/**USART1 GPIO Configuration
PB7 ------> USART1_RX
PB6 ------> USART1_TX
*/
HAL_GPIO_DeInit
(
GPIOB
,
GPIO_PIN_7
|
GPIO_PIN_6
);
/* USER CODE BEGIN USART1_MspDeInit 1 */
/* USER CODE END USART1_MspDeInit 1 */
}
else
if
(
huart
->
Instance
==
USART3
)
{
/* USER CODE BEGIN USART3_MspDeInit 0 */
/* USER CODE END USART3_MspDeInit 0 */
/* Peripheral clock disable */
__HAL_RCC_USART3_CLK_DISABLE
();
/**USART3 GPIO Configuration
PD9 ------> USART3_RX
PD8 ------> USART3_TX
*/
HAL_GPIO_DeInit
(
GPIOD
,
GPIO_PIN_9
|
GPIO_PIN_8
);
/* USER CODE BEGIN USART3_MspDeInit 1 */
/* USER CODE END USART3_MspDeInit 1 */
}
else
if
(
huart
->
Instance
==
USART6
)
{
{
/* USER CODE BEGIN USART6_MspDeInit 0 */
/* USER CODE BEGIN USART6_MspDeInit 0 */
...
...
bsp/stm32/stm32f427-robomaster-a/board/Kconfig
浏览文件 @
20d9ac45
...
@@ -23,7 +23,6 @@ menu "On-chip Peripheral Drivers"
...
@@ -23,7 +23,6 @@ menu "On-chip Peripheral Drivers"
config BSP_USING_UART6
config BSP_USING_UART6
bool "Enable UART6 (debug usart)"
bool "Enable UART6 (debug usart)"
default y
default y
config BSP_UART6_RX_USING_DMA
config BSP_UART6_RX_USING_DMA
bool "Enable UART6 RX DMA"
bool "Enable UART6 RX DMA"
depends on BSP_USING_UART6 && RT_SERIAL_USING_DMA
depends on BSP_USING_UART6 && RT_SERIAL_USING_DMA
...
@@ -32,24 +31,85 @@ menu "On-chip Peripheral Drivers"
...
@@ -32,24 +31,85 @@ menu "On-chip Peripheral Drivers"
config BSP_USING_UART3
config BSP_USING_UART3
bool "Enable UART3"
bool "Enable UART3"
default n
default n
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
default n
config BSP_USING_UART7
bool "Enable UART7"
default n
config BSP_UART7_RX_USING_DMA
bool "Enable UART7 RX DMA"
depends on BSP_USING_UART7 && RT_SERIAL_USING_DMA
default n
config BSP_USING_UART8
bool "Enable UART8"
default n
config BSP_UART8_RX_USING_DMA
bool "Enable UART8 RX DMA"
depends on BSP_USING_UART8 && RT_SERIAL_USING_DMA
default n
config BSP_USING_UART1
bool "Enable UART1 (DBUS)"
default n
config BSP_UART1_RX_USING_DMA
bool "Enable UART1 RX DMA"
depends on BSP_USING_UART1 && RT_SERIAL_USING_DMA
default n
endif
endif
menuconfig BSP_USING_CAN
menuconfig BSP_USING_PWM
bool "Enable
CAN
"
bool "Enable
pwm
"
default n
default n
select RT_USING_
CAN
select RT_USING_
PWM
if BSP_USING_
CAN
if BSP_USING_
PWM
config BSP_USING_CAN1
menuconfig BSP_USING_PWM12
bool "
using CAN1
"
bool "
Enable timer12 output pwm
"
default n
default n
config BSP_USING_CAN2
if BSP_USING_PWM12
bool "using CAN2"
config BSP_USING_PWM12_CH1
bool "Enable PWM12 channel1(buzzer) "
default n
endif
menuconfig BSP_USING_PWM4
bool "Enable timer4 output pwm"
default n
if BSP_USING_PWM4
config BSP_USING_PWM4_CH1
bool "Enable PWM4 channel1"
default n
config BSP_USING_PWM4_CH2
bool "Enable PWM4 channel2"
default n
config BSP_USING_PWM4_CH3
bool "Enable PWM4 channel3"
default n
config BSP_USING_PWM4_CH4
bool "Enable PWM4 channel4"
default n
endif
menuconfig BSP_USING_PWM5
bool "Enable timer5 output pwm"
default n
default n
if BSP_USING_PWM5
config BSP_USING_PWM5_CH1
bool "Enable PWM5 channel1"
default n
config BSP_USING_PWM5_CH2
bool "Enable PWM5 channel2"
default n
config BSP_USING_PWM5_CH3
bool "Enable PWM5 channel3"
default n
config BSP_USING_PWM5_CH4
bool "Enable PWM5 channel4"
default n
endif
endif
endif
source "../libraries/HAL_Drivers/Kconfig"
source "../libraries/HAL_Drivers/Kconfig"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录