Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
... -..- -.--
arduino-esp32
提交
7eec41dc
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,发现更多精彩内容 >>
未验证
提交
7eec41dc
编写于
2月 05, 2022
作者:
R
Rodrigo Garcia
提交者:
GitHub
2月 05, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fixes Touch Sensor for ESP32-S3 and any future SoC (#6234)
* Fixes digitalPinToTouchChannel() for ESP32-S3
上级
9dbc9087
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
28 addition
and
1 deletion
+28
-1
cores/esp32/esp32-hal-gpio.c
cores/esp32/esp32-hal-gpio.c
+26
-0
cores/esp32/esp32-hal-gpio.h
cores/esp32/esp32-hal-gpio.h
+2
-1
未找到文件。
cores/esp32/esp32-hal-gpio.c
浏览文件 @
7eec41dc
...
...
@@ -52,6 +52,32 @@
#include "esp_intr.h"
#endif
#include "soc/soc_caps.h"
// It fixes lack of pin definition for S3 and for any future SoC
// this function works for ESP32, ESP32-S2 and ESP32-S3 - including the C3, it will return -1 for any pin
#if SOC_TOUCH_SENSOR_NUM > 0
#include "soc/touch_sensor_periph.h"
int8_t
digitalPinToTouchChannel
(
uint8_t
pin
)
{
int8_t
ret
=
-
1
;
if
(
pin
<
SOC_GPIO_PIN_COUNT
)
{
for
(
uint8_t
i
=
0
;
i
<
SOC_TOUCH_SENSOR_NUM
;
i
++
)
{
if
(
touch_sensor_channel_io_map
[
i
]
==
pin
)
{
ret
=
i
;
break
;
}
}
}
return
ret
;
}
#else
// No Touch Sensor available
int8_t
digitalPinToTouchChannel
(
uint8_t
pin
)
{
return
-
1
;
}
#endif
#if CONFIG_IDF_TARGET_ESP32
const
int8_t
esp32_adc2gpio
[
20
]
=
{
36
,
37
,
38
,
39
,
32
,
33
,
34
,
35
,
-
1
,
-
1
,
4
,
0
,
2
,
15
,
13
,
12
,
14
,
27
,
25
,
26
};
#elif CONFIG_IDF_TARGET_ESP32S2
...
...
cores/esp32/esp32-hal-gpio.h
浏览文件 @
7eec41dc
...
...
@@ -82,7 +82,6 @@ extern const int8_t esp32_adc2gpio[20];
#define digitalPinCanOutput(pin) ((pin) < NUM_OUPUT_PINS && esp32_gpioMux[(pin)].reg)
#define digitalPinToRtcPin(pin) (((pin) < SOC_GPIO_PIN_COUNT)?esp32_gpioMux[(pin)].rtc:-1)
#define digitalPinToAnalogChannel(pin) (((pin) < SOC_GPIO_PIN_COUNT)?esp32_gpioMux[(pin)].adc:-1)
#define digitalPinToTouchChannel(pin) (((pin) < SOC_GPIO_PIN_COUNT)?esp32_gpioMux[(pin)].touch:-1)
#define digitalPinToDacChannel(pin) (((pin) == PIN_DAC1)?0:((pin) == PIN_DAC2)?1:-1)
void
pinMode
(
uint8_t
pin
,
uint8_t
mode
);
...
...
@@ -93,6 +92,8 @@ void attachInterrupt(uint8_t pin, void (*)(void), int mode);
void
attachInterruptArg
(
uint8_t
pin
,
void
(
*
)(
void
*
),
void
*
arg
,
int
mode
);
void
detachInterrupt
(
uint8_t
pin
);
int8_t
digitalPinToTouchChannel
(
uint8_t
pin
);
#ifdef __cplusplus
}
#endif
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录