未验证 提交 c5208a7d 编写于 作者: G guo 提交者: GitHub

Merge pull request #5375 from mysterywolf/arduinol475

[l475][arduino] 增加ADC PWM管脚定义
from building import * from building import *
cwd = GetCurrentDir() cwd = GetCurrentDir()
src = ['arduino_layout.c'] src = ['arduino_pinout.c']
inc = [cwd] inc = [cwd]
group = DefineGroup('Arduino', src, depend = ['RT_USING_ARDUINO'], CPPPATH = inc) group = DefineGroup('Arduino', src, depend = ['RT_USING_ARDUINO'], CPPPATH = inc)
......
...@@ -9,8 +9,9 @@ ...@@ -9,8 +9,9 @@
*/ */
#include <Arduino.h> #include <Arduino.h>
#include <board.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]} {Arduino Pin, RT-Thread Pin [, Device Name(PWM or ADC), Channel]}
......
...@@ -7,15 +7,16 @@ ...@@ -7,15 +7,16 @@
* Date Author Notes * Date Author Notes
* 2021-12-10 Meco Man first version * 2021-12-10 Meco Man first version
*/ */
#ifndef __UNO_LAYOUT_H__ #ifndef __UNO_PINOUT_H__
#define __UNO_LAYOUT_H__ #define __UNO_PINOUT_H__
#include <rtconfig.h>
#define LED_BUILTIN 13 /* Built-in LED */ #define LED_BUILTIN 13 /* Built-in LED */
#define ARDUINO_PWM_HZ 500 /* Arduino UNO's PWM is around 500Hz */ #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 A0 (14)
#define A1 (15) #define A1 (15)
...@@ -23,7 +24,5 @@ ...@@ -23,7 +24,5 @@
#define A3 (17) #define A3 (17)
#define A4 (18) #define A4 (18)
#define A5 (19) #define A5 (19)
#define A6 (20)
#define A7 (21)
#endif #endif /* __UNO_PINOUT_H__ */
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册