Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
调味师
arduino-esp32
提交
29feaaa2
A
arduino-esp32
项目概览
调味师
/
arduino-esp32
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
arduino-esp32
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
29feaaa2
编写于
10月 26, 2016
作者:
M
me-no-dev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add some missing Arduino defines
上级
d7aed639
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
99 addition
and
53 deletion
+99
-53
cores/esp32/Arduino.h
cores/esp32/Arduino.h
+93
-8
variants/esp32/pins_arduino.h
variants/esp32/pins_arduino.h
+2
-15
variants/esp320/pins_arduino.h
variants/esp320/pins_arduino.h
+2
-15
variants/nano32/pins_arduino.h
variants/nano32/pins_arduino.h
+2
-15
未找到文件。
cores/esp32/Arduino.h
浏览文件 @
29feaaa2
...
...
@@ -24,12 +24,6 @@
extern
"C"
{
#endif
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/semphr.h"
#include "esp32-hal.h"
#include "pins_arduino.h"
#include <stdbool.h>
#include <stdint.h>
#include <stdarg.h>
...
...
@@ -39,15 +33,104 @@ extern "C" {
#include <string.h>
#include <inttypes.h>
typedef
bool
boolean
;
typedef
uint8_t
byte
;
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/semphr.h"
#include "esp32-hal.h"
#include "soc/gpio_reg.h"
#include "binary.h"
#define PI 3.1415926535897932384626433832795
#define HALF_PI 1.5707963267948966192313216916398
#define TWO_PI 6.283185307179586476925286766559
#define DEG_TO_RAD 0.017453292519943295769236907684886
#define RAD_TO_DEG 57.295779513082320876798154814105
#define EULER 2.718281828459045235360287471352
#define SERIAL 0x0
#define DISPLAY 0x1
#define LSBFIRST 0
#define MSBFIRST 1
//Interrupt Modes
#define RISING 0x01
#define FALLING 0x02
#define CHANGE 0x03
#define ONLOW 0x04
#define ONHIGH 0x05
#define ONLOW_WE 0x0C
#define ONHIGH_WE 0x0D
#define DEFAULT 1
#define EXTERNAL 0
#ifndef __STRINGIFY
#define __STRINGIFY(a) #a
#endif
// undefine stdlib's abs if encountered
#ifdef abs
#undef abs
#endif
#define abs(x) ((x)>0?(x):-(x))
#define constrain(amt,low,high) ((amt)<(low)?(low):((amt)>(high)?(high):(amt)))
#define round(x) ((x)>=0?(long)((x)+0.5):(long)((x)-0.5))
#define radians(deg) ((deg)*DEG_TO_RAD)
#define degrees(rad) ((rad)*RAD_TO_DEG)
#define sq(x) ((x)*(x))
#define sei()
#define cli()
#define interrupts() sei()
#define noInterrupts() cli()
#define clockCyclesPerMicrosecond() ( F_CPU / 1000000L )
#define clockCyclesToMicroseconds(a) ( (a) / clockCyclesPerMicrosecond() )
#define microsecondsToClockCycles(a) ( (a) * clockCyclesPerMicrosecond() )
#define lowByte(w) ((uint8_t) ((w) & 0xff))
#define highByte(w) ((uint8_t) ((w) >> 8))
#define bitRead(value, bit) (((value) >> (bit)) & 0x01)
#define bitSet(value, bit) ((value) |= (1UL << (bit)))
#define bitClear(value, bit) ((value) &= ~(1UL << (bit)))
#define bitWrite(value, bit, bitvalue) (bitvalue ? bitSet(value, bit) : bitClear(value, bit))
#define bit(b) (1UL << (b))
#define _BV(b) (1UL << (b))
#define digitalPinToPort(pin) (((pin)>31)?1:0)
#define digitalPinToBitMask(pin) (1UL << (pin))
#define digitalPinToTimer(pin) (0)
#define portOutputRegister(port) ((volatile uint32_t*)((port)?GPIO_OUT1_REG:GPIO_OUT_REG))
#define portInputRegister(port) ((volatile uint32_t*)((port)?GPIO_IN1_REG:GPIO_IN_REG))
#define portModeRegister(port) ((volatile uint32_t*)((port)?GPIO_ENABLE1_REG:GPIO_ENABLE_REG))
#define NOT_A_PIN -1
#define NOT_A_PORT -1
#define NOT_AN_INTERRUPT -1
#define NOT_ON_TIMER 0
typedef
bool
boolean
;
typedef
uint8_t
byte
;
typedef
unsigned
int
word
;
#ifdef __cplusplus
}
#endif
#ifndef _GLIBCXX_VECTOR
// arduino is not compatible with std::vector
#define min(a,b) ((a)<(b)?(a):(b))
#define max(a,b) ((a)>(b)?(a):(b))
#endif
#define _min(a,b) ((a)<(b)?(a):(b))
#define _max(a,b) ((a)>(b)?(a):(b))
#include "WCharacter.h"
#include "WString.h"
#include "Stream.h"
...
...
@@ -60,4 +143,6 @@ typedef uint8_t byte;
#include "HardwareSerial.h"
#include "Esp.h"
#include "pins_arduino.h"
#endif
/* _ESP32_CORE_ARDUINO_H_ */
variants/esp32/pins_arduino.h
浏览文件 @
29feaaa2
#ifndef Pins_Arduino_h
#define Pins_Arduino_h
#define digitalPinToPort(pin) (0)
#define digitalPinToBitMask(pin) (1UL << (pin))
#define digitalPinToTimer(pin) (0)
#define portOutputRegister(port)
#define portInputRegister(port)
#define portModeRegister(port)
#define NOT_A_PIN -1
#define NOT_A_PORT -1
#define NOT_AN_INTERRUPT -1
#define NOT_ON_TIMER 0
#define EXTERNAL_NUM_INTERRUPTS 16
#define NUM_DIGITAL_PINS 40
#define NUM_ANALOG_INPUTS 18
#define analogInputToDigitalPin(p)
#define digitalPinToInterrupt(p)
#define digitalPinHasPWM(p)
#define digitalPinToInterrupt(p)
(((p)<40)?(p):-1)
#define digitalPinHasPWM(p)
(p < 34)
static
const
uint8_t
SDA
=
21
;
static
const
uint8_t
SCL
=
22
;
...
...
variants/esp320/pins_arduino.h
浏览文件 @
29feaaa2
#ifndef Pins_Arduino_h
#define Pins_Arduino_h
#define digitalPinToPort(pin) (0)
#define digitalPinToBitMask(pin) (1UL << (pin))
#define digitalPinToTimer(pin) (0)
#define portOutputRegister(port)
#define portInputRegister(port)
#define portModeRegister(port)
#define NOT_A_PIN -1
#define NOT_A_PORT -1
#define NOT_AN_INTERRUPT -1
#define NOT_ON_TIMER 0
#define EXTERNAL_NUM_INTERRUPTS 11
#define NUM_DIGITAL_PINS 12
#define NUM_ANALOG_INPUTS 5
#define analogInputToDigitalPin(p)
#define digitalPinToInterrupt(p)
#define digitalPinHasPWM(p)
#define digitalPinToInterrupt(p)
(((p)<40)?(p):-1)
#define digitalPinHasPWM(p)
(p < 34)
static
const
uint8_t
SDA
=
2
;
static
const
uint8_t
SCL
=
14
;
...
...
variants/nano32/pins_arduino.h
浏览文件 @
29feaaa2
#ifndef Pins_Arduino_h
#define Pins_Arduino_h
#define digitalPinToPort(pin) (0)
#define digitalPinToBitMask(pin) (1UL << (pin))
#define digitalPinToTimer(pin) (0)
#define portOutputRegister(port)
#define portInputRegister(port)
#define portModeRegister(port)
#define NOT_A_PIN -1
#define NOT_A_PORT -1
#define NOT_AN_INTERRUPT -1
#define NOT_ON_TIMER 0
#define EXTERNAL_NUM_INTERRUPTS 16
#define NUM_DIGITAL_PINS 38
#define NUM_ANALOG_INPUTS 18
#define analogInputToDigitalPin(p)
#define digitalPinToInterrupt(p)
#define digitalPinHasPWM(p)
#define digitalPinToInterrupt(p)
(((p)<40)?(p):-1)
#define digitalPinHasPWM(p)
(p < 34)
#define LED_BUILTIN 16
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录