[arduino] use perf_counter to instead of hwtimer (#6089)

移除硬件定时器依赖
取消stm32f401 spi的支持
更换f401 arduino默认例程
This commit is contained in:
Man, Jianting (Meco) 2022-06-17 02:29:44 -04:00 committed by GitHub
parent 1c81a6d220
commit 70bd55fea5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 10 additions and 28 deletions

View File

@ -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);
} }

View File

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

View File

@ -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

View File

@ -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的编程标准用户需要自行控制片选信号。

View File

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

View File

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

View File

@ -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