diff --git a/bsp/stm32/stm32l475-atk-pandora/board/ports/arduino/SConscript b/bsp/stm32/stm32l475-atk-pandora/board/ports/arduino/SConscript index 69deb86a15..2c5b27d9d2 100644 --- a/bsp/stm32/stm32l475-atk-pandora/board/ports/arduino/SConscript +++ b/bsp/stm32/stm32l475-atk-pandora/board/ports/arduino/SConscript @@ -1,7 +1,7 @@ from building import * cwd = GetCurrentDir() -src = ['arduino_layout.c'] +src = ['arduino_pinout.c'] inc = [cwd] group = DefineGroup('Arduino', src, depend = ['RT_USING_ARDUINO'], CPPPATH = inc) diff --git a/bsp/stm32/stm32l475-atk-pandora/board/ports/arduino/arduino_layout.c b/bsp/stm32/stm32l475-atk-pandora/board/ports/arduino/arduino_pinout.c similarity index 94% rename from bsp/stm32/stm32l475-atk-pandora/board/ports/arduino/arduino_layout.c rename to bsp/stm32/stm32l475-atk-pandora/board/ports/arduino/arduino_pinout.c index dce9988127..bf9eb45c84 100644 --- a/bsp/stm32/stm32l475-atk-pandora/board/ports/arduino/arduino_layout.c +++ b/bsp/stm32/stm32l475-atk-pandora/board/ports/arduino/arduino_pinout.c @@ -9,8 +9,9 @@ */ #include #include +#include "arduino_pinout.h" -const pin_map_t pin_map_table[ARDUINO_LAYOUT_PIN_MAX]= +const pin_map_t pin_map_table[ARDUINO_PINOUT_PIN_MAX]= { /* {Arduino Pin, RT-Thread Pin [, Device Name(PWM or ADC), Channel]} diff --git a/bsp/stm32/stm32l475-atk-pandora/board/ports/arduino/arduino_layout.h b/bsp/stm32/stm32l475-atk-pandora/board/ports/arduino/arduino_pinout.h similarity index 59% rename from bsp/stm32/stm32l475-atk-pandora/board/ports/arduino/arduino_layout.h rename to bsp/stm32/stm32l475-atk-pandora/board/ports/arduino/arduino_pinout.h index f5a1b8f958..e3b7b8a47a 100644 --- a/bsp/stm32/stm32l475-atk-pandora/board/ports/arduino/arduino_layout.h +++ b/bsp/stm32/stm32l475-atk-pandora/board/ports/arduino/arduino_pinout.h @@ -7,15 +7,16 @@ * Date Author Notes * 2021-12-10 Meco Man first version */ -#ifndef __UNO_LAYOUT_H__ -#define __UNO_LAYOUT_H__ - -#include +#ifndef __UNO_PINOUT_H__ +#define __UNO_PINOUT_H__ #define LED_BUILTIN 13 /* Built-in LED */ #define ARDUINO_PWM_HZ 500 /* Arduino UNO's PWM is around 500Hz */ -#define ARDUINO_LAYOUT_PIN_MAX 20 + +#define ARDUINO_PINOUT_PIN_MAX 20 /* Arduino UNO has 20 pins in total*/ +#define ARDUINO_PINOUT_ADC_MAX 6 /* Arduino UNO has 5 ADC pins */ +#define ARDUINO_PINOUT_PWM_MAX 5 /* Arduino UNO has 5 PWM pins */ #define A0 (14) #define A1 (15) @@ -23,7 +24,5 @@ #define A3 (17) #define A4 (18) #define A5 (19) -#define A6 (20) -#define A7 (21) -#endif +#endif /* __UNO_PINOUT_H__ */