4
0
mirror of https://github.com/RT-Thread/rt-thread.git synced 2025-02-21 01:07:18 +08:00

[RTduino]stm32f401-st-nucleo 更新对接文件

This commit is contained in:
liyangyang 2022-09-18 21:57:41 +08:00 committed by Man, Jianting (Meco)
parent 60d6e42941
commit dc6b9fde98
4 changed files with 89 additions and 87 deletions

View File

@ -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接管 |
> 注意:
>

View File

@ -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 | 是 | I2C1-SDA被RT-Thread的I2C设备框架i2c1总线接管不可当做普通IO |
| 15 (D15) | PB8 | 是 | I2C1_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 | 是 | PWM2-CH2默认被RT-Thread的PWM设备框架pwm2接管 |
| 4 (D4) | PB5 | 是 | |
| 5 (D5) | PB4 | 是 | PWM3-CH1默认被RT-Thread的PWM设备框架pwm3接管 |
| 6 (D6) | PB10 | 是 | PWM2-CH3默认被RT-Thread的PWM设备框架pwm2接管 |
| 7 (D7) | PA8 | 是 | |
| 8 (D8) | PA9 | 是 | |
| 9 (D9) | PC7 | 是 | PWM3-CH2默认被RT-Thread的PWM设备框架pwm3接管 |
| 10 (D10) | PB6 | 是 | PWM4-CH1默认被RT-Thread的PWM设备框架pwm4接管 |
| 11 (D11) | PA7 | 是 | PWM1-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 | 是 | ADC1-CH0默认被RT-Thread的ADC设备框架adc1接管 |
| A1 | PA1 | 是 | ADC1-CH1默认被RT-Thread的ADC设备框架adc1接管 |
| A2 | PA4 | 是 | ADC1-CH4默认被RT-Thread的ADC设备框架adc1接管 |
| A3 | PB0 | 是 | ADC1-CH8默认被RT-Thread的ADC设备框架adc1接管 |
| A4 | PC1 | 是 | ADC1-CH11默认被RT-Thread的ADC设备框架adc1接管 |
| A5 | PC0 | 是 | ADC1-CH10默认被RT-Thread的ADC设备框架adc1接管 |
| A6 | -- | | 芯片内部参考电压 ADC默认被RT-Thread的ADC设备框架adc1接管 |
| A7 | -- | | 芯片内部温度 ADC默认被RT-Thread的ADC设备框架adc1接管 |
> 注意:
>

View File

@ -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 */
};

View File

@ -1,46 +1,48 @@
/*
* Copyright (c) 2006-2021, RT-Thread Development Team
* Copyright (c) 2006-2022, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2022-04-19 Meco Man first version
* 2022-09-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 */