Skip to content

Commit c5208a7

Browse files
authored
Merge pull request #5375 from mysterywolf/arduinol475
[l475][arduino] 增加ADC PWM管脚定义
2 parents 9ab2ceb + 7f9546a commit c5208a7

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

bsp/stm32/stm32l475-atk-pandora/board/ports/arduino/SConscript

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from building import *
22

33
cwd = GetCurrentDir()
4-
src = ['arduino_layout.c']
4+
src = ['arduino_pinout.c']
55
inc = [cwd]
66

77
group = DefineGroup('Arduino', src, depend = ['RT_USING_ARDUINO'], CPPPATH = inc)

bsp/stm32/stm32l475-atk-pandora/board/ports/arduino/arduino_layout.c renamed to bsp/stm32/stm32l475-atk-pandora/board/ports/arduino/arduino_pinout.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99
*/
1010
#include <Arduino.h>
1111
#include <board.h>
12+
#include "arduino_pinout.h"
1213

13-
const pin_map_t pin_map_table[ARDUINO_LAYOUT_PIN_MAX]=
14+
const pin_map_t pin_map_table[ARDUINO_PINOUT_PIN_MAX]=
1415
{
1516
/*
1617
{Arduino Pin, RT-Thread Pin [, Device Name(PWM or ADC), Channel]}

bsp/stm32/stm32l475-atk-pandora/board/ports/arduino/arduino_layout.h renamed to bsp/stm32/stm32l475-atk-pandora/board/ports/arduino/arduino_pinout.h

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,22 @@
77
* Date Author Notes
88
* 2021-12-10 Meco Man first version
99
*/
10-
#ifndef __UNO_LAYOUT_H__
11-
#define __UNO_LAYOUT_H__
12-
13-
#include <rtconfig.h>
10+
#ifndef __UNO_PINOUT_H__
11+
#define __UNO_PINOUT_H__
1412

1513
#define LED_BUILTIN 13 /* Built-in LED */
1614

1715
#define ARDUINO_PWM_HZ 500 /* Arduino UNO's PWM is around 500Hz */
18-
#define ARDUINO_LAYOUT_PIN_MAX 20
16+
17+
#define ARDUINO_PINOUT_PIN_MAX 20 /* Arduino UNO has 20 pins in total*/
18+
#define ARDUINO_PINOUT_ADC_MAX 6 /* Arduino UNO has 5 ADC pins */
19+
#define ARDUINO_PINOUT_PWM_MAX 5 /* Arduino UNO has 5 PWM pins */
1920

2021
#define A0 (14)
2122
#define A1 (15)
2223
#define A2 (16)
2324
#define A3 (17)
2425
#define A4 (18)
2526
#define A5 (19)
26-
#define A6 (20)
27-
#define A7 (21)
2827

29-
#endif
28+
#endif /* __UNO_PINOUT_H__ */

0 commit comments

Comments
 (0)