Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Richard 祝发兴 - -IT
rt-thread
提交
dc6b9fde
R
rt-thread
项目概览
Richard 祝发兴 - -IT
/
rt-thread
与 Fork 源项目一致
Fork自
RT-Thread / rt-thread
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rt-thread
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
dc6b9fde
编写于
9月 18, 2022
作者:
L
liyangyang
提交者:
mysterywolf
9月 18, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[RTduino]stm32f401-st-nucleo 更新对接文件
上级
60d6e429
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
89 addition
and
87 deletion
+89
-87
bsp/stm32/stm32f103-blue-pill/applications/arduino_pinout/README_zh.md
...32f103-blue-pill/applications/arduino_pinout/README_zh.md
+2
-2
bsp/stm32/stm32f401-st-nucleo/applications/arduino_pinout/README.md
...stm32f401-st-nucleo/applications/arduino_pinout/README.md
+27
-27
bsp/stm32/stm32f401-st-nucleo/applications/arduino_pinout/pins_arduino.c
...f401-st-nucleo/applications/arduino_pinout/pins_arduino.c
+28
-28
bsp/stm32/stm32f401-st-nucleo/applications/arduino_pinout/pins_arduino.h
...f401-st-nucleo/applications/arduino_pinout/pins_arduino.h
+32
-30
未找到文件。
bsp/stm32/stm32f103-blue-pill/applications/arduino_pinout/README_zh.md
浏览文件 @
dc6b9fde
...
...
@@ -54,8 +54,8 @@ Hardware Drivers Config --->
| 29 (A2) | PA5 | 否 | ADC1-CH5,默认被RT-Thread的ADC设备框架adc1接管 |
| 30 (A3) | PA6 | 否 | ADC1-CH6,默认被RT-Thread的ADC设备框架adc1接管 |
| 31 (A4) | PA7 | 否 | ADC1-CH7,默认被RT-Thread的ADC设备框架adc1接管 |
| 32 (A5) | -- | | 芯片内部参考电压 ADC,默认被RT-Thread的ADC设备框架adc1接管
|
| 33 (A6) | -- | | 芯片内部温度 ADC
|
| 32 (A5) | -- | | 芯片内部参考电压 ADC,默认被RT-Thread的ADC设备框架adc1接管 |
| 33 (A6) | -- | | 芯片内部温度 ADC
,默认被RT-Thread的ADC设备框架adc1接管
|
> 注意:
>
...
...
bsp/stm32/stm32f401-st-nucleo/applications/arduino_pinout/README.md
浏览文件 @
dc6b9fde
...
...
@@ -20,33 +20,33 @@ Hardware Drivers Config --->
该BSP遵照Arduino UNO板的引脚排列方式。详见
`pins_arduino.c`
| Arduino引脚编号 | STM32引脚编号 | 5V容忍 | 备注
|
| --------------- | ------------- | ------ | --------------------------------------------------------
----
|
| 0 (D0) | -- | |
该引脚在UNO板中为串口RX引脚,不可当做普通IO
|
| 1 (D1) | -- | |
该引脚在UNO板中为串口TX引脚,不可当做普通IO
|
| 2 (D2) | PA10 | 是 |
|
| 3 (D3) | PB3 | 是 | PWM
(定时器2发生)
|
| 4 (D4) | PB5 | 是 |
|
| 5 (D5) | PB4 | 是 | PWM
(定时器3发生)
|
| 6 (D6) | PB10 | 是 | PWM
(定时器2发生)
|
| 7 (D7) | PA8 | 是 |
|
| 8 (D8) | PA9 | 是 |
|
| 9 (D9) | PC7 | 是 | PWM
(定时器3发生)
|
| 10 (D10) | PB6 | 是 | PWM
(定时器4发生)
|
| 11 (D11) | PA7 | 是 | PWM
(定时器1发生)
|
| 12 (D12) | PA6 | 是 | |
| 13 (D13) | PA5 | 是 | |
| 14 (D14) | PB9 | 是 | I2C
1-SDA,被RT-Thread的I2C设备框架i2c1总线接管,不可当做普通IO
|
| 15 (D15) | PB8 | 是 | I2C
1_SCL,被RT-Thread的I2C设备框架i2c1总线接管,不可当做普通IO
|
| 16 (D16) | PC13 | 是 | Nucleo板载用户按键(左侧蓝色)
|
| A0 | PA0 | 是 | ADC
|
| A1 | PA1 | 是 | ADC
|
| A2 | PA4 | 是 | ADC
|
| A3 | PB0 | 是 | ADC
|
| A4 | PC1 | 是 | ADC
|
| A5 | PC0 | 是 | ADC
|
| A6 | -- | | 芯片内部参考电压 ADC
|
| A7 | -- | | 芯片内部温度 ADC
|
| Arduino引脚编号 | STM32引脚编号 | 5V容忍 | 备注 |
| --------------- | ------------- | ------ | -------------------------------------------------------- |
| 0 (D0) | -- | |
UART2-RX,默认被RT-Thread的UART设备框架uart2接管
|
| 1 (D1) | -- | |
UART2-TX,默认被RT-Thread的UART设备框架uart2接管
|
| 2 (D2) | PA10 | 是 | |
| 3 (D3) | PB3 | 是 | PWM
2-CH2,默认被RT-Thread的PWM设备框架pwm2接管
|
| 4 (D4) | PB5 | 是 | |
| 5 (D5) | PB4 | 是 | PWM
3-CH1,默认被RT-Thread的PWM设备框架pwm3接管
|
| 6 (D6) | PB10 | 是 | PWM
2-CH3,默认被RT-Thread的PWM设备框架pwm2接管
|
| 7 (D7) | PA8 | 是 | |
| 8 (D8) | PA9 | 是 | |
| 9 (D9) | PC7 | 是 | PWM
3-CH2,默认被RT-Thread的PWM设备框架pwm3接管
|
| 10 (D10) | PB6 | 是 | PWM
4-CH1,默认被RT-Thread的PWM设备框架pwm4接管
|
| 11 (D11) | PA7 | 是 | PWM
1-CH1N,默认被RT-Thread的PWM设备框架pwm1接管
|
| 12 (D12) | PA6 | 是 |
|
| 13 (D13) | PA5 | 是 |
|
| 14 (D14) | PB9 | 是 | I2C
-SDA,默认被RT-Thread的I2C设备框架i2c1总线接管
|
| 15 (D15) | PB8 | 是 | I2C
-SCL,默认被RT-Thread的I2C设备框架i2c1总线接管
|
| 16 (D16) | PC13 | 是 | Nucleo板载用户按键(左侧蓝色) |
| A0 | PA0 | 是 | ADC
1-CH0,默认被RT-Thread的ADC设备框架adc1接管
|
| A1 | PA1 | 是 | ADC
1-CH1,默认被RT-Thread的ADC设备框架adc1接管
|
| A2 | PA4 | 是 | ADC
1-CH4,默认被RT-Thread的ADC设备框架adc1接管
|
| A3 | PB0 | 是 | ADC
1-CH8,默认被RT-Thread的ADC设备框架adc1接管
|
| A4 | PC1 | 是 | ADC
1-CH11,默认被RT-Thread的ADC设备框架adc1接管
|
| A5 | PC0 | 是 | ADC
1-CH10,默认被RT-Thread的ADC设备框架adc1接管
|
| A6 | -- | | 芯片内部参考电压 ADC
,默认被RT-Thread的ADC设备框架adc1接管
|
| A7 | -- | | 芯片内部温度 ADC
,默认被RT-Thread的ADC设备框架adc1接管
|
> 注意:
>
...
...
bsp/stm32/stm32f401-st-nucleo/applications/arduino_pinout/pins_arduino.c
浏览文件 @
dc6b9fde
...
...
@@ -5,45 +5,45 @@
*
* Change Logs:
* Date Author Notes
* 2022-04-19 Meco Man first version
* 2022-07-26 liYony Perfect PWM (docking of complementary outputs)
* 2022-09-18 liYony first version
*/
#include <Arduino.h>
#include <board.h>
#include "pins_arduino.h"
/*
{Arduino Pin, RT-Thread Pin [, Device Name(PWM or ADC)
, 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.
*/
* {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
},
/* RX
*/
{
D1
},
/* TX
*/
{
D0
,
GET_PIN
(
A
,
3
),
"uart2"
},
/* Serial
*/
{
D1
,
GET_PIN
(
A
,
2
),
"uart2"
},
/* Serial
*/
{
D2
,
GET_PIN
(
A
,
10
)},
{
D3
,
GET_PIN
(
B
,
3
),
"pwm2"
,
2
},
/* PWM2-CH2
*/
{
D3
,
GET_PIN
(
B
,
3
),
"pwm2"
,
2
},
/* PWM
*/
{
D4
,
GET_PIN
(
B
,
5
)},
{
D5
,
GET_PIN
(
B
,
4
),
"pwm3"
,
1
},
/* PWM3-CH1
*/
{
D6
,
GET_PIN
(
B
,
10
),
"pwm2"
,
3
},
/* PWM2-CH3
*/
{
D5
,
GET_PIN
(
B
,
4
),
"pwm3"
,
1
},
/* PWM
*/
{
D6
,
GET_PIN
(
B
,
10
),
"pwm2"
,
3
},
/* PWM
*/
{
D7
,
GET_PIN
(
A
,
8
)},
{
D8
,
GET_PIN
(
A
,
9
)},
{
D9
,
GET_PIN
(
C
,
7
),
"pwm3"
,
2
},
/* PWM3-CH2
*/
{
D10
,
GET_PIN
(
B
,
6
),
"pwm4"
,
1
},
/* PWM4-CH1
*/
{
D11
,
GET_PIN
(
A
,
7
),
"pwm1"
,
-
1
},
/* PWM1-CH1N
*/
{
D9
,
GET_PIN
(
C
,
7
),
"pwm3"
,
2
},
/* PWM
*/
{
D10
,
GET_PIN
(
B
,
6
),
"pwm4"
,
1
},
/* PWM
*/
{
D11
,
GET_PIN
(
A
,
7
),
"pwm1"
,
-
1
},
/* PWM
*/
{
D12
,
GET_PIN
(
A
,
6
)},
{
D13
,
GET_PIN
(
A
,
5
)},
{
D14
},
/* I2C1-SDA
*/
{
D15
},
/* I2C1-SCL
*/
{
D16
,
GET_PIN
(
C
,
13
)},
/* user button */
{
A0
,
GET_PIN
(
A
,
0
),
"adc1"
,
0
},
/* ADC */
{
A1
,
GET_PIN
(
A
,
1
),
"adc1"
,
1
},
/* ADC */
{
A2
,
GET_PIN
(
A
,
4
),
"adc1"
,
4
},
/* ADC */
{
A3
,
GET_PIN
(
B
,
0
),
"adc1"
,
8
},
/* ADC */
{
A4
,
GET_PIN
(
C
,
1
),
"adc1"
,
11
},
/* ADC */
{
A5
,
GET_PIN
(
C
,
0
),
"adc1"
,
10
},
/* ADC */
{
A6
,
RT_NULL
,
"adc1"
,
17
},
/* ADC, On-Chip: internal reference voltage, ADC_CHANNEL_VREFINT */
{
A7
,
RT_NULL
,
"adc1"
,
16
}
/* ADC, On-Chip: internal temperature sensor, ADC_CHANNEL_TEMPSENSOR */
{
D13
,
GET_PIN
(
A
,
5
)},
/* LED_BUILTIN */
{
D14
,
GET_PIN
(
B
,
9
),
"i2c1"
},
/* I2C (Wire)
*/
{
D15
,
GET_PIN
(
B
,
8
),
"i2c1"
},
/* I2C (Wire)
*/
{
D16
,
GET_PIN
(
C
,
13
)},
{
A0
,
GET_PIN
(
A
,
0
),
"adc1"
,
0
},
/* ADC */
{
A1
,
GET_PIN
(
A
,
1
),
"adc1"
,
1
},
/* ADC */
{
A2
,
GET_PIN
(
A
,
4
),
"adc1"
,
4
},
/* ADC */
{
A3
,
GET_PIN
(
B
,
0
),
"adc1"
,
8
},
/* ADC */
{
A4
,
GET_PIN
(
C
,
1
),
"adc1"
,
11
},
/* ADC */
{
A5
,
GET_PIN
(
C
,
0
),
"adc1"
,
10
},
/* ADC */
{
A6
,
RT_NULL
,
"adc1"
,
17
},
/* ADC, On-Chip: internal reference voltage, ADC_CHANNEL_VREFINT */
{
A7
,
RT_NULL
,
"adc1"
,
16
}
,
/* ADC, On-Chip: internal temperature sensor, ADC_CHANNEL_TEMPSENSOR */
};
bsp/stm32/stm32f401-st-nucleo/applications/arduino_pinout/pins_arduino.h
浏览文件 @
dc6b9fde
/*
* Copyright (c) 2006-202
1
, RT-Thread Development Team
* Copyright (c) 2006-202
2
, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2022-0
4-19 Meco Man
first version
* 2022-0
9-18 liYony
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 D15 (15)
#define D16 (16)
#define A0 (17)
#define A1 (18)
#define A2 (19)
#define A3 (20)
#define A4 (21)
#define A5 (22)
#define A6 (23)
#define A7 (24)
#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 D15
(15)
#define D16
(16)
#define A0
(17)
#define A1
(18)
#define A2
(19)
#define A3
(20)
#define A4
(21)
#define A5
(22)
#define A6
(23)
#define A7
(24)
#define F_CPU 84000000L
/* CPU: 84MHz */
#define LED_BUILTIN D13
/* Default Built-in LED */
#define F_CPU 84000000L
/* CPU:84MHz */
#define RTDUINO_DEFAULT_IIC_BUS_NAME "i2c1"
#define LED_BUITIN D13
/* Default Built-in LED */
/* i2c1 - PB9-SDA PB8-SCL */
#define RTDUINO_DEFAULT_IIC_BUS_NAME "i2c1"
#endif
/* Pins_Arduino_h */
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录