1
0
Эх сурвалжийг харах

[l475][arduino] 增加ADC PWM管脚定义

Meco Man 3 жил өмнө
parent
commit
7f9546ada0

+ 1 - 1
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)

+ 2 - 1
bsp/stm32/stm32l475-atk-pandora/board/ports/arduino/arduino_layout.c → bsp/stm32/stm32l475-atk-pandora/board/ports/arduino/arduino_pinout.c

@@ -9,8 +9,9 @@
  */
 #include <Arduino.h>
 #include <board.h>
+#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]}

+ 7 - 8
bsp/stm32/stm32l475-atk-pandora/board/ports/arduino/arduino_layout.h → 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 <rtconfig.h>
+#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__ */