From de9db808149da9c285c3c9f1f2de1348d9cc4f90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A4=9A=E4=BB=95=E6=88=90?= <1468559561@qq.com> Date: Fri, 30 Dec 2022 15:07:59 +0800 Subject: [PATCH] [rtduino] : fix arduino_pinout and README --- .../applications/arduino_pinout/README.md | 33 ++++--- .../arduino_pinout/pins_arduino.c | 11 ++- .../arduino_pinout/pins_arduino.h | 5 +- .../applications/arduino_pinout/README.md | 88 +++++++++---------- 4 files changed, 67 insertions(+), 70 deletions(-) diff --git a/bsp/stm32/stm32f407-robomaster-c/applications/arduino_pinout/README.md b/bsp/stm32/stm32f407-robomaster-c/applications/arduino_pinout/README.md index 83f0f393c2..b316883341 100644 --- a/bsp/stm32/stm32f407-robomaster-c/applications/arduino_pinout/README.md +++ b/bsp/stm32/stm32f407-robomaster-c/applications/arduino_pinout/README.md @@ -21,21 +21,20 @@ Hardware Drivers Config ---> ![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接管 | +| 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) | PF1 | 否 | I2C1-SCL,默认被RT-Thread的I2C设备框架i2c1接管 | +| 6 (D6) | PF0 | 否 | 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) | PC6 | 是 | PWM8-CH1,默认被RT-Thread的PWM设备框架pwm8接管 | +| 12 (D12) | PI6 | 是 | PWM8-CH2,默认被RT-Thread的PWM设备框架pwm8接管 | +| 13 (D13) | PI7 | 是 | PWM8-CH3,默认被RT-Thread的PWM设备框架pwm8接管 | +| 14 (A0) | -- | | 芯片内部温度 ADC,默认被RT-Thread的ADC设备框架adc1接管 | +| 15 (A1) | -- | | 芯片内部参考电压 ADC,默认被RT-Thread的ADC设备框架adc1接管 | diff --git a/bsp/stm32/stm32f407-robomaster-c/applications/arduino_pinout/pins_arduino.c b/bsp/stm32/stm32f407-robomaster-c/applications/arduino_pinout/pins_arduino.c index 52b57c6d8a..f77fdaa2a0 100644 --- a/bsp/stm32/stm32f407-robomaster-c/applications/arduino_pinout/pins_arduino.c +++ b/bsp/stm32/stm32f407-robomaster-c/applications/arduino_pinout/pins_arduino.c @@ -26,16 +26,15 @@ const pin_map_t pin_map_table[]= {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) */ + {D5, GET_PIN(F,1), "i2c1"}, /* I2C-SCL (Wire) */ + {D6, GET_PIN(F,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 */ + {D11, GET_PIN(C,6), "pwm8", 1}, /* PWM */ + {D12, GET_PIN(I,6), "pwm8", 2}, /* PWM */ + {D13, 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 */ }; diff --git a/bsp/stm32/stm32f407-robomaster-c/applications/arduino_pinout/pins_arduino.h b/bsp/stm32/stm32f407-robomaster-c/applications/arduino_pinout/pins_arduino.h index 4b0842fe86..731b7761c2 100644 --- a/bsp/stm32/stm32f407-robomaster-c/applications/arduino_pinout/pins_arduino.h +++ b/bsp/stm32/stm32f407-robomaster-c/applications/arduino_pinout/pins_arduino.h @@ -26,9 +26,8 @@ #define D11 (11) #define D12 (12) #define D13 (13) -#define D14 (14) -#define A0 (15) -#define A1 (16) +#define A0 (14) +#define A1 (15) #define F_CPU 168000000L /* CPU:168MHz */ diff --git a/bsp/stm32/stm32f427-robomaster-a/applications/arduino_pinout/README.md b/bsp/stm32/stm32f427-robomaster-a/applications/arduino_pinout/README.md index bf28bf720b..815fa32c3b 100644 --- a/bsp/stm32/stm32f427-robomaster-a/applications/arduino_pinout/README.md +++ b/bsp/stm32/stm32f427-robomaster-a/applications/arduino_pinout/README.md @@ -21,49 +21,49 @@ Hardware Drivers Config ---> ![xxx-pinout](xxx-pinout.jpg) | Arduino引脚编号 | STM32引脚编号 | 5V容忍 | 备注 | | ------------------- | --------- | ---- | ------------------------------------------------------------------------- | -| 0 (D0) | PF14 | 是/否 | 板载用户LED | -| 1 (D1) | PD9 | 是/否 | Serial-RX,默认被RT-Thread的UART设备框架uart3接管 | -| 2 (D2) | PD8 | 是/否 | Serial-TX,默认被RT-Thread的UART设备框架uart3接管 | -| 3 (D3) | PG9 | 是/否 | Serial-RX,默认被RT-Thread的UART设备框架uart6接管 | -| 4 (D4) | PG14 | 是/否 | Serial-TX,默认被RT-Thread的UART设备框架uart6接管 | -| 5 (D5) | PE0 | 是/否 | Serial-RX,默认被RT-Thread的UART设备框架uart8接管 | -| 6 (D6) | PE1 | 是/否 | Serial-TX,默认被RT-Thread的UART设备框架uart8接管 | -| 7 (D7) | PE7 | 是/否 | Serial-RX,默认被RT-Thread的UART设备框架uart7接管 | -| 8 (D8) | PE8 | 是/否 | Serial-TX,默认被RT-Thread的UART设备框架uart7接管 | -| 9 (D9) | PH6 | 是/否 | 板载蜂鸣器,PWM12-CH1,默认被RT-Thread的PWM设备框架pwm12接管 | -| 10 (D10) | PD12 | 是/否 | PWM4-CH1,默认被RT-Thread的PWM设备框架pwm4接管 | -| 11 (D11) | PD13 | 是/否 | PWM4-CH2,默认被RT-Thread的PWM设备框架pwm4接管 | -| 12 (D12) | PD14 | 是/否 | PWM4-CH3,默认被RT-Thread的PWM设备框架pwm4接管 | -| 13 (D13) | PD15 | 是/否 | PWM4-CH4,默认被RT-Thread的PWM设备框架pwm4接管 | -| 14 (D14) | PH10 | 是/否 | PWM5-CH1,默认被RT-Thread的PWM设备框架pwm5接管 | -| 15 (D15) | PH11 | 是/否 | PWM5-CH2,默认被RT-Thread的PWM设备框架pwm5接管 | -| 16 (D16) | PH12 | 是/否 | PWM5-CH3,默认被RT-Thread的PWM设备框架pwm5接管 | -| 17 (D17) | PI0 | 是/否 | PWM5-CH4,默认被RT-Thread的PWM设备框架pwm5接管 | -| 18 (D18) | PA0 | 是/否 | PWM2-CH1,默认被RT-Thread的PWM设备框架pwm2接管 | -| 19 (D19) | PA1 | 是/否 | PWM2-CH2,默认被RT-Thread的PWM设备框架pwm2接管 | -| 20 (D20) | PA2 | 是/否 | PWM2-CH3,默认被RT-Thread的PWM设备框架pwm2接管 | -| 21 (D21) | PA3 | 是/否 | PWM2-CH4,默认被RT-Thread的PWM设备框架pwm2接管 | -| 22 (D22) | PI5 | 是/否 | PWM8-CH1,默认被RT-Thread的PWM设备框架pwm8接管 | -| 23 (D23) | PI6 | 是/否 | PWM8-CH2,默认被RT-Thread的PWM设备框架pwm8接管 | -| 24 (D24) | PI7 | 是/否 | PWM8-CH3,默认被RT-Thread的PWM设备框架pwm8接管 | -| 25 (D25) | PI2 | 是/否 | PWM8-CH4,默认被RT-Thread的PWM设备框架pwm8接管 | -| 26 (D26) | PF1 | 是/否 | | -| 27 (D27) | PF0 | 是/否 | | -| 28 (D28) | PE4 | 是/否 | I2C1-SCL,默认被RT-Thread的I2C设备框架i2c1接管 | -| 29 (D29) | PE5 | 是/否 | I2C1-SDA,默认被RT-Thread的I2C设备框架i2c1接管 | -| 30 (D30) | PE6 | 是/否 | | -| 31 (D31) | PE12 | 是/否 | | -| 32 (D32) | PC2 | 是/否 | | -| 33 (D33) | PB0 | 是/否 | | -| 34 (D34) | PC3 | 是/否 | | -| 35 (D35) | PB1 | 是/否 | | -| 36 (D36) | PC4 | 是/否 | | -| 37 (D37) | PC0 | 是/否 | | -| 38 (D38) | PC5 | 是/否 | | -| 39 (D39) | PC1 | 是/否 | | -| 40 (D40) | PA5 | 是/否 | | -| 41 (D41) | PA4 | 是/否 | | -| 42 (D42) | PF10 | 是/否 | | -| 43 (D43) | PI9 | 是/否 | | +| 0 (D0) | PF14 | 是 | 板载用户LED | +| 1 (D1) | PD9 | 是 | Serial-RX,默认被RT-Thread的UART设备框架uart3接管 | +| 2 (D2) | PD8 | 是 | Serial-TX,默认被RT-Thread的UART设备框架uart3接管 | +| 3 (D3) | PG9 | 是 | Serial-RX,默认被RT-Thread的UART设备框架uart6接管 | +| 4 (D4) | PG14 | 是 | Serial-TX,默认被RT-Thread的UART设备框架uart6接管 | +| 5 (D5) | PE0 | 是 | Serial-RX,默认被RT-Thread的UART设备框架uart8接管 | +| 6 (D6) | PE1 | 是 | Serial-TX,默认被RT-Thread的UART设备框架uart8接管 | +| 7 (D7) | PE7 | 是 | Serial-RX,默认被RT-Thread的UART设备框架uart7接管 | +| 8 (D8) | PE8 | 是 | Serial-TX,默认被RT-Thread的UART设备框架uart7接管 | +| 9 (D9) | PH6 | 是 | 板载蜂鸣器,PWM12-CH1,默认被RT-Thread的PWM设备框架pwm12接管 | +| 10 (D10) | PD12 | 是 | PWM4-CH1,默认被RT-Thread的PWM设备框架pwm4接管 | +| 11 (D11) | PD13 | 是 | PWM4-CH2,默认被RT-Thread的PWM设备框架pwm4接管 | +| 12 (D12) | PD14 | 是 | PWM4-CH3,默认被RT-Thread的PWM设备框架pwm4接管 | +| 13 (D13) | PD15 | 是 | PWM4-CH4,默认被RT-Thread的PWM设备框架pwm4接管 | +| 14 (D14) | PH10 | 是 | PWM5-CH1,默认被RT-Thread的PWM设备框架pwm5接管 | +| 15 (D15) | PH11 | 是 | PWM5-CH2,默认被RT-Thread的PWM设备框架pwm5接管 | +| 16 (D16) | PH12 | 是 | PWM5-CH3,默认被RT-Thread的PWM设备框架pwm5接管 | +| 17 (D17) | PI0 | 是 | PWM5-CH4,默认被RT-Thread的PWM设备框架pwm5接管 | +| 18 (D18) | PA0 | 是 | PWM2-CH1,默认被RT-Thread的PWM设备框架pwm2接管 | +| 19 (D19) | PA1 | 是 | PWM2-CH2,默认被RT-Thread的PWM设备框架pwm2接管 | +| 20 (D20) | PA2 | 是 | PWM2-CH3,默认被RT-Thread的PWM设备框架pwm2接管 | +| 21 (D21) | PA3 | 是 | PWM2-CH4,默认被RT-Thread的PWM设备框架pwm2接管 | +| 22 (D22) | PI5 | 是 | PWM8-CH1,默认被RT-Thread的PWM设备框架pwm8接管 | +| 23 (D23) | PI6 | 是 | PWM8-CH2,默认被RT-Thread的PWM设备框架pwm8接管 | +| 24 (D24) | PI7 | 是 | PWM8-CH3,默认被RT-Thread的PWM设备框架pwm8接管 | +| 25 (D25) | PI2 | 是 | PWM8-CH4,默认被RT-Thread的PWM设备框架pwm8接管 | +| 26 (D26) | PF1 | 是 | | +| 27 (D27) | PF0 | 是 | | +| 28 (D28) | PE4 | 是 | I2C1-SCL,默认被RT-Thread的I2C设备框架i2c1接管 | +| 29 (D29) | PE5 | 是 | I2C1-SDA,默认被RT-Thread的I2C设备框架i2c1接管 | +| 30 (D30) | PE6 | 是 | | +| 31 (D31) | PE12 | 是 | | +| 32 (D32) | PC2 | 是 | | +| 33 (D33) | PB0 | 是 | | +| 34 (D34) | PC3 | 是 | | +| 35 (D35) | PB1 | 是 | | +| 36 (D36) | PC4 | 是 | | +| 37 (D37) | PC0 | 是 | | +| 38 (D38) | PC5 | 是 | | +| 39 (D39) | PC1 | 是 | | +| 40 (D40) | PA5 | 否 | | +| 41 (D41) | PA4 | 否 | | +| 42 (D42) | PF10 | 是 | | +| 43 (D43) | PI9 | 是 | | | 44 (A0) | -- | | 芯片内部温度 ADC,默认被RT-Thread的ADC设备框架adc1接管 | | 45 (A1) | -- | | 芯片内部参考电压 ADC,默认被RT-Thread的ADC设备框架adc1接管 |