Skip to content

Commit 19106eb

Browse files
authored
[RTduino]更新blue-pill引脚分布 (#6400)
* [RTduino]更新引脚分布 * update * update readme
1 parent f35791e commit 19106eb

File tree

4 files changed

+80
-52
lines changed

4 files changed

+80
-52
lines changed

bsp/stm32/stm32f103-blue-pill/applications/arduino_pinout/README.md

Lines changed: 35 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -22,40 +22,41 @@ Hardware Drivers Config --->
2222

2323
| Arduino引脚编号 | STM32引脚编号 | 5V容忍 | 备注 |
2424
| ----------- | --------- | ---- | -------------------------------------------- |
25-
| 0 (D0) | PB7 || |
26-
| 1 (D1) | PB6 || |
27-
| 2 (D2) | PB5 || PWM3-CH2(定时器3发生) |
28-
| 3 (D3) | PB4 || PWM3-CH1(定时器3发生) |
29-
| 4 (D4) | PB3 || PWM2-CH2(定时器2发生) |
30-
| 5 (D5) | PA15 || PWM2-CH1(定时器2发生) |
31-
| 6 (D6) | PA8 || |
32-
| 7 (D7) | PB12 || |
33-
| 8 (D8) | PC13 || |
34-
| 9 (D9) | PC14 || |
35-
| 10 (D10) | PC15 || |
36-
| 11 (D11) | PA0 || |
37-
| 12 (D12) | PB0 || PWM3-CH3(定时器3发生) |
38-
| 13 (D13) | PB1 || PWM3-CH4(定时器3发生) |
39-
| A0 | PA1 || ADC1-CH1 |
40-
| A1 | PA4 || ADC1-CH4 |
41-
| A2 | PA5 || ADC1-CH5 |
42-
| A3 | PA6 || ADC1-CH6 |
43-
| A4 | PA7 || ADC1-CH7 |
44-
| A5 | -- | | 芯片内部参考电压 ADC |
45-
| A6 | -- | | 芯片内部温度 ADC |
46-
| -- | PB9 || I2C-SDA,被RT-Thread的I2C设备框架i2c1总线接管,不可当做普通IO |
47-
| -- | PB8 || I2C-SCL,被RT-Thread的I2C设备框架i2c1总线接管,不可当做普通IO |
48-
| -- | PA12 || USB-DP,被TinyUSB接管,不可当做普通IO |
49-
| -- | PA11 || USB-DM,被TinyUSB接管,不可当做普通IO |
50-
| -- | PA10 || UART1-RX,被RT-Thread的UART设备框架uart1接管,不可当做普通IO |
51-
| -- | PA9 || UART1-TX,被RT-Thread的UART设备框架uart1接管,不可当做普通IO |
52-
| -- | PA2 || UART2-TX,被RT-Thread的UART设备框架uart2接管,不可当做普通IO |
53-
| -- | PA3 || UART2-RX,被RT-Thread的UART设备框架uart2接管,不可当做普通IO |
54-
| -- | PB10 || UART3-TX,被RT-Thread的UART设备框架uart3接管,不可当做普通IO |
55-
| -- | PB11 || UART3-RX,被RT-Thread的UART设备框架uart3接管,不可当做普通IO |
56-
| -- | PB15 || SPI-MOSI,被RT-Thread的SPI设备框架spi2接管,不可当做普通IO |
57-
| -- | PB14 || SPI-MISO,被RT-Thread的SPI设备框架spi2接管,不可当做普通IO |
58-
| -- | PB13 || SPI-SCK ,被RT-Thread的SPI设备框架spi2接管,不可当做普通IO |
25+
| 0 (D0) | PB7 || |
26+
| 1 (D1) | PB6 || |
27+
| 2 (D2) | PB5 || PWM3-CH2,默认被RT-Thread的PWM设备框架pwm3接管 |
28+
| 3 (D3) | PB4 || PWM3-CH1,默认被RT-Thread的PWM设备框架pwm3接管 |
29+
| 4 (D4) | PB3 || PWM2-CH2,默认被RT-Thread的PWM设备框架pwm2接管 |
30+
| 5 (D5) | PA15 || PWM2-CH1,默认被RT-Thread的PWM设备框架pwm2接管 |
31+
| 6 (D6) | PA8 || |
32+
| 7 (D7) | PB12 || |
33+
| 8 (D8) | PC13 || |
34+
| 9 (D9) | PC14 || |
35+
| 10 (D10) | PC15 || |
36+
| 11 (D11) | PA0 || |
37+
| 12 (D12) | PB0 || PWM3-CH3,默认被RT-Thread的PWM设备框架pwm3接管 |
38+
| 13 (D13) | PB1 || PWM3-CH4,默认被RT-Thread的PWM设备框架pwm3接管 |
39+
| 14 (D14) | PB9 || I2C-SDA,默认被RT-Thread的I2C设备框架i2c1总线接管 |
40+
| 15 (D15) | PB8 || I2C-SCL,默认被RT-Thread的I2C设备框架i2c1总线接管 |
41+
| 16 (D16) | PA12 || USB-DP,默认被 [TinyUSB软件包](https://github.com/RT-Thread-packages/tinyusb) 接管|
42+
| 17 (D17) | PA11 || USB-DM,默认被 [TinyUSB软件包](https://github.com/RT-Thread-packages/tinyusb) 接管|
43+
| 18 (D18) | PA10 || UART1-RX,默认被RT-Thread的UART设备框架uart1接管 |
44+
| 19 (D19) | PA9 || UART1-TX,默认被RT-Thread的UART设备框架uart1接管 |
45+
| 20 (D20) | PA2 || UART2-TX,默认被RT-Thread的UART设备框架uart2接管 |
46+
| 21 (D21) | PA3 || UART2-RX,默认被RT-Thread的UART设备框架uart2接管 |
47+
| 22 (D22) | PB10 || UART3-TX,默认被RT-Thread的UART设备框架uart3接管 |
48+
| 23 (D23) | PB11 || UART3-RX,默认被RT-Thread的UART设备框架uart3接管 |
49+
| 24 (D24) | PB15 || SPI-MOSI,默认被RT-Thread的SPI设备框架spi2接管 |
50+
| 25 (D25) | PB14 || SPI-MISO,默认被RT-Thread的SPI设备框架spi2接管 |
51+
| 26 (D26) | PB13 || SPI-SCK ,默认被RT-Thread的SPI设备框架spi2接管 |
52+
| 27 (A0) | PA1 || ADC1-CH1,默认被RT-Thread的ADC设备框架adc1接管 |
53+
| 28 (A1) | PA4 || ADC1-CH4,默认被RT-Thread的ADC设备框架adc1接管 |
54+
| 29 (A2) | PA5 || ADC1-CH5,默认被RT-Thread的ADC设备框架adc1接管 |
55+
| 30 (A3) | PA6 || ADC1-CH6,默认被RT-Thread的ADC设备框架adc1接管 |
56+
| 31 (A4) | PA7 || ADC1-CH7,默认被RT-Thread的ADC设备框架adc1接管 |
57+
| 32 (A5) | -- | | 芯片内部参考电压 ADC |
58+
| 33 (A6) | -- | | 芯片内部温度 ADC |
59+
5960

6061
> 注意:
6162
>
Loading

bsp/stm32/stm32f103-blue-pill/applications/arduino_pinout/pins_arduino.c

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,23 +22,36 @@ const pin_map_t pin_map_table[]=
2222
{
2323
{D0, GET_PIN(B,7)},
2424
{D1, GET_PIN(B,6)},
25-
{D2, GET_PIN(B,5), "pwm3", 2},/* PWM */
26-
{D3, GET_PIN(B,4), "pwm3", 1}, /* PWM */
27-
{D4, GET_PIN(B,3), "pwm2", 2}, /* PWM */
25+
{D2, GET_PIN(B,5), "pwm3", 2}, /* PWM */
26+
{D3, GET_PIN(B,4), "pwm3", 1}, /* PWM */
27+
{D4, GET_PIN(B,3), "pwm2", 2}, /* PWM */
2828
{D5, GET_PIN(A,15), "pwm2", 1}, /* PWM */
2929
{D6, GET_PIN(A,8)},
3030
{D7, GET_PIN(B,12)},
31-
{D8, GET_PIN(C,13)}, /* LED_BUILTIN */
31+
{D8, GET_PIN(C,13)}, /* LED_BUILTIN */
3232
{D9, GET_PIN(C,14)},
3333
{D10, GET_PIN(C,15)},
3434
{D11, GET_PIN(A,0)},
3535
{D12, GET_PIN(B,0), "pwm3", 3}, /* PWM */
3636
{D13, GET_PIN(B,1), "pwm3", 4}, /* PWM */
37-
{A0, GET_PIN(A,1), "adc1", 1}, /* ADC */
38-
{A1, GET_PIN(A,4), "adc1", 4}, /* ADC */
39-
{A2, GET_PIN(A,5), "adc1", 5}, /* ADC */
40-
{A3, GET_PIN(A,6), "adc1", 6}, /* ADC */
41-
{A4, GET_PIN(A,7), "adc1", 7}, /* ADC */
42-
{A5, RT_NULL, "adc1", 17}, /* ADC, On-Chip: internal reference voltage, ADC_CHANNEL_VREFINT */
43-
{A6, RT_NULL, "adc1", 16} /* ADC, On-Chip: internal temperature sensor, ADC_CHANNEL_TEMPSENSOR */
37+
{D14, GET_PIN(B,9), "i2c1"}, /* I2C (Wire) */
38+
{D15, GET_PIN(B,8), "i2c1"}, /* I2C (Wire) */
39+
{D16, GET_PIN(A,12), "usb"}, /* SerialUSB */
40+
{D17, GET_PIN(A,11), "usb"}, /* SerialUSB */
41+
{D18, GET_PIN(A,10), "uart1"}, /* Serial */
42+
{D19, GET_PIN(A,9), "uart1"}, /* Serial */
43+
{D20, GET_PIN(A,2), "uart2"}, /* Serial2 */
44+
{D21, GET_PIN(A,3), "uart2"}, /* Serial2 */
45+
{D22, GET_PIN(B,10), "uart3"}, /* Serial3 */
46+
{D23, GET_PIN(B,11), "uart3"}, /* Serial3 */
47+
{D24, GET_PIN(B,15), "spi2"}, /* SPI */
48+
{D25, GET_PIN(B,14), "spi2"}, /* SPI */
49+
{D26, GET_PIN(B,13), "spi2"}, /* SPI */
50+
{A0, GET_PIN(A,1), "adc1", 1}, /* ADC */
51+
{A1, GET_PIN(A,4), "adc1", 4}, /* ADC */
52+
{A2, GET_PIN(A,5), "adc1", 5}, /* ADC */
53+
{A3, GET_PIN(A,6), "adc1", 6}, /* ADC */
54+
{A4, GET_PIN(A,7), "adc1", 7}, /* ADC */
55+
{A5, RT_NULL, "adc1", 17}, /* ADC, On-Chip: internal reference voltage, ADC_CHANNEL_VREFINT */
56+
{A6, RT_NULL, "adc1", 16} /* ADC, On-Chip: internal temperature sensor, ADC_CHANNEL_TEMPSENSOR */
4457
};

bsp/stm32/stm32f103-blue-pill/applications/arduino_pinout/pins_arduino.h

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,26 @@
2626
#define D11 (11)
2727
#define D12 (12)
2828
#define D13 (13)
29-
#define A0 (14)
30-
#define A1 (15)
31-
#define A2 (16)
32-
#define A3 (17)
33-
#define A4 (18)
34-
#define A5 (19)
35-
#define A6 (20)
29+
#define D14 (14)
30+
#define D15 (15)
31+
#define D16 (16)
32+
#define D17 (17)
33+
#define D18 (18)
34+
#define D19 (19)
35+
#define D20 (20)
36+
#define D21 (21)
37+
#define D22 (22)
38+
#define D23 (23)
39+
#define D24 (24)
40+
#define D25 (25)
41+
#define D26 (26)
42+
#define A0 (27)
43+
#define A1 (28)
44+
#define A2 (29)
45+
#define A3 (30)
46+
#define A4 (31)
47+
#define A5 (32)
48+
#define A6 (33)
3649

3750
#define F_CPU 72000000L /* CPU: 72MHz */
3851
#define LED_BUILTIN D8 /* Default Built-in LED */
@@ -52,6 +65,7 @@
5265
/*
5366
* spi2 - PB13-SCK PB14-MISO PB15-MOSI
5467
*/
68+
#define SS D7 /* Chip select pin of default spi */
5569
#define RTDUINO_DEFAULT_SPI_BUS_NAME "spi2"
5670

5771
#endif /* Pins_Arduino_h */

0 commit comments

Comments
 (0)