[rtduino][lpc55s69] 修正RTduino框架下的引脚错误 (#6963)
1.修正RTduino框架下的引脚错误 2.Kconfig新增RTduino依赖项 3.README文档完善 4.上传LPC55s69兼容arduino部分引脚图
This commit is contained in:
parent
96a636f0b5
commit
08c2a65136
|
@ -6,27 +6,20 @@
|
|||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2023-02-22 ChuShicheng first version
|
||||
* 2023-02-23 Wangyuqiang second version
|
||||
*/
|
||||
|
||||
#include <Arduino.h>
|
||||
|
||||
int led = 37; /* LED pin */
|
||||
int brightness = 0;
|
||||
int fadeAmount = 5;
|
||||
|
||||
void setup()
|
||||
void setup(void)
|
||||
{
|
||||
/* Do not invoke pinMode for the PWM IO! */
|
||||
/* put your setup code here, to run once: */
|
||||
Serial.begin();
|
||||
}
|
||||
|
||||
void loop()
|
||||
void loop(void)
|
||||
{
|
||||
analogWrite(led, brightness);
|
||||
brightness = brightness + fadeAmount;
|
||||
if (brightness <= 0 || brightness >= 255)
|
||||
{
|
||||
fadeAmount = -fadeAmount;
|
||||
}
|
||||
|
||||
delay(100);
|
||||
/* put your main code here, to run repeatedly: */
|
||||
Serial.println("Hello Arduino!");
|
||||
delay(800);
|
||||
}
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 914 KiB |
Binary file not shown.
After Width: | Height: | Size: 969 KiB |
|
@ -1,8 +1,8 @@
|
|||
# lpc55s69_nxp_evk开发板的Arduino生态兼容说明
|
||||
# LPC55s69-nxp-evk开发板的Arduino生态兼容说明
|
||||
|
||||
## 1 RTduino - RT-Thread的Arduino生态兼容层
|
||||
|
||||
lpc55s69_nxp_evk开发板已经完整适配了[RTduino软件包](https://github.com/RTduino/RTduino),即RT-Thread的Arduino生态兼容层。用户可以按照Arduino的编程习惯来操作该BSP,并且可以使用大量Arduino社区丰富的库,是对RT-Thread生态的极大增强。更多信息,请参见[RTduino软件包说明文档](https://github.com/RTduino/RTduino)。
|
||||
LPC55s69-nxp-evk开发板已经完整适配了[RTduino软件包](https://github.com/RTduino/RTduino),即RT-Thread的Arduino生态兼容层。用户可以按照Arduino的编程习惯来操作该BSP,并且可以使用大量Arduino社区丰富的库,是对RT-Thread生态的极大增强。更多信息,请参见[RTduino软件包说明文档](https://github.com/RTduino/RTduino)。
|
||||
|
||||
### 1.1 如何开启针对本BSP的Arduino生态兼容层
|
||||
|
||||
|
@ -18,27 +18,38 @@ Hardware Drivers Config --->
|
|||
|
||||
更多引脚布局相关信息参见 [pins_arduino.c](pins_arduino.c) 和 [pins_arduino.h](pins_arduino.h)。
|
||||
|
||||
![LPC55s69-nxp-evk-pinout1](LPC55s69-nxp-evk-pinout1.png)
|
||||
|
||||
![LPC55s69-nxp-evk-pinout2](LPC55s69-nxp-evk-pinout2.png)
|
||||
|
||||
| Arduino引脚编号 | STM32引脚编号 | 5V容忍 | 备注 |
|
||||
| ------------------- | --------- | ---- | ------------------------------------------------------------------------- |
|
||||
| 0 (D0) | P | 是/否 | |
|
||||
| 1 (D1) | P | 是/否 | PWM1-CH3,默认被RT-Thread的PWM设备框架pwm1接管 |
|
||||
| 2 (D2) | P | 是/否 | Serial-RX,默认被RT-Thread的UART设备框架uart1接管 |
|
||||
| 3 (D3) | P | 是/否 | Serial-TX,默认被RT-Thread的UART设备框架uart1接管 |
|
||||
| 4 (D4) | P | 是/否 | PWM2-CH1,默认被RT-Thread的PWM设备框架pwm2接管 |
|
||||
| 5 (D5) | P | 是/否 | PWM2-CH2,默认被RT-Thread的PWM设备框架pwm2接管 |
|
||||
| 6 (D6) | P | 是/否 | 板载用户LED |
|
||||
| 7 (D7) | P | 是/否 | PWM1-CH0,默认被RT-Thread的PWM设备框架pwm1接管 |
|
||||
| 8 (D8) | P | 是/否 | |
|
||||
| 9 (D9) | P | 是/否 | PWM2-CH0,默认被RT-Thread的PWM设备框架pwm2接管 |
|
||||
| 10 (D10) | P | 是/否 | |
|
||||
| 11 (D11) | P | 是/否 | |
|
||||
| 12 (D12) | P | 是/否 | |
|
||||
| 13 (D13) | P | 是/否 | |
|
||||
| 14 (D14) | P | 是/否 | PWM3-CH2,默认被RT-Thread的PWM设备框架pwm3接管 |
|
||||
| 15 (D15) | P | 是/否 | |
|
||||
| 16 (D16) | P | 是/否 | I2C1-SCL,默认被RT-Thread的I2C设备框架i2c1接管 |
|
||||
| 17 (D17) | P | 是/否 | I2C1-SDA,默认被RT-Thread的I2C设备框架i2c1接管 |
|
||||
| 18 (A0) | P | 是/否 | ADC0-CH8,默认被RT-Thread的ADC设备框架adc0接管 |
|
||||
| 19 (A1) | P | 是/否 | ADC0-CH0,默认被RT-Thread的ADC设备框架adc0接管 |
|
||||
| 20 (A2) | -- | | 芯片内部温度 ADC,默认被RT-Thread的ADC设备框架adc1接管 |
|
||||
| 21 (A3) | -- | | 芯片内部参考电压 ADC,默认被RT-Thread的ADC设备框架adc1接管 |
|
||||
| 0 (D0) | P(1,24) | 是/否 | Serial2-RX,默认被RT-Thread的UART设备框架uart1接管 |
|
||||
| 1 (D1) | P(0,27) | 是/否 | Serial2-TX,默认被RT-Thread的UART设备框架uart1接管 |
|
||||
| 2 (D2) | P(0,15) | 是/否 | |
|
||||
| 3 (D3) | P(1,6) | 是/否 | |
|
||||
| 4 (D4) | P(1,7) | 是/否 | PWM2-CH2,默认被RT-Thread的PWM设备框架pwm2接管 |
|
||||
| 5 (D5) | P(1,4) | 是/否 | PWM2-CH1,默认被RT-Thread的PWM设备框架pwm2接管 |
|
||||
| 6 (D6) | P(1,10) | 是/否 | |
|
||||
| 7 (D7) | P(1,9) | 是/否 | PWM1-CH0,默认被RT-Thread的PWM设备框架pwm1接管 |
|
||||
| 8 (D8) | P(1,8) | 是/否 | |
|
||||
| 9 (D9) | P(1,5) | 是/否 | |
|
||||
| 10 (D10) | P(1,1) | 是/否 | |
|
||||
| 11 (D11) | P(0,26) | 是/否 | |
|
||||
| 12 (D12) | P(1,3) | 是/否 | PWM0-CH3,默认被RT-Thread的PWM设备框架pwm0接管 |
|
||||
| 13 (D13) | P(1,2) | 是/否 | |
|
||||
| 14 (D14) | P(1,21) | 是/否 | I2C4-SDA,默认被RT-Thread的I2C设备框架i2c4接管 |
|
||||
| 15 (D15) | P(1,20) | 是/否 | I2C4-SCL,默认被RT-Thread的I2C设备框架i2c4接管 |
|
||||
| 16 (A0) | P(0,16) | 是/否 | ADC0-CH8,默认被RT-Thread的ADC设备框架adc0接管 |
|
||||
| 17 (A1) | P(0,23) | 是/否 | ADC0-CH0,默认被RT-Thread的ADC设备框架adc0接管 |
|
||||
| 18 (A2) | -- | 是/否 | |
|
||||
| 19 (A3) | P(1,31) | 是/否 | |
|
||||
| 20 (A4) | P(0,13) | 是/否 | I2C1-SDA,默认被RT-Thread的I2C设备框架i2c1接管 |
|
||||
| 21 (A5) | P(1,14) | 是/否 | I2C1-SCL,默认被RT-Thread的I2C设备框架i2c1接管 |
|
||||
| 22 (A6) | -- | | 芯片内部参考电压 ADC,默认被RT-Thread的ADC设备框架adc1接管 |
|
||||
| 23 (A7) | -- | | 芯片内部温度 ADC,默认被RT-Thread的ADC设备框架adc1接管 |
|
||||
|
||||
> 注意:
|
||||
>
|
||||
> 1. xxxxxxxxx
|
||||
> 2. xxxxxxxxx
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2023-02-22 ChuShicheng first version
|
||||
* 2023-02-23 Wangyuqiang second version
|
||||
*/
|
||||
|
||||
#include <Arduino.h>
|
||||
|
@ -21,26 +22,28 @@
|
|||
*/
|
||||
const pin_map_t pin_map_table[]=
|
||||
{
|
||||
{D0, 50},
|
||||
{D1, 49, "pwm1", 3}, /* PWM */
|
||||
{D2, 57, "uart1"}, /* Serial-RX */
|
||||
{D3, 28, "uart1"}, /* Serial-TX */
|
||||
{D4, 39, "pwm2", 1}, /* PWM */
|
||||
{D5, 40, "pwm2", 2}, /* PWM */
|
||||
{D6, 37}, /* LED_BUILTIN */
|
||||
{D7, 43, "pwm1", 0}, /* PWM */
|
||||
{D8, 41},
|
||||
{D9, 38, "pwm2", 0}, /* PWM */
|
||||
{D10, 34},
|
||||
{D11, 27},
|
||||
{D12, 36},
|
||||
{D13, 35},
|
||||
{D14, 54, "pwm3", 2}, /* PWM */
|
||||
{D15, 53},
|
||||
{D16, 15, "i2c1"}, /* I2C-SCL (Wire) */
|
||||
{D17, 14, "i2c1"}, /* I2C-SDA (Wire) */
|
||||
{A0, 17, "adc0", 8}, /* ADC */
|
||||
{A1, 24, "adc0", 0}, /* ADC */
|
||||
{A2, RT_NULL, "adc0", 26}, /* ADC, On-Chip: internal temperature sensor, ADC_CHANNEL_TEMPSENSOR */
|
||||
{A3, RT_NULL, "adc0", 13}, /* ADC, On-Chip: internal reference voltage, ADC_CHANNEL_VREFINT */
|
||||
{D0, GET_PINS(1,24), "uart1"}, /* Serial2-RX */
|
||||
{D1, GET_PINS(0,27), "uart1"}, /* Serial2-TX */
|
||||
{D2, GET_PINS(0,15)},
|
||||
{D3, GET_PINS(1,6)},
|
||||
{D4, GET_PINS(1,7), "pwm2", 2}, /* PWM */
|
||||
{D5, GET_PINS(1,4), "pwm2", 1}, /* PWM */
|
||||
{D6, GET_PINS(1,10)},
|
||||
{D7, GET_PINS(1,9), "pwm1", 0}, /* PWM */
|
||||
{D8, GET_PINS(1,8)},
|
||||
{D9, GET_PINS(1,5)},
|
||||
{D10, GET_PINS(1,1)},
|
||||
{D11, GET_PINS(0,26)},
|
||||
{D12, GET_PINS(1,3), "pwm0", 3}, /* PWM */
|
||||
{D13, GET_PINS(1,2)},
|
||||
{D14, GET_PINS(1,21), "i2c4"}, /* I2C-SDA (Wire) */
|
||||
{D15, GET_PINS(1,20), "i2c4"}, /* I2C-SCL (Wire) */
|
||||
{A0, GET_PINS(0,16), "adc0", 8}, /* ADC */
|
||||
{A1, GET_PINS(0,23), "adc0", 0}, /* ADC */
|
||||
{A2, RT_NULL},
|
||||
{A3, GET_PINS(1,31)},
|
||||
{A4, GET_PINS(0,13), "i2c1"}, /* I2C-SDA (Wire) */
|
||||
{A5, GET_PINS(1,14), "i2c1"}, /* I2C-SCL (Wire) */
|
||||
{A6, RT_NULL, "adc0", 13}, /* ADC, On-Chip: internal reference voltage, ADC_CHANNEL_VREFINT */
|
||||
{A7, RT_NULL, "adc0", 26}, /* ADC, On-Chip: internal temperature sensor, ADC_CHANNEL_TEMPSENSOR */
|
||||
};
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2023-02-22 ChuShicheng first version
|
||||
* 2023-02-23 Wangyuqiang second version
|
||||
*/
|
||||
|
||||
#ifndef Pins_Arduino_h
|
||||
|
@ -28,18 +29,21 @@
|
|||
#define D13 (13)
|
||||
#define D14 (14)
|
||||
#define D15 (15)
|
||||
#define D16 (16)
|
||||
#define D17 (17)
|
||||
#define A0 (18)
|
||||
#define A1 (19)
|
||||
#define A2 (20)
|
||||
#define A3 (21)
|
||||
#define A0 (16)
|
||||
#define A1 (17)
|
||||
#define A2 (18)
|
||||
#define A3 (19)
|
||||
#define A4 (20)
|
||||
#define A5 (21)
|
||||
#define A6 (22)
|
||||
#define A7 (23)
|
||||
|
||||
#define F_CPU 150000000L /* CPU:150MHz */
|
||||
|
||||
#define LED_BUILTIN D6 /* Default Built-in LED */
|
||||
|
||||
/* i2c1 : P-SDA P-SCL */
|
||||
/* i2c1 : P(,13-SDA P(,14-SCL */
|
||||
#define RTDUINO_DEFAULT_IIC_BUS_NAME "i2c1"
|
||||
|
||||
/* Serial2 : P(,27-TX P(,24-RX */
|
||||
#define RTDUINO_SERIAL2_DEVICE_NAME "uart1"
|
||||
|
||||
#endif /* Pins_Arduino_h */
|
||||
|
|
|
@ -42,6 +42,22 @@ menu "On-chip Peripheral Drivers"
|
|||
endchoice
|
||||
endif
|
||||
|
||||
config BSP_USING_UART1
|
||||
bool "Enable Flexcomm1 as UART"
|
||||
default n
|
||||
if BSP_USING_UART1
|
||||
choice
|
||||
prompt "Select UART2 badurate"
|
||||
default HW_UART1_BAUDRATE_115200
|
||||
|
||||
config HW_UART1_BAUDRATE_9600
|
||||
bool "Badurate 9600"
|
||||
|
||||
config HW_UART1_BAUDRATE_115200
|
||||
bool "Badurate 115200"
|
||||
endchoice
|
||||
endif
|
||||
|
||||
config BSP_USING_UART2
|
||||
bool "Enable Flexcomm2 as UART"
|
||||
default n
|
||||
|
@ -70,6 +86,7 @@ menu "On-chip Peripheral Drivers"
|
|||
config BSP_USING_I2C1
|
||||
bool "Enable Flexcomm1 I2C"
|
||||
default y
|
||||
|
||||
if BSP_USING_I2C1
|
||||
choice
|
||||
prompt "Select I2C1 badurate"
|
||||
|
@ -130,6 +147,21 @@ menu "On-chip Peripheral Drivers"
|
|||
config BSP_USING_ADC0_CH1
|
||||
bool "Enable ADC0 Channel1"
|
||||
default n
|
||||
|
||||
config BSP_USING_ADC0_CH8
|
||||
bool "Enable ADC0 Channel8"
|
||||
default n
|
||||
|
||||
|
||||
config BSP_USING_ADC0_CH13
|
||||
bool "Enable ADC0 Channel13"
|
||||
default n
|
||||
|
||||
|
||||
config BSP_USING_ADC0_CH26
|
||||
bool "Enable ADC0 Channel26"
|
||||
default n
|
||||
|
||||
endif
|
||||
|
||||
config BSP_USING_SDIO
|
||||
|
|
Loading…
Reference in New Issue