[arduino] use perf_counter to instead of hwtimer (#6089)
移除硬件定时器依赖 取消stm32f401 spi的支持 更换f401 arduino默认例程
This commit is contained in:
parent
1c81a6d220
commit
70bd55fea5
|
@ -10,17 +10,14 @@
|
||||||
|
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
|
|
||||||
uint8_t led = LED_BUILTIN;
|
|
||||||
|
|
||||||
void setup(void)
|
void setup(void)
|
||||||
{
|
{
|
||||||
/* put your setup code here, to run once: */
|
/* put your setup code here, to run once: */
|
||||||
pinMode(led, OUTPUT);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void loop(void)
|
void loop(void)
|
||||||
{
|
{
|
||||||
/* put your main code here, to run repeatedly: */
|
/* put your main code here, to run repeatedly: */
|
||||||
digitalWrite(led, !digitalRead(led));
|
Serial.println("Hello Arduino!\n");
|
||||||
delay(100);
|
delay(800);
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,6 +42,5 @@
|
||||||
#define LED_BUILTIN D13 /* Default Built-in LED */
|
#define LED_BUILTIN D13 /* Default Built-in LED */
|
||||||
|
|
||||||
#define RTDUINO_DEFAULT_IIC_BUS_NAME "i2c1"
|
#define RTDUINO_DEFAULT_IIC_BUS_NAME "i2c1"
|
||||||
#define RTDUINO_DEFAULT_HWTIMER_DEVICE_NAME "timer7"
|
|
||||||
|
|
||||||
#endif /* Pins_Arduino_h */
|
#endif /* Pins_Arduino_h */
|
||||||
|
|
|
@ -19,8 +19,6 @@ menu "Onboard Peripheral Drivers"
|
||||||
select PKG_USING_RTDUINO
|
select PKG_USING_RTDUINO
|
||||||
select BSP_USING_STLINK_TO_USART
|
select BSP_USING_STLINK_TO_USART
|
||||||
select BSP_USING_GPIO
|
select BSP_USING_GPIO
|
||||||
select BSP_USING_TIM
|
|
||||||
select BSP_USING_TIM7
|
|
||||||
select BSP_USING_ADC
|
select BSP_USING_ADC
|
||||||
select BSP_USING_ADC1
|
select BSP_USING_ADC1
|
||||||
select BSP_USING_PWM
|
select BSP_USING_PWM
|
||||||
|
|
|
@ -32,10 +32,10 @@ Hardware Drivers Config --->
|
||||||
| 7 (D7) | PA8 | 是 | |
|
| 7 (D7) | PA8 | 是 | |
|
||||||
| 8 (D8) | PA9 | 是 | |
|
| 8 (D8) | PA9 | 是 | |
|
||||||
| 9 (D9) | PC7 | 是 | PWM(定时器3发生) |
|
| 9 (D9) | PC7 | 是 | PWM(定时器3发生) |
|
||||||
| 10 (D10) | PB6 | 是 | SPI1-CS,被RT-Thread的SPI设备框架spi1总线接管,不可当做普通IO |
|
| 10 (D10) | PB6 | 是 | |
|
||||||
| 11 (D11) | PA7 | 是 | SPI1-MOSI,被RT-Thread的SPI设备框架spi1总线接管,不可当做普通IO |
|
| 11 (D11) | PA7 | 是 | |
|
||||||
| 12 (D12) | PA6 | 是 | SPI1-MISO,被RT-Thread的SPI设备框架spi1总线接管,不可当做普通IO |
|
| 12 (D12) | PA6 | 是 | |
|
||||||
| 13 (D13) | PA5 | 是 | SPI1-SCK,被RT-Thread的SPI设备框架spi1总线接管,不可当做普通IO |
|
| 13 (D13) | PA5 | 是 | |
|
||||||
| 14 (D14) | PB9 | 是 | I2C1-SDA,被RT-Thread的I2C设备框架i2c1总线接管,不可当做普通IO |
|
| 14 (D14) | PB9 | 是 | I2C1-SDA,被RT-Thread的I2C设备框架i2c1总线接管,不可当做普通IO |
|
||||||
| 15 (D15) | PB8 | 是 | I2C1_SCL,被RT-Thread的I2C设备框架i2c1总线接管,不可当做普通IO |
|
| 15 (D15) | PB8 | 是 | I2C1_SCL,被RT-Thread的I2C设备框架i2c1总线接管,不可当做普通IO |
|
||||||
| 16 (D16) | PC13 | 是 | Nucleo板载用户按键(左侧蓝色) |
|
| 16 (D16) | PC13 | 是 | Nucleo板载用户按键(左侧蓝色) |
|
||||||
|
@ -61,8 +61,3 @@ Hardware Drivers Config --->
|
||||||
## 3 I2C总线
|
## 3 I2C总线
|
||||||
|
|
||||||
STM32F401 Nucleo板的I2C总线是板上丝印的 `SCL/D15` 和 `SDA/D14` 引脚,这两个引脚是被RT-Thread I2C设备框架接管的,不需要直接操控这两个引脚,直接引用`#include <Wire.h>`(Arduino官方I2C头文件)即可使用。
|
STM32F401 Nucleo板的I2C总线是板上丝印的 `SCL/D15` 和 `SDA/D14` 引脚,这两个引脚是被RT-Thread I2C设备框架接管的,不需要直接操控这两个引脚,直接引用`#include <Wire.h>`(Arduino官方I2C头文件)即可使用。
|
||||||
|
|
||||||
## 4 SPI总线
|
|
||||||
|
|
||||||
STM32F401 Nucleo板的SPI总线是板上丝印的 `SCK/D13`、`MISO/D12`、`MOSI/D11`引脚,这3个引脚是被RT-Thread SPI设备框架接管的,不需要直接操控这3个引脚,直接引用`#include <SPI.h>`(Arduino官方SPI头文件)即可使用。按照Arduino的编程标准,用户需要自行控制片选信号。
|
|
||||||
|
|
||||||
|
|
|
@ -30,10 +30,10 @@ const pin_map_t pin_map_table[]=
|
||||||
{D7, GET_PIN(A,8)},
|
{D7, GET_PIN(A,8)},
|
||||||
{D8, GET_PIN(A,9)},
|
{D8, GET_PIN(A,9)},
|
||||||
{D9, GET_PIN(C,7), "pwm3", 2}, /* PWM */
|
{D9, GET_PIN(C,7), "pwm3", 2}, /* PWM */
|
||||||
{D10}, /* SPI1-CS */
|
{D10, GET_PIN(B,6)},
|
||||||
{D11}, /* SPI1-MOSI */
|
{D11, GET_PIN(A,7)},
|
||||||
{D12}, /* SPI1-MISO */
|
{D12, GET_PIN(A,6)},
|
||||||
{D13}, /* SPI1-SCK */
|
{D13, GET_PIN(A,5)},
|
||||||
{D14}, /* I2C1-SDA */
|
{D14}, /* I2C1-SDA */
|
||||||
{D15}, /* I2C1-SCL */
|
{D15}, /* I2C1-SCL */
|
||||||
{D16, GET_PIN(C,13)}, /* user button */
|
{D16, GET_PIN(C,13)}, /* user button */
|
||||||
|
|
|
@ -42,7 +42,5 @@
|
||||||
#define LED_BUILTIN D13 /* Default Built-in LED */
|
#define LED_BUILTIN D13 /* Default Built-in LED */
|
||||||
|
|
||||||
#define RTDUINO_DEFAULT_IIC_BUS_NAME "i2c1"
|
#define RTDUINO_DEFAULT_IIC_BUS_NAME "i2c1"
|
||||||
#define RTDUINO_DEFAULT_SPI_BUS_NAME "spi1"
|
|
||||||
#define RTDUINO_DEFAULT_HWTIMER_DEVICE_NAME "timer11"
|
|
||||||
|
|
||||||
#endif /* Pins_Arduino_h */
|
#endif /* Pins_Arduino_h */
|
||||||
|
|
|
@ -19,8 +19,6 @@ menu "Onboard Peripheral Drivers"
|
||||||
select PKG_USING_RTDUINO
|
select PKG_USING_RTDUINO
|
||||||
select BSP_USING_STLINK_TO_USART
|
select BSP_USING_STLINK_TO_USART
|
||||||
select BSP_USING_GPIO
|
select BSP_USING_GPIO
|
||||||
select BSP_USING_TIM
|
|
||||||
select BSP_USING_TIM11
|
|
||||||
select BSP_USING_ADC
|
select BSP_USING_ADC
|
||||||
select BSP_USING_ADC1
|
select BSP_USING_ADC1
|
||||||
select BSP_USING_PWM
|
select BSP_USING_PWM
|
||||||
|
@ -32,11 +30,8 @@ menu "Onboard Peripheral Drivers"
|
||||||
select BSP_USING_PWM3_CH2
|
select BSP_USING_PWM3_CH2
|
||||||
select BSP_USING_I2C
|
select BSP_USING_I2C
|
||||||
select BSP_USING_I2C1
|
select BSP_USING_I2C1
|
||||||
select BSP_USING_SPI
|
|
||||||
select BSP_USING_SPI1
|
|
||||||
imply RTDUINO_USING_SERVO
|
imply RTDUINO_USING_SERVO
|
||||||
imply RTDUINO_USING_WIRE
|
imply RTDUINO_USING_WIRE
|
||||||
imply RTDUINO_USING_SPI
|
|
||||||
imply RTDUINO_USING_ADAFRUIT
|
imply RTDUINO_USING_ADAFRUIT
|
||||||
imply RTDUINO_USING_MSTIMER2
|
imply RTDUINO_USING_MSTIMER2
|
||||||
default n
|
default n
|
||||||
|
|
Loading…
Reference in New Issue