Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
2301_76519099
rt-thread
提交
ba2d7ba4
R
rt-thread
项目概览
2301_76519099
/
rt-thread
与 Fork 源项目一致
Fork自
RT-Thread / rt-thread
通知
3
Star
1
Fork
1
代码
文件
提交
分支
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,发现更多精彩内容 >>
未验证
提交
ba2d7ba4
编写于
12月 20, 2022
作者:
螺
螺丝松掉的人
提交者:
GitHub
12月 20, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[arduino][stm32f407-robomaster-c] 对接RTduino (#6759)
上级
8ade0879
变更
13
展开全部
隐藏空白更改
内联
并排
Showing
13 changed file
with
301 addition
and
1546 deletion
+301
-1546
bsp/stm32/stm32f407-robomaster-c/applications/SConscript
bsp/stm32/stm32f407-robomaster-c/applications/SConscript
+5
-2
bsp/stm32/stm32f407-robomaster-c/applications/arduino_main.cpp
...tm32/stm32f407-robomaster-c/applications/arduino_main.cpp
+24
-0
bsp/stm32/stm32f407-robomaster-c/applications/arduino_pinout/README.md
...32f407-robomaster-c/applications/arduino_pinout/README.md
+41
-0
bsp/stm32/stm32f407-robomaster-c/applications/arduino_pinout/SConscript
...2f407-robomaster-c/applications/arduino_pinout/SConscript
+9
-0
bsp/stm32/stm32f407-robomaster-c/applications/arduino_pinout/pins_arduino.c
...7-robomaster-c/applications/arduino_pinout/pins_arduino.c
+41
-0
bsp/stm32/stm32f407-robomaster-c/applications/arduino_pinout/pins_arduino.h
...7-robomaster-c/applications/arduino_pinout/pins_arduino.h
+40
-0
bsp/stm32/stm32f407-robomaster-c/board/CubeMX_Config/.mxproject
...m32/stm32f407-robomaster-c/board/CubeMX_Config/.mxproject
+2
-2
bsp/stm32/stm32f407-robomaster-c/board/CubeMX_Config/CubeMX_Config.ioc
...32f407-robomaster-c/board/CubeMX_Config/CubeMX_Config.ioc
+53
-30
bsp/stm32/stm32f407-robomaster-c/board/CubeMX_Config/Inc/stm32f4xx_hal_conf.h
...robomaster-c/board/CubeMX_Config/Inc/stm32f4xx_hal_conf.h
+2
-2
bsp/stm32/stm32f407-robomaster-c/board/CubeMX_Config/Src/main.c
...m32/stm32f407-robomaster-c/board/CubeMX_Config/Src/main.c
+0
-728
bsp/stm32/stm32f407-robomaster-c/board/CubeMX_Config/Src/stm32f4xx_hal_msp.c
...-robomaster-c/board/CubeMX_Config/Src/stm32f4xx_hal_msp.c
+57
-35
bsp/stm32/stm32f407-robomaster-c/board/CubeMX_Config/Src/system_stm32f4xx.c
...7-robomaster-c/board/CubeMX_Config/Src/system_stm32f4xx.c
+0
-747
bsp/stm32/stm32f407-robomaster-c/board/Kconfig
bsp/stm32/stm32f407-robomaster-c/board/Kconfig
+27
-0
未找到文件。
bsp/stm32/stm32f407-robomaster-c/applications/SConscript
浏览文件 @
ba2d7ba4
from
building
import
*
import
os
cwd
=
GetCurrentDir
()
src
=
Glob
(
'*.c'
)
cwd
=
GetCurrentDir
()
CPPPATH
=
[
cwd
]
src
=
Glob
(
'*.c'
)
if
GetDepend
([
'PKG_USING_RTDUINO'
])
and
not
GetDepend
([
'RTDUINO_NO_SETUP_LOOP'
]):
src
+=
[
'arduino_main.cpp'
]
group
=
DefineGroup
(
'Applications'
,
src
,
depend
=
[
''
],
CPPPATH
=
CPPPATH
)
...
...
bsp/stm32/stm32f407-robomaster-c/applications/arduino_main.cpp
0 → 100644
浏览文件 @
ba2d7ba4
/*
* Copyright (c) 2006-2022, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2022-12-20 default first version
*/
#include <Arduino.h>
void
setup
(
void
)
{
/* put your setup code here, to run once: */
pinMode
(
LED_BUILTIN
,
OUTPUT
);
}
void
loop
(
void
)
{
/* put your main code here, to run repeatedly: */
digitalWrite
(
LED_BUILTIN
,
!
digitalRead
(
LED_BUILTIN
));
delay
(
100
);
}
bsp/stm32/stm32f407-robomaster-c/applications/arduino_pinout/README.md
0 → 100644
浏览文件 @
ba2d7ba4
# xxx 开发板的Arduino生态兼容说明
## 1 RTduino - RT-Thread的Arduino生态兼容层
stm32f407-robomaster-c 开发板已经完整适配了
[
RTduino软件包
](
https://github.com/RTduino/RTduino
)
,即RT-Thread的Arduino生态兼容层。用户可以按照Arduino的编程习惯来操作该BSP,并且可以使用大量Arduino社区丰富的库,是对RT-Thread生态的极大增强。更多信息,请参见
[
RTduino软件包说明文档
](
https://github.com/RTduino/RTduino
)
。
### 1.1 如何开启针对本BSP的Arduino生态兼容层
Env 工具下敲入 menuconfig 命令,或者 RT-Thread Studio IDE 下选择 RT-Thread Settings:
```
Kconfig
Hardware Drivers Config --->
Onboard Peripheral Drivers --->
[*] Compatible with Arduino Ecosystem (RTduino)
```
## 2 Arduino引脚排布
更多引脚布局相关信息参见
[
pins_arduino.c
](
pins_arduino.c
)
和
[
pins_arduino.h
](
pins_arduino.h
)
。
![
xxx-pinout
](
xxx-pinout.jpg
)
| Arduino引脚编号 | STM32引脚编号 | 5V容忍 | 备注 |
| ------------------- | --------- | ---- | ------------------------------------------------------------------------- |
| 0 (D0) | PH11 | 是/否 | 板载用户LED |
| 1 (D1) | PB7 | 是/否 | Serial-RX,默认被RT-Thread的UART设备框架uart1接管 |
| 2 (D2) | PA9 | 是/否 | Serial-TX,默认被RT-Thread的UART设备框架uart1接管 |
| 3 (D3) | PG9 | 是/否 | Serial-RX,默认被RT-Thread的UART设备框架uart6接管 |
| 4 (D4) | PG14 | 是/否 | Serial-TX,默认被RT-Thread的UART设备框架uart6接管 |
| 5 (D5) | PB0 | 是/否 | I2C1-SCL,默认被RT-Thread的I2C设备框架i2c1接管 |
| 6 (D6) | PB0 | 是/否 | I2C1-SDA,默认被RT-Thread的I2C设备框架i2c1接管 |
| 7 (D7) | PE9 | 是/否 | PWM1-CH1,默认被RT-Thread的PWM设备框架pwm1接管 |
| 8 (D8) | PE11 | 是/否 | PWM1-CH2,默认被RT-Thread的PWM设备框架pwm1接管 |
| 9 (D9) | PE13 | 是/否 | PWM1-CH3,默认被RT-Thread的PWM设备框架pwm1接管 |
| 10 (D10) | PE14 | 是/否 | PWM1-CH4,默认被RT-Thread的PWM设备框架pwm1接管 |
| 11 (D11) | PE14 | 是/否 | PWM1-CH4,默认被RT-Thread的PWM设备框架pwm1接管 |
| 12 (D12) | PC6 | 是/否 | PWM8-CH1,默认被RT-Thread的PWM设备框架pwm8接管 |
| 13 (D13) | PI6 | 是/否 | PWM8-CH2,默认被RT-Thread的PWM设备框架pwm8接管 |
| 14 (D14) | PI7 | 是/否 | PWM8-CH3,默认被RT-Thread的PWM设备框架pwm8接管 |
| 15 (A0) | -- | | 芯片内部温度 ADC,默认被RT-Thread的ADC设备框架adc1接管 |
| 16 (A1) | -- | | 芯片内部参考电压 ADC,默认被RT-Thread的ADC设备框架adc1接管 |
bsp/stm32/stm32f407-robomaster-c/applications/arduino_pinout/SConscript
0 → 100644
浏览文件 @
ba2d7ba4
from
building
import
*
cwd
=
GetCurrentDir
()
src
=
Glob
(
'*.c'
)
+
Glob
(
'*.cpp'
)
inc
=
[
cwd
]
group
=
DefineGroup
(
'RTduino'
,
src
,
depend
=
[
'PKG_USING_RTDUINO'
],
CPPPATH
=
inc
)
Return
(
'group'
)
bsp/stm32/stm32f407-robomaster-c/applications/arduino_pinout/pins_arduino.c
0 → 100644
浏览文件 @
ba2d7ba4
/*
* Copyright (c) 2006-2022, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2022-12-20 default first version
*/
#include <Arduino.h>
#include <board.h>
#include "pins_arduino.h"
/*
* {Arduino Pin, RT-Thread Pin [, Device Name, Channel]}
* [] means optional
* Digital pins must NOT give the device name and channel.
* Analog pins MUST give the device name and channel(ADC, PWM or DAC).
* Arduino Pin must keep in sequence.
*/
const
pin_map_t
pin_map_table
[]
=
{
{
D0
,
GET_PIN
(
H
,
11
)},
/* LED_BUILTIN */
{
D1
,
GET_PIN
(
B
,
7
),
"uart1"
},
/* Serial-RX */
{
D2
,
GET_PIN
(
A
,
9
),
"uart1"
},
/* Serial-TX */
{
D3
,
GET_PIN
(
G
,
9
),
"uart6"
},
/* Serial-RX */
{
D4
,
GET_PIN
(
G
,
14
),
"uart6"
},
/* Serial-TX */
{
D5
,
GET_PIN
(
B
,
0
),
"i2c1"
},
/* I2C-SCL (Wire) */
{
D6
,
GET_PIN
(
B
,
0
),
"i2c1"
},
/* I2C-SDA (Wire) */
{
D7
,
GET_PIN
(
E
,
9
),
"pwm1"
,
1
},
/* PWM */
{
D8
,
GET_PIN
(
E
,
11
),
"pwm1"
,
2
},
/* PWM */
{
D9
,
GET_PIN
(
E
,
13
),
"pwm1"
,
3
},
/* PWM */
{
D10
,
GET_PIN
(
E
,
14
),
"pwm1"
,
4
},
/* PWM */
{
D11
,
GET_PIN
(
E
,
14
),
"pwm1"
,
4
},
/* PWM */
{
D12
,
GET_PIN
(
C
,
6
),
"pwm8"
,
1
},
/* PWM */
{
D13
,
GET_PIN
(
I
,
6
),
"pwm8"
,
2
},
/* PWM */
{
D14
,
GET_PIN
(
I
,
7
),
"pwm8"
,
3
},
/* PWM */
{
A0
,
RT_NULL
,
"adc1"
,
18
},
/* ADC, On-Chip: internal temperature sensor, ADC_CHANNEL_TEMPSENSOR */
{
A1
,
RT_NULL
,
"adc1"
,
17
},
/* ADC, On-Chip: internal reference voltage, ADC_CHANNEL_VREFINT */
};
bsp/stm32/stm32f407-robomaster-c/applications/arduino_pinout/pins_arduino.h
0 → 100644
浏览文件 @
ba2d7ba4
/*
* Copyright (c) 2006-2022, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2022-12-20 default first version
*/
#ifndef Pins_Arduino_h
#define Pins_Arduino_h
/* pins alias. Must keep in sequence */
#define D0 (0)
#define D1 (1)
#define D2 (2)
#define D3 (3)
#define D4 (4)
#define D5 (5)
#define D6 (6)
#define D7 (7)
#define D8 (8)
#define D9 (9)
#define D10 (10)
#define D11 (11)
#define D12 (12)
#define D13 (13)
#define D14 (14)
#define A0 (15)
#define A1 (16)
#define F_CPU 168000000L
/* CPU:168MHz */
#define LED_BUILTIN D0
/* Default Built-in LED */
/* i2c1 : PF0-SDA PF1-SCL */
#define RTDUINO_DEFAULT_IIC_BUS_NAME "i2c1"
#endif
/* Pins_Arduino_h */
bsp/stm32/stm32f407-robomaster-c/board/CubeMX_Config/.mxproject
浏览文件 @
ba2d7ba4
[PreviousLibFiles]
LibFiles=Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_adc.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_adc_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_adc.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_rcc.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_rcc_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_bus.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_rcc.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_system.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_utils.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_flash.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_flash_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_flash_ramfunc.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_gpio.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_gpio_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_gpio.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_dma_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_dma.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_dma.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_dmamux.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_pwr.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_pwr_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_pwr.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_cortex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_cortex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal.h;Drivers\STM32F4xx_HAL_Driver\Inc\Legacy\stm32_hal_legacy.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_def.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_exti.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_exti.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_can.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_
spi.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_tim.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_tim_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_tim.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_uart.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_usart.h;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_adc.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_adc_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_ll_adc.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_rcc.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_rcc_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_flash.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_flash_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_flash_ramfunc.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_gpio.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_dma_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_dma.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_pwr.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_pwr_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_cortex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_exti.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_can.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_spi.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_tim.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_tim_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_uart.c;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_adc.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_adc_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_adc.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_rcc.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_rcc_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_bus.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_rcc.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_system.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_utils.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_flash.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_flash_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_flash_ramfunc.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_gpio.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_gpio_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_gpio.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_dma_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_dma.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_dma.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_dmamux.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_pwr.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_pwr_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_pwr.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_cortex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_cortex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal.h;Drivers\STM32F4xx_HAL_Driver\Inc\Legacy\stm32_hal_legacy.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_def.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_exti.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_exti.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_can.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_spi
.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_tim.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_tim_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_tim.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_uart.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_usart.h;Drivers\CMSIS\Device\ST\STM32F4xx\Include\stm32f407xx.h;Drivers\CMSIS\Device\ST\STM32F4xx\Include\stm32f4xx.h;Drivers\CMSIS\Device\ST\STM32F4xx\Include\system_stm32f4xx.h;Drivers\CMSIS\Device\ST\STM32F4xx\Source\Templates\system_stm32f4xx.c;Drivers\CMSIS\Include\cmsis_armcc.h;Drivers\CMSIS\Include\cmsis_armclang.h;Drivers\CMSIS\Include\cmsis_compiler.h;Drivers\CMSIS\Include\cmsis_gcc.h;Drivers\CMSIS\Include\cmsis_iccarm.h;Drivers\CMSIS\Include\cmsis_version.h;Drivers\CMSIS\Include\core_armv8mbl.h;Drivers\CMSIS\Include\core_armv8mml.h;Drivers\CMSIS\Include\core_cm0.h;Drivers\CMSIS\Include\core_cm0plus.h;Drivers\CMSIS\Include\core_cm1.h;Drivers\CMSIS\Include\core_cm23.h;Drivers\CMSIS\Include\core_cm3.h;Drivers\CMSIS\Include\core_cm33.h;Drivers\CMSIS\Include\core_cm4.h;Drivers\CMSIS\Include\core_cm7.h;Drivers\CMSIS\Include\core_sc000.h;Drivers\CMSIS\Include\core_sc300.h;Drivers\CMSIS\Include\mpu_armv7.h;Drivers\CMSIS\Include\mpu_armv8.h;Drivers\CMSIS\Include\tz_context.h;
LibFiles=Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_adc.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_adc_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_adc.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_rcc.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_rcc_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_bus.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_rcc.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_system.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_utils.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_flash.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_flash_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_flash_ramfunc.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_gpio.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_gpio_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_gpio.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_dma_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_dma.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_dma.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_dmamux.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_pwr.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_pwr_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_pwr.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_cortex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_cortex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal.h;Drivers\STM32F4xx_HAL_Driver\Inc\Legacy\stm32_hal_legacy.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_def.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_exti.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_exti.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_can.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_
i2c.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_i2c.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_i2c_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_tim.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_tim_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_tim.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_uart.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_usart.h;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_adc.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_adc_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_ll_adc.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_rcc.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_rcc_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_flash.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_flash_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_flash_ramfunc.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_gpio.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_dma_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_dma.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_pwr.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_pwr_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_cortex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_exti.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_can.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_i2c.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_i2c_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_tim.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_tim_ex.c;Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_uart.c;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_adc.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_adc_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_adc.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_rcc.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_rcc_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_bus.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_rcc.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_system.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_utils.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_flash.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_flash_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_flash_ramfunc.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_gpio.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_gpio_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_gpio.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_dma_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_dma.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_dma.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_dmamux.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_pwr.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_pwr_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_pwr.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_cortex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_cortex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal.h;Drivers\STM32F4xx_HAL_Driver\Inc\Legacy\stm32_hal_legacy.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_def.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_exti.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_exti.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_can.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_i2c.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_i2c.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_i2c_ex
.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_tim.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_tim_ex.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_tim.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_hal_uart.h;Drivers\STM32F4xx_HAL_Driver\Inc\stm32f4xx_ll_usart.h;Drivers\CMSIS\Device\ST\STM32F4xx\Include\stm32f407xx.h;Drivers\CMSIS\Device\ST\STM32F4xx\Include\stm32f4xx.h;Drivers\CMSIS\Device\ST\STM32F4xx\Include\system_stm32f4xx.h;Drivers\CMSIS\Device\ST\STM32F4xx\Source\Templates\system_stm32f4xx.c;Drivers\CMSIS\Include\cmsis_armcc.h;Drivers\CMSIS\Include\cmsis_armclang.h;Drivers\CMSIS\Include\cmsis_compiler.h;Drivers\CMSIS\Include\cmsis_gcc.h;Drivers\CMSIS\Include\cmsis_iccarm.h;Drivers\CMSIS\Include\cmsis_version.h;Drivers\CMSIS\Include\core_armv8mbl.h;Drivers\CMSIS\Include\core_armv8mml.h;Drivers\CMSIS\Include\core_cm0.h;Drivers\CMSIS\Include\core_cm0plus.h;Drivers\CMSIS\Include\core_cm1.h;Drivers\CMSIS\Include\core_cm23.h;Drivers\CMSIS\Include\core_cm3.h;Drivers\CMSIS\Include\core_cm33.h;Drivers\CMSIS\Include\core_cm4.h;Drivers\CMSIS\Include\core_cm7.h;Drivers\CMSIS\Include\core_sc000.h;Drivers\CMSIS\Include\core_sc300.h;Drivers\CMSIS\Include\mpu_armv7.h;Drivers\CMSIS\Include\mpu_armv8.h;Drivers\CMSIS\Include\tz_context.h;
[PreviousUsedKeilFiles]
SourceFiles=..\Src\main.c;..\Src\stm32f4xx_it.c;..\Src\stm32f4xx_hal_msp.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_adc.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_adc_ex.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_ll_adc.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_rcc.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_rcc_ex.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_flash.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_flash_ex.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_flash_ramfunc.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_gpio.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_dma_ex.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_dma.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_pwr.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_pwr_ex.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_cortex.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_exti.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_can.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_
spi.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_tim.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_tim_ex.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_uart.c;..\Drivers\CMSIS\Device\ST\STM32F4xx\Source\Templates\system_stm32f4xx.c;..\\Src\system_stm32f4xx.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_adc.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_adc_ex.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_ll_adc.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_rcc.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_rcc_ex.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_flash.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_flash_ex.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_flash_ramfunc.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_gpio.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_dma_ex.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_dma.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_pwr.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_pwr_ex.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_cortex.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_exti.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_can.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_spi
.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_tim.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_tim_ex.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_uart.c;..\Drivers\CMSIS\Device\ST\STM32F4xx\Source\Templates\system_stm32f4xx.c;..\\Src\system_stm32f4xx.c;;;
SourceFiles=..\Src\main.c;..\Src\stm32f4xx_it.c;..\Src\stm32f4xx_hal_msp.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_adc.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_adc_ex.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_ll_adc.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_rcc.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_rcc_ex.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_flash.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_flash_ex.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_flash_ramfunc.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_gpio.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_dma_ex.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_dma.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_pwr.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_pwr_ex.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_cortex.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_exti.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_can.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_
i2c.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_i2c_ex.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_tim.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_tim_ex.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_uart.c;..\Drivers\CMSIS\Device\ST\STM32F4xx\Source\Templates\system_stm32f4xx.c;..\\Src\system_stm32f4xx.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_adc.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_adc_ex.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_ll_adc.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_rcc.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_rcc_ex.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_flash.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_flash_ex.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_flash_ramfunc.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_gpio.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_dma_ex.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_dma.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_pwr.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_pwr_ex.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_cortex.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_exti.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_can.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_i2c.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_i2c_ex
.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_tim.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_tim_ex.c;..\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_uart.c;..\Drivers\CMSIS\Device\ST\STM32F4xx\Source\Templates\system_stm32f4xx.c;..\\Src\system_stm32f4xx.c;;;
HeaderPath=..\Drivers\STM32F4xx_HAL_Driver\Inc;..\Drivers\STM32F4xx_HAL_Driver\Inc\Legacy;..\Drivers\CMSIS\Device\ST\STM32F4xx\Include;..\Drivers\CMSIS\Include;..\Inc;
CDefines=USE_HAL_DRIVER;STM32F407xx;USE_HAL_DRIVER;USE_HAL_DRIVER;
...
...
bsp/stm32/stm32f407-robomaster-c/board/CubeMX_Config/CubeMX_Config.ioc
浏览文件 @
ba2d7ba4
#MicroXplorer Configuration settings - do not modify
ADC1.Channel-0\#ChannelRegularConversion=ADC_CHANNEL_TEMPSENSOR
ADC1.IPParameters=Rank-0\#ChannelRegularConversion,master,Channel-0\#ChannelRegularConversion,SamplingTime-0\#ChannelRegularConversion,NbrOfConversionFlag
ADC1.NbrOfConversionFlag=1
ADC1.Rank-0\#ChannelRegularConversion=1
ADC1.SamplingTime-0\#ChannelRegularConversion=ADC_SAMPLETIME_3CYCLES
ADC1.master=1
ADC3.Channel-1\#ChannelRegularConversion=ADC_CHANNEL_8
ADC3.IPParameters=Rank-1\#ChannelRegularConversion,Channel-1\#ChannelRegularConversion,SamplingTime-1\#ChannelRegularConversion,NbrOfConversionFlag
ADC3.NbrOfConversionFlag=1
ADC3.Rank-1\#ChannelRegularConversion=1
ADC3.SamplingTime-1\#ChannelRegularConversion=ADC_SAMPLETIME_3CYCLES
CAD.formats=
CAD.pinconfig=
CAD.provider=
CAN1.BS1=CAN_BS1_1TQ
CAN1.BS2=CAN_BS2_1TQ
CAN1.CalculateBaudRate=875000
...
...
@@ -17,23 +26,25 @@ CAN2.CalculateTimeBit=1142
CAN2.CalculateTimeQuantum=380.95238095238096
CAN2.IPParameters=CalculateTimeQuantum,CalculateTimeBit,CalculateBaudRate,BS1,BS2
File.Version=6
GPIO.groupedBy=
GPIO.groupedBy=
Group By Peripherals
KeepUserPlacement=false
Mcu.CPN=STM32F407IGH6
Mcu.Family=STM32F4
Mcu.IP0=ADC3
Mcu.IP1=CAN1
Mcu.IP10=USART3
Mcu.IP11=USART6
Mcu.IP2=CAN2
Mcu.IP3=NVIC
Mcu.IP4=RCC
Mcu.IP5=SYS
Mcu.IP6=TIM1
Mcu.IP7=TIM4
Mcu.IP8=TIM8
Mcu.IP9=USART1
Mcu.IPNb=12
Mcu.IP0=ADC1
Mcu.IP1=ADC3
Mcu.IP10=TIM8
Mcu.IP11=USART1
Mcu.IP12=USART3
Mcu.IP13=USART6
Mcu.IP2=CAN1
Mcu.IP3=CAN2
Mcu.IP4=I2C2
Mcu.IP5=NVIC
Mcu.IP6=RCC
Mcu.IP7=SYS
Mcu.IP8=TIM1
Mcu.IP9=TIM4
Mcu.IPNb=14
Mcu.Name=STM32F407I(E-G)Hx
Mcu.Package=UFBGA176
Mcu.Pin0=PB5
...
...
@@ -41,29 +52,33 @@ Mcu.Pin1=PG14
Mcu.Pin10=PI6
Mcu.Pin11=PG9
Mcu.Pin12=PD1
Mcu.Pin13=P
A9
Mcu.Pin14=P
H0-OSC_IN
Mcu.Pin15=PH
1-OSC_OUT
Mcu.Pin16=P
C6
Mcu.Pin17=PF1
0
Mcu.Pin18=P
D14
Mcu.Pin19=P
E13
Mcu.Pin13=P
F0
Mcu.Pin14=P
A9
Mcu.Pin15=PH
0-OSC_IN
Mcu.Pin16=P
H1-OSC_OUT
Mcu.Pin17=PF1
Mcu.Pin18=P
C6
Mcu.Pin19=P
F10
Mcu.Pin2=PA14
Mcu.Pin20=PE9
Mcu.Pin21=PE11
Mcu.Pin22=PE14
Mcu.Pin23=VP_SYS_VS_Systick
Mcu.Pin24=VP_TIM1_VS_ClockSourceINT
Mcu.Pin25=VP_TIM4_VS_ClockSourceINT
Mcu.Pin26=VP_TIM8_VS_ClockSourceINT
Mcu.Pin20=PD14
Mcu.Pin21=PE13
Mcu.Pin22=PE9
Mcu.Pin23=PE11
Mcu.Pin24=PE14
Mcu.Pin25=VP_ADC1_TempSens_Input
Mcu.Pin26=VP_ADC1_Vref_Input
Mcu.Pin27=VP_SYS_VS_Systick
Mcu.Pin28=VP_TIM1_VS_ClockSourceINT
Mcu.Pin29=VP_TIM4_VS_ClockSourceINT
Mcu.Pin3=PA13
Mcu.Pin30=VP_TIM8_VS_ClockSourceINT
Mcu.Pin4=PB7
Mcu.Pin5=PB6
Mcu.Pin6=PD0
Mcu.Pin7=PC11
Mcu.Pin8=PC10
Mcu.Pin9=PI7
Mcu.PinsNb=
27
Mcu.PinsNb=
31
Mcu.ThirdPartyNb=0
Mcu.UserConstants=
Mcu.UserName=STM32F407IGHx
...
...
@@ -117,6 +132,10 @@ PE14.Locked=true
PE14.Signal=S_TIM1_CH4
PE9.Locked=true
PE9.Signal=S_TIM1_CH1
PF0.Mode=I2C
PF0.Signal=I2C2_SDA
PF1.Mode=I2C
PF1.Signal=I2C2_SCL
PF10.Locked=true
PF10.Mode=IN8
PF10.Signal=ADC3_IN8
...
...
@@ -159,7 +178,7 @@ ProjectManager.StackSize=0x400
ProjectManager.TargetToolchain=MDK-ARM V5
ProjectManager.ToolChainLocation=
ProjectManager.UnderRoot=false
ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-SystemClock_Config-RCC-false-HAL-false,3-MX_USART1_UART_Init-USART1-false-HAL-true,4-MX_ADC3_Init-ADC3-false-HAL-true,5-MX_CAN1_Init-CAN1-false-HAL-true,6-MX_CAN2_Init-CAN2-false-HAL-true,7-MX_TIM1_Init-TIM1-false-HAL-true,8-MX_TIM4_Init-TIM4-false-HAL-true,9-MX_TIM8_Init-TIM8-false-HAL-true,10-MX_USART3_UART_Init-USART3-false-HAL-true,11-MX_USART6_UART_Init-USART6-false-HAL-true
ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-SystemClock_Config-RCC-false-HAL-false,3-MX_USART1_UART_Init-USART1-false-HAL-true,4-MX_ADC3_Init-ADC3-false-HAL-true,5-MX_CAN1_Init-CAN1-false-HAL-true,6-MX_CAN2_Init-CAN2-false-HAL-true,7-MX_TIM1_Init-TIM1-false-HAL-true,8-MX_TIM4_Init-TIM4-false-HAL-true,9-MX_TIM8_Init-TIM8-false-HAL-true,10-MX_USART3_UART_Init-USART3-false-HAL-true,11-MX_USART6_UART_Init-USART6-false-HAL-true
,12-MX_ADC1_Init-ADC1-false-HAL-true
RCC.48MHZClocksFreq_Value=84000000
RCC.AHBFreq_Value=168000000
RCC.APB1CLKDivider=RCC_HCLK_DIV4
...
...
@@ -226,6 +245,10 @@ USART3.IPParameters=VirtualMode
USART3.VirtualMode=VM_ASYNC
USART6.IPParameters=VirtualMode
USART6.VirtualMode=VM_ASYNC
VP_ADC1_TempSens_Input.Mode=IN-TempSens
VP_ADC1_TempSens_Input.Signal=ADC1_TempSens_Input
VP_ADC1_Vref_Input.Mode=IN-Vrefint
VP_ADC1_Vref_Input.Signal=ADC1_Vref_Input
VP_SYS_VS_Systick.Mode=SysTick
VP_SYS_VS_Systick.Signal=SYS_VS_Systick
VP_TIM1_VS_ClockSourceINT.Mode=Internal
...
...
bsp/stm32/stm32f407-robomaster-c/board/CubeMX_Config/Inc/stm32f4xx_hal_conf.h
浏览文件 @
ba2d7ba4
...
...
@@ -53,7 +53,7 @@
/* #define HAL_SRAM_MODULE_ENABLED */
/* #define HAL_SDRAM_MODULE_ENABLED */
/* #define HAL_HASH_MODULE_ENABLED */
/* #define HAL_I2C_MODULE_ENABLED */
#define HAL_I2C_MODULE_ENABLED
/* #define HAL_I2S_MODULE_ENABLED */
/* #define HAL_IWDG_MODULE_ENABLED */
/* #define HAL_LTDC_MODULE_ENABLED */
...
...
@@ -62,7 +62,7 @@
/* #define HAL_SAI_MODULE_ENABLED */
/* #define HAL_SD_MODULE_ENABLED */
/* #define HAL_MMC_MODULE_ENABLED */
#define HAL_SPI_MODULE_ENABLED
/* #define HAL_SPI_MODULE_ENABLED */
#define HAL_TIM_MODULE_ENABLED
#define HAL_UART_MODULE_ENABLED
/* #define HAL_USART_MODULE_ENABLED */
...
...
bsp/stm32/stm32f407-robomaster-c/board/CubeMX_Config/Src/main.c
已删除
100644 → 0
浏览文件 @
8ade0879
/* USER CODE BEGIN Header */
/**
******************************************************************************
* @file : main.c
* @brief : Main program body
******************************************************************************
* @attention
*
* Copyright (c) 2022 STMicroelectronics.
* All rights reserved.
*
* This software is licensed under terms that can be found in the LICENSE file
* in the root directory of this software component.
* If no LICENSE file comes with this software, it is provided AS-IS.
*
******************************************************************************
*/
/* USER CODE END Header */
/* Includes ------------------------------------------------------------------*/
#include "main.h"
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
/* USER CODE END Includes */
/* Private typedef -----------------------------------------------------------*/
/* USER CODE BEGIN PTD */
/* USER CODE END PTD */
/* Private define ------------------------------------------------------------*/
/* USER CODE BEGIN PD */
/* USER CODE END PD */
/* Private macro -------------------------------------------------------------*/
/* USER CODE BEGIN PM */
/* USER CODE END PM */
/* Private variables ---------------------------------------------------------*/
ADC_HandleTypeDef
hadc3
;
CAN_HandleTypeDef
hcan1
;
CAN_HandleTypeDef
hcan2
;
SPI_HandleTypeDef
hspi2
;
TIM_HandleTypeDef
htim1
;
TIM_HandleTypeDef
htim4
;
TIM_HandleTypeDef
htim8
;
UART_HandleTypeDef
huart1
;
UART_HandleTypeDef
huart3
;
UART_HandleTypeDef
huart6
;
/* USER CODE BEGIN PV */
/* USER CODE END PV */
/* Private function prototypes -----------------------------------------------*/
void
SystemClock_Config
(
void
);
static
void
MX_GPIO_Init
(
void
);
static
void
MX_USART1_UART_Init
(
void
);
static
void
MX_ADC3_Init
(
void
);
static
void
MX_CAN1_Init
(
void
);
static
void
MX_CAN2_Init
(
void
);
static
void
MX_TIM1_Init
(
void
);
static
void
MX_TIM4_Init
(
void
);
static
void
MX_TIM8_Init
(
void
);
static
void
MX_USART3_UART_Init
(
void
);
static
void
MX_USART6_UART_Init
(
void
);
static
void
MX_SPI2_Init
(
void
);
/* USER CODE BEGIN PFP */
/* USER CODE END PFP */
/* Private user code ---------------------------------------------------------*/
/* USER CODE BEGIN 0 */
/* USER CODE END 0 */
/**
* @brief The application entry point.
* @retval int
*/
int
main
(
void
)
{
/* USER CODE BEGIN 1 */
/* USER CODE END 1 */
/* MCU Configuration--------------------------------------------------------*/
/* Reset of all peripherals, Initializes the Flash interface and the Systick. */
HAL_Init
();
/* USER CODE BEGIN Init */
/* USER CODE END Init */
/* Configure the system clock */
SystemClock_Config
();
/* USER CODE BEGIN SysInit */
/* USER CODE END SysInit */
/* Initialize all configured peripherals */
MX_GPIO_Init
();
MX_USART1_UART_Init
();
MX_ADC3_Init
();
MX_CAN1_Init
();
MX_CAN2_Init
();
MX_TIM1_Init
();
MX_TIM4_Init
();
MX_TIM8_Init
();
MX_USART3_UART_Init
();
MX_USART6_UART_Init
();
MX_SPI2_Init
();
/* USER CODE BEGIN 2 */
/* USER CODE END 2 */
/* Infinite loop */
/* USER CODE BEGIN WHILE */
while
(
1
)
{
/* USER CODE END WHILE */
/* USER CODE BEGIN 3 */
}
/* USER CODE END 3 */
}
/**
* @brief System Clock Configuration
* @retval None
*/
void
SystemClock_Config
(
void
)
{
RCC_OscInitTypeDef
RCC_OscInitStruct
=
{
0
};
RCC_ClkInitTypeDef
RCC_ClkInitStruct
=
{
0
};
/** Configure the main internal regulator output voltage
*/
__HAL_RCC_PWR_CLK_ENABLE
();
__HAL_PWR_VOLTAGESCALING_CONFIG
(
PWR_REGULATOR_VOLTAGE_SCALE1
);
/** Initializes the RCC Oscillators according to the specified parameters
* in the RCC_OscInitTypeDef structure.
*/
RCC_OscInitStruct
.
OscillatorType
=
RCC_OSCILLATORTYPE_HSE
;
RCC_OscInitStruct
.
HSEState
=
RCC_HSE_ON
;
RCC_OscInitStruct
.
PLL
.
PLLState
=
RCC_PLL_ON
;
RCC_OscInitStruct
.
PLL
.
PLLSource
=
RCC_PLLSOURCE_HSE
;
RCC_OscInitStruct
.
PLL
.
PLLM
=
6
;
RCC_OscInitStruct
.
PLL
.
PLLN
=
168
;
RCC_OscInitStruct
.
PLL
.
PLLP
=
RCC_PLLP_DIV2
;
RCC_OscInitStruct
.
PLL
.
PLLQ
=
4
;
if
(
HAL_RCC_OscConfig
(
&
RCC_OscInitStruct
)
!=
HAL_OK
)
{
Error_Handler
();
}
/** Initializes the CPU, AHB and APB buses clocks
*/
RCC_ClkInitStruct
.
ClockType
=
RCC_CLOCKTYPE_HCLK
|
RCC_CLOCKTYPE_SYSCLK
|
RCC_CLOCKTYPE_PCLK1
|
RCC_CLOCKTYPE_PCLK2
;
RCC_ClkInitStruct
.
SYSCLKSource
=
RCC_SYSCLKSOURCE_PLLCLK
;
RCC_ClkInitStruct
.
AHBCLKDivider
=
RCC_SYSCLK_DIV1
;
RCC_ClkInitStruct
.
APB1CLKDivider
=
RCC_HCLK_DIV4
;
RCC_ClkInitStruct
.
APB2CLKDivider
=
RCC_HCLK_DIV2
;
if
(
HAL_RCC_ClockConfig
(
&
RCC_ClkInitStruct
,
FLASH_LATENCY_5
)
!=
HAL_OK
)
{
Error_Handler
();
}
}
/**
* @brief ADC3 Initialization Function
* @param None
* @retval None
*/
static
void
MX_ADC3_Init
(
void
)
{
/* USER CODE BEGIN ADC3_Init 0 */
/* USER CODE END ADC3_Init 0 */
ADC_ChannelConfTypeDef
sConfig
=
{
0
};
/* USER CODE BEGIN ADC3_Init 1 */
/* USER CODE END ADC3_Init 1 */
/** Configure the global features of the ADC (Clock, Resolution, Data Alignment and number of conversion)
*/
hadc3
.
Instance
=
ADC3
;
hadc3
.
Init
.
ClockPrescaler
=
ADC_CLOCK_SYNC_PCLK_DIV4
;
hadc3
.
Init
.
Resolution
=
ADC_RESOLUTION_12B
;
hadc3
.
Init
.
ScanConvMode
=
DISABLE
;
hadc3
.
Init
.
ContinuousConvMode
=
DISABLE
;
hadc3
.
Init
.
DiscontinuousConvMode
=
DISABLE
;
hadc3
.
Init
.
ExternalTrigConvEdge
=
ADC_EXTERNALTRIGCONVEDGE_NONE
;
hadc3
.
Init
.
ExternalTrigConv
=
ADC_SOFTWARE_START
;
hadc3
.
Init
.
DataAlign
=
ADC_DATAALIGN_RIGHT
;
hadc3
.
Init
.
NbrOfConversion
=
1
;
hadc3
.
Init
.
DMAContinuousRequests
=
DISABLE
;
hadc3
.
Init
.
EOCSelection
=
ADC_EOC_SINGLE_CONV
;
if
(
HAL_ADC_Init
(
&
hadc3
)
!=
HAL_OK
)
{
Error_Handler
();
}
/** Configure for the selected ADC regular channel its corresponding rank in the sequencer and its sample time.
*/
sConfig
.
Channel
=
ADC_CHANNEL_8
;
sConfig
.
Rank
=
1
;
sConfig
.
SamplingTime
=
ADC_SAMPLETIME_3CYCLES
;
if
(
HAL_ADC_ConfigChannel
(
&
hadc3
,
&
sConfig
)
!=
HAL_OK
)
{
Error_Handler
();
}
/* USER CODE BEGIN ADC3_Init 2 */
/* USER CODE END ADC3_Init 2 */
}
/**
* @brief CAN1 Initialization Function
* @param None
* @retval None
*/
static
void
MX_CAN1_Init
(
void
)
{
/* USER CODE BEGIN CAN1_Init 0 */
/* USER CODE END CAN1_Init 0 */
/* USER CODE BEGIN CAN1_Init 1 */
/* USER CODE END CAN1_Init 1 */
hcan1
.
Instance
=
CAN1
;
hcan1
.
Init
.
Prescaler
=
16
;
hcan1
.
Init
.
Mode
=
CAN_MODE_NORMAL
;
hcan1
.
Init
.
SyncJumpWidth
=
CAN_SJW_1TQ
;
hcan1
.
Init
.
TimeSeg1
=
CAN_BS1_1TQ
;
hcan1
.
Init
.
TimeSeg2
=
CAN_BS2_1TQ
;
hcan1
.
Init
.
TimeTriggeredMode
=
DISABLE
;
hcan1
.
Init
.
AutoBusOff
=
DISABLE
;
hcan1
.
Init
.
AutoWakeUp
=
DISABLE
;
hcan1
.
Init
.
AutoRetransmission
=
DISABLE
;
hcan1
.
Init
.
ReceiveFifoLocked
=
DISABLE
;
hcan1
.
Init
.
TransmitFifoPriority
=
DISABLE
;
if
(
HAL_CAN_Init
(
&
hcan1
)
!=
HAL_OK
)
{
Error_Handler
();
}
/* USER CODE BEGIN CAN1_Init 2 */
/* USER CODE END CAN1_Init 2 */
}
/**
* @brief CAN2 Initialization Function
* @param None
* @retval None
*/
static
void
MX_CAN2_Init
(
void
)
{
/* USER CODE BEGIN CAN2_Init 0 */
/* USER CODE END CAN2_Init 0 */
/* USER CODE BEGIN CAN2_Init 1 */
/* USER CODE END CAN2_Init 1 */
hcan2
.
Instance
=
CAN2
;
hcan2
.
Init
.
Prescaler
=
16
;
hcan2
.
Init
.
Mode
=
CAN_MODE_NORMAL
;
hcan2
.
Init
.
SyncJumpWidth
=
CAN_SJW_1TQ
;
hcan2
.
Init
.
TimeSeg1
=
CAN_BS1_1TQ
;
hcan2
.
Init
.
TimeSeg2
=
CAN_BS2_1TQ
;
hcan2
.
Init
.
TimeTriggeredMode
=
DISABLE
;
hcan2
.
Init
.
AutoBusOff
=
DISABLE
;
hcan2
.
Init
.
AutoWakeUp
=
DISABLE
;
hcan2
.
Init
.
AutoRetransmission
=
DISABLE
;
hcan2
.
Init
.
ReceiveFifoLocked
=
DISABLE
;
hcan2
.
Init
.
TransmitFifoPriority
=
DISABLE
;
if
(
HAL_CAN_Init
(
&
hcan2
)
!=
HAL_OK
)
{
Error_Handler
();
}
/* USER CODE BEGIN CAN2_Init 2 */
/* USER CODE END CAN2_Init 2 */
}
/**
* @brief SPI2 Initialization Function
* @param None
* @retval None
*/
static
void
MX_SPI2_Init
(
void
)
{
/* USER CODE BEGIN SPI2_Init 0 */
/* USER CODE END SPI2_Init 0 */
/* USER CODE BEGIN SPI2_Init 1 */
/* USER CODE END SPI2_Init 1 */
/* SPI2 parameter configuration*/
hspi2
.
Instance
=
SPI2
;
hspi2
.
Init
.
Mode
=
SPI_MODE_MASTER
;
hspi2
.
Init
.
Direction
=
SPI_DIRECTION_2LINES
;
hspi2
.
Init
.
DataSize
=
SPI_DATASIZE_8BIT
;
hspi2
.
Init
.
CLKPolarity
=
SPI_POLARITY_LOW
;
hspi2
.
Init
.
CLKPhase
=
SPI_PHASE_1EDGE
;
hspi2
.
Init
.
NSS
=
SPI_NSS_SOFT
;
hspi2
.
Init
.
BaudRatePrescaler
=
SPI_BAUDRATEPRESCALER_2
;
hspi2
.
Init
.
FirstBit
=
SPI_FIRSTBIT_MSB
;
hspi2
.
Init
.
TIMode
=
SPI_TIMODE_DISABLE
;
hspi2
.
Init
.
CRCCalculation
=
SPI_CRCCALCULATION_DISABLE
;
hspi2
.
Init
.
CRCPolynomial
=
10
;
if
(
HAL_SPI_Init
(
&
hspi2
)
!=
HAL_OK
)
{
Error_Handler
();
}
/* USER CODE BEGIN SPI2_Init 2 */
/* USER CODE END SPI2_Init 2 */
}
/**
* @brief TIM1 Initialization Function
* @param None
* @retval None
*/
static
void
MX_TIM1_Init
(
void
)
{
/* USER CODE BEGIN TIM1_Init 0 */
/* USER CODE END TIM1_Init 0 */
TIM_ClockConfigTypeDef
sClockSourceConfig
=
{
0
};
TIM_MasterConfigTypeDef
sMasterConfig
=
{
0
};
TIM_OC_InitTypeDef
sConfigOC
=
{
0
};
TIM_BreakDeadTimeConfigTypeDef
sBreakDeadTimeConfig
=
{
0
};
/* USER CODE BEGIN TIM1_Init 1 */
/* USER CODE END TIM1_Init 1 */
htim1
.
Instance
=
TIM1
;
htim1
.
Init
.
Prescaler
=
0
;
htim1
.
Init
.
CounterMode
=
TIM_COUNTERMODE_UP
;
htim1
.
Init
.
Period
=
65535
;
htim1
.
Init
.
ClockDivision
=
TIM_CLOCKDIVISION_DIV1
;
htim1
.
Init
.
RepetitionCounter
=
0
;
htim1
.
Init
.
AutoReloadPreload
=
TIM_AUTORELOAD_PRELOAD_DISABLE
;
if
(
HAL_TIM_Base_Init
(
&
htim1
)
!=
HAL_OK
)
{
Error_Handler
();
}
sClockSourceConfig
.
ClockSource
=
TIM_CLOCKSOURCE_INTERNAL
;
if
(
HAL_TIM_ConfigClockSource
(
&
htim1
,
&
sClockSourceConfig
)
!=
HAL_OK
)
{
Error_Handler
();
}
if
(
HAL_TIM_PWM_Init
(
&
htim1
)
!=
HAL_OK
)
{
Error_Handler
();
}
sMasterConfig
.
MasterOutputTrigger
=
TIM_TRGO_RESET
;
sMasterConfig
.
MasterSlaveMode
=
TIM_MASTERSLAVEMODE_DISABLE
;
if
(
HAL_TIMEx_MasterConfigSynchronization
(
&
htim1
,
&
sMasterConfig
)
!=
HAL_OK
)
{
Error_Handler
();
}
sConfigOC
.
OCMode
=
TIM_OCMODE_PWM1
;
sConfigOC
.
Pulse
=
0
;
sConfigOC
.
OCPolarity
=
TIM_OCPOLARITY_HIGH
;
sConfigOC
.
OCNPolarity
=
TIM_OCNPOLARITY_HIGH
;
sConfigOC
.
OCFastMode
=
TIM_OCFAST_DISABLE
;
sConfigOC
.
OCIdleState
=
TIM_OCIDLESTATE_RESET
;
sConfigOC
.
OCNIdleState
=
TIM_OCNIDLESTATE_RESET
;
if
(
HAL_TIM_PWM_ConfigChannel
(
&
htim1
,
&
sConfigOC
,
TIM_CHANNEL_1
)
!=
HAL_OK
)
{
Error_Handler
();
}
if
(
HAL_TIM_PWM_ConfigChannel
(
&
htim1
,
&
sConfigOC
,
TIM_CHANNEL_2
)
!=
HAL_OK
)
{
Error_Handler
();
}
if
(
HAL_TIM_PWM_ConfigChannel
(
&
htim1
,
&
sConfigOC
,
TIM_CHANNEL_3
)
!=
HAL_OK
)
{
Error_Handler
();
}
if
(
HAL_TIM_PWM_ConfigChannel
(
&
htim1
,
&
sConfigOC
,
TIM_CHANNEL_4
)
!=
HAL_OK
)
{
Error_Handler
();
}
sBreakDeadTimeConfig
.
OffStateRunMode
=
TIM_OSSR_DISABLE
;
sBreakDeadTimeConfig
.
OffStateIDLEMode
=
TIM_OSSI_DISABLE
;
sBreakDeadTimeConfig
.
LockLevel
=
TIM_LOCKLEVEL_OFF
;
sBreakDeadTimeConfig
.
DeadTime
=
0
;
sBreakDeadTimeConfig
.
BreakState
=
TIM_BREAK_DISABLE
;
sBreakDeadTimeConfig
.
BreakPolarity
=
TIM_BREAKPOLARITY_HIGH
;
sBreakDeadTimeConfig
.
AutomaticOutput
=
TIM_AUTOMATICOUTPUT_DISABLE
;
if
(
HAL_TIMEx_ConfigBreakDeadTime
(
&
htim1
,
&
sBreakDeadTimeConfig
)
!=
HAL_OK
)
{
Error_Handler
();
}
/* USER CODE BEGIN TIM1_Init 2 */
/* USER CODE END TIM1_Init 2 */
HAL_TIM_MspPostInit
(
&
htim1
);
}
/**
* @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
=
65535
;
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_3
)
!=
HAL_OK
)
{
Error_Handler
();
}
/* USER CODE BEGIN TIM4_Init 2 */
/* USER CODE END TIM4_Init 2 */
HAL_TIM_MspPostInit
(
&
htim4
);
}
/**
* @brief TIM8 Initialization Function
* @param None
* @retval None
*/
static
void
MX_TIM8_Init
(
void
)
{
/* USER CODE BEGIN TIM8_Init 0 */
/* USER CODE END TIM8_Init 0 */
TIM_ClockConfigTypeDef
sClockSourceConfig
=
{
0
};
TIM_MasterConfigTypeDef
sMasterConfig
=
{
0
};
TIM_OC_InitTypeDef
sConfigOC
=
{
0
};
TIM_BreakDeadTimeConfigTypeDef
sBreakDeadTimeConfig
=
{
0
};
/* USER CODE BEGIN TIM8_Init 1 */
/* USER CODE END TIM8_Init 1 */
htim8
.
Instance
=
TIM8
;
htim8
.
Init
.
Prescaler
=
0
;
htim8
.
Init
.
CounterMode
=
TIM_COUNTERMODE_UP
;
htim8
.
Init
.
Period
=
65535
;
htim8
.
Init
.
ClockDivision
=
TIM_CLOCKDIVISION_DIV1
;
htim8
.
Init
.
RepetitionCounter
=
0
;
htim8
.
Init
.
AutoReloadPreload
=
TIM_AUTORELOAD_PRELOAD_DISABLE
;
if
(
HAL_TIM_Base_Init
(
&
htim8
)
!=
HAL_OK
)
{
Error_Handler
();
}
sClockSourceConfig
.
ClockSource
=
TIM_CLOCKSOURCE_INTERNAL
;
if
(
HAL_TIM_ConfigClockSource
(
&
htim8
,
&
sClockSourceConfig
)
!=
HAL_OK
)
{
Error_Handler
();
}
if
(
HAL_TIM_PWM_Init
(
&
htim8
)
!=
HAL_OK
)
{
Error_Handler
();
}
sMasterConfig
.
MasterOutputTrigger
=
TIM_TRGO_RESET
;
sMasterConfig
.
MasterSlaveMode
=
TIM_MASTERSLAVEMODE_DISABLE
;
if
(
HAL_TIMEx_MasterConfigSynchronization
(
&
htim8
,
&
sMasterConfig
)
!=
HAL_OK
)
{
Error_Handler
();
}
sConfigOC
.
OCMode
=
TIM_OCMODE_PWM1
;
sConfigOC
.
Pulse
=
0
;
sConfigOC
.
OCPolarity
=
TIM_OCPOLARITY_HIGH
;
sConfigOC
.
OCNPolarity
=
TIM_OCNPOLARITY_HIGH
;
sConfigOC
.
OCFastMode
=
TIM_OCFAST_DISABLE
;
sConfigOC
.
OCIdleState
=
TIM_OCIDLESTATE_RESET
;
sConfigOC
.
OCNIdleState
=
TIM_OCNIDLESTATE_RESET
;
if
(
HAL_TIM_PWM_ConfigChannel
(
&
htim8
,
&
sConfigOC
,
TIM_CHANNEL_1
)
!=
HAL_OK
)
{
Error_Handler
();
}
if
(
HAL_TIM_PWM_ConfigChannel
(
&
htim8
,
&
sConfigOC
,
TIM_CHANNEL_2
)
!=
HAL_OK
)
{
Error_Handler
();
}
if
(
HAL_TIM_PWM_ConfigChannel
(
&
htim8
,
&
sConfigOC
,
TIM_CHANNEL_3
)
!=
HAL_OK
)
{
Error_Handler
();
}
sBreakDeadTimeConfig
.
OffStateRunMode
=
TIM_OSSR_DISABLE
;
sBreakDeadTimeConfig
.
OffStateIDLEMode
=
TIM_OSSI_DISABLE
;
sBreakDeadTimeConfig
.
LockLevel
=
TIM_LOCKLEVEL_OFF
;
sBreakDeadTimeConfig
.
DeadTime
=
0
;
sBreakDeadTimeConfig
.
BreakState
=
TIM_BREAK_DISABLE
;
sBreakDeadTimeConfig
.
BreakPolarity
=
TIM_BREAKPOLARITY_HIGH
;
sBreakDeadTimeConfig
.
AutomaticOutput
=
TIM_AUTOMATICOUTPUT_DISABLE
;
if
(
HAL_TIMEx_ConfigBreakDeadTime
(
&
htim8
,
&
sBreakDeadTimeConfig
)
!=
HAL_OK
)
{
Error_Handler
();
}
/* USER CODE BEGIN TIM8_Init 2 */
/* USER CODE END TIM8_Init 2 */
HAL_TIM_MspPostInit
(
&
htim8
);
}
/**
* @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
* @param None
* @retval None
*/
static
void
MX_USART6_UART_Init
(
void
)
{
/* USER CODE BEGIN USART6_Init 0 */
/* USER CODE END USART6_Init 0 */
/* USER CODE BEGIN USART6_Init 1 */
/* USER CODE END USART6_Init 1 */
huart6
.
Instance
=
USART6
;
huart6
.
Init
.
BaudRate
=
115200
;
huart6
.
Init
.
WordLength
=
UART_WORDLENGTH_8B
;
huart6
.
Init
.
StopBits
=
UART_STOPBITS_1
;
huart6
.
Init
.
Parity
=
UART_PARITY_NONE
;
huart6
.
Init
.
Mode
=
UART_MODE_TX_RX
;
huart6
.
Init
.
HwFlowCtl
=
UART_HWCONTROL_NONE
;
huart6
.
Init
.
OverSampling
=
UART_OVERSAMPLING_16
;
if
(
HAL_UART_Init
(
&
huart6
)
!=
HAL_OK
)
{
Error_Handler
();
}
/* USER CODE BEGIN USART6_Init 2 */
/* USER CODE END USART6_Init 2 */
}
/**
* @brief GPIO Initialization Function
* @param None
* @retval None
*/
static
void
MX_GPIO_Init
(
void
)
{
/* GPIO Ports Clock Enable */
__HAL_RCC_GPIOB_CLK_ENABLE
();
__HAL_RCC_GPIOG_CLK_ENABLE
();
__HAL_RCC_GPIOA_CLK_ENABLE
();
__HAL_RCC_GPIOD_CLK_ENABLE
();
__HAL_RCC_GPIOC_CLK_ENABLE
();
__HAL_RCC_GPIOI_CLK_ENABLE
();
__HAL_RCC_GPIOH_CLK_ENABLE
();
__HAL_RCC_GPIOF_CLK_ENABLE
();
__HAL_RCC_GPIOE_CLK_ENABLE
();
}
/* USER CODE BEGIN 4 */
/* USER CODE END 4 */
/**
* @brief This function is executed in case of error occurrence.
* @retval None
*/
void
Error_Handler
(
void
)
{
/* USER CODE BEGIN Error_Handler_Debug */
/* User can add his own implementation to report the HAL error return state */
__disable_irq
();
while
(
1
)
{
}
/* USER CODE END Error_Handler_Debug */
}
#ifdef USE_FULL_ASSERT
/**
* @brief Reports the name of the source file and the source line number
* where the assert_param error has occurred.
* @param file: pointer to the source file name
* @param line: assert_param error line source number
* @retval None
*/
void
assert_failed
(
uint8_t
*
file
,
uint32_t
line
)
{
/* USER CODE BEGIN 6 */
/* User can add his own implementation to report the file name and line number,
ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */
/* USER CODE END 6 */
}
#endif
/* USE_FULL_ASSERT */
bsp/stm32/stm32f407-robomaster-c/board/CubeMX_Config/Src/stm32f4xx_hal_msp.c
浏览文件 @
ba2d7ba4
...
...
@@ -88,7 +88,18 @@ void HAL_MspInit(void)
void
HAL_ADC_MspInit
(
ADC_HandleTypeDef
*
hadc
)
{
GPIO_InitTypeDef
GPIO_InitStruct
=
{
0
};
if
(
hadc
->
Instance
==
ADC3
)
if
(
hadc
->
Instance
==
ADC1
)
{
/* USER CODE BEGIN ADC1_MspInit 0 */
/* USER CODE END ADC1_MspInit 0 */
/* Peripheral clock enable */
__HAL_RCC_ADC1_CLK_ENABLE
();
/* USER CODE BEGIN ADC1_MspInit 1 */
/* USER CODE END ADC1_MspInit 1 */
}
else
if
(
hadc
->
Instance
==
ADC3
)
{
/* USER CODE BEGIN ADC3_MspInit 0 */
...
...
@@ -120,7 +131,18 @@ void HAL_ADC_MspInit(ADC_HandleTypeDef* hadc)
*/
void
HAL_ADC_MspDeInit
(
ADC_HandleTypeDef
*
hadc
)
{
if
(
hadc
->
Instance
==
ADC3
)
if
(
hadc
->
Instance
==
ADC1
)
{
/* USER CODE BEGIN ADC1_MspDeInit 0 */
/* USER CODE END ADC1_MspDeInit 0 */
/* Peripheral clock disable */
__HAL_RCC_ADC1_CLK_DISABLE
();
/* USER CODE BEGIN ADC1_MspDeInit 1 */
/* USER CODE END ADC1_MspDeInit 1 */
}
else
if
(
hadc
->
Instance
==
ADC3
)
{
/* USER CODE BEGIN ADC3_MspDeInit 0 */
...
...
@@ -264,68 +286,68 @@ void HAL_CAN_MspDeInit(CAN_HandleTypeDef* hcan)
}
/**
* @brief
SPI
MSP Initialization
* @brief
I2C
MSP Initialization
* This function configures the hardware resources used in this example
* @param h
spi: SPI
handle pointer
* @param h
i2c: I2C
handle pointer
* @retval None
*/
void
HAL_
SPI_MspInit
(
SPI_HandleTypeDef
*
hspi
)
void
HAL_
I2C_MspInit
(
I2C_HandleTypeDef
*
hi2c
)
{
GPIO_InitTypeDef
GPIO_InitStruct
=
{
0
};
if
(
h
spi
->
Instance
==
SPI
2
)
if
(
h
i2c
->
Instance
==
I2C
2
)
{
/* USER CODE BEGIN
SPI
2_MspInit 0 */
/* USER CODE BEGIN
I2C
2_MspInit 0 */
/* USER CODE END SPI2_MspInit 0 */
/* Peripheral clock enable */
__HAL_RCC_SPI2_CLK_ENABLE
();
/* USER CODE END I2C2_MspInit 0 */
__HAL_RCC_GPIOB_CLK_ENABLE
();
/**SPI2 GPIO Configuration
PB13 ------> SPI2_SCK
PB14 ------> SPI2_MISO
PB15 ------> SPI2_MOSI
__HAL_RCC_GPIOF_CLK_ENABLE
();
/**I2C2 GPIO Configuration
PF0 ------> I2C2_SDA
PF1 ------> I2C2_SCL
*/
GPIO_InitStruct
.
Pin
=
GPIO_PIN_
13
|
GPIO_PIN_14
|
GPIO_PIN_15
;
GPIO_InitStruct
.
Mode
=
GPIO_MODE_AF_
PP
;
GPIO_InitStruct
.
Pin
=
GPIO_PIN_
0
|
GPIO_PIN_1
;
GPIO_InitStruct
.
Mode
=
GPIO_MODE_AF_
OD
;
GPIO_InitStruct
.
Pull
=
GPIO_NOPULL
;
GPIO_InitStruct
.
Speed
=
GPIO_SPEED_FREQ_VERY_HIGH
;
GPIO_InitStruct
.
Alternate
=
GPIO_AF
5_SPI
2
;
HAL_GPIO_Init
(
GPIO
B
,
&
GPIO_InitStruct
);
GPIO_InitStruct
.
Alternate
=
GPIO_AF
4_I2C
2
;
HAL_GPIO_Init
(
GPIO
F
,
&
GPIO_InitStruct
);
/* USER CODE BEGIN SPI2_MspInit 1 */
/* Peripheral clock enable */
__HAL_RCC_I2C2_CLK_ENABLE
();
/* USER CODE BEGIN I2C2_MspInit 1 */
/* USER CODE END
SPI
2_MspInit 1 */
/* USER CODE END
I2C
2_MspInit 1 */
}
}
/**
* @brief
SPI
MSP De-Initialization
* @brief
I2C
MSP De-Initialization
* This function freeze the hardware resources used in this example
* @param h
spi: SPI
handle pointer
* @param h
i2c: I2C
handle pointer
* @retval None
*/
void
HAL_
SPI_MspDeInit
(
SPI_HandleTypeDef
*
hspi
)
void
HAL_
I2C_MspDeInit
(
I2C_HandleTypeDef
*
hi2c
)
{
if
(
h
spi
->
Instance
==
SPI
2
)
if
(
h
i2c
->
Instance
==
I2C
2
)
{
/* USER CODE BEGIN
SPI
2_MspDeInit 0 */
/* USER CODE BEGIN
I2C
2_MspDeInit 0 */
/* USER CODE END
SPI
2_MspDeInit 0 */
/* USER CODE END
I2C
2_MspDeInit 0 */
/* Peripheral clock disable */
__HAL_RCC_
SPI
2_CLK_DISABLE
();
__HAL_RCC_
I2C
2_CLK_DISABLE
();
/**SPI2 GPIO Configuration
PB13 ------> SPI2_SCK
PB14 ------> SPI2_MISO
PB15 ------> SPI2_MOSI
/**I2C2 GPIO Configuration
PF0 ------> I2C2_SDA
PF1 ------> I2C2_SCL
*/
HAL_GPIO_DeInit
(
GPIOB
,
GPIO_PIN_13
|
GPIO_PIN_14
|
GPIO_PIN_15
);
HAL_GPIO_DeInit
(
GPIOF
,
GPIO_PIN_0
);
HAL_GPIO_DeInit
(
GPIOF
,
GPIO_PIN_1
);
/* USER CODE BEGIN
SPI
2_MspDeInit 1 */
/* USER CODE BEGIN
I2C
2_MspDeInit 1 */
/* USER CODE END
SPI
2_MspDeInit 1 */
/* USER CODE END
I2C
2_MspDeInit 1 */
}
}
...
...
bsp/stm32/stm32f407-robomaster-c/board/CubeMX_Config/Src/system_stm32f4xx.c
已删除
100644 → 0
浏览文件 @
8ade0879
此差异已折叠。
点击以展开。
bsp/stm32/stm32f407-robomaster-c/board/Kconfig
浏览文件 @
ba2d7ba4
...
...
@@ -9,6 +9,29 @@ config SOC_STM32F407IG
menu "Onboard Peripheral Drivers"
config BSP_USING_ARDUINO
bool "Compatible with Arduino Ecosystem (RTduino)"
select PKG_USING_RTDUINO
select BSP_USING_STLINK_TO_USART
select BSP_USING_GPIO
select BSP_USING_ADC
select BSP_USING_ADC1
select BSP_USING_PWM
select BSP_USING_PWM1
select BSP_USING_PWM1_CH1
select BSP_USING_PWM1_CH2
select BSP_USING_PWM1_CH3
select BSP_USING_PWM1_CH4
select BSP_USING_PWM8
select BSP_USING_PWM8_CH1
select BSP_USING_PWM8_CH2
select BSP_USING_PWM8_CH3
select BSP_USING_I2C
select BSP_USING_I2C1
imply RTDUINO_USING_SERVO
imply RTDUINO_USING_WIRE
default n
endmenu
menu "On-chip Peripheral Drivers"
...
...
@@ -118,6 +141,9 @@ menu "On-chip Peripheral Drivers"
default n
select RT_USING_ADC
if BSP_USING_ADC
config BSP_USING_ADC1
bool "Enable ADC1"
default n
config BSP_USING_ADC3
bool "Enable ADC3"
default n
...
...
@@ -151,6 +177,7 @@ menu "On-chip Peripheral Drivers"
select RT_USING_I2C_BITOPS
select RT_USING_PIN
if BSP_USING_I2C1
comment "Notice: PF0 --> 80; PF1 --> 81"
config BSP_I2C1_SCL_PIN
int "i2c1 scl pin number"
default 81
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录