← index #8511Issue #8048
Related · high · value 0.752
QUERY · ISSUE

machine.TouchPad should be documented

openby mattytrentiniopened 2022-04-09updated 2023-10-30
docs

machine.TouchPad, implemented in machine_touchpad.c for the esp32 port, is only documented in the ESP32 Quick Ref: Capacitive touch.

It should also have a machine.TouchPad entry.

CANDIDATE · ISSUE

ESP32 S2 or S3 , can not from machine import TouchPad

closedby Wind-stormgeropened 2021-11-30updated 2024-03-02
port-esp32

I built the firmware under the following conditions:
ESP-IDF v5.0-dev-517-g68cf4ef2be
MicroPython v1.17-212-g23a150789-dirty

I tested on esp32, esp32s2 and esp32s3 chips,Touchpad module is only available on esp32.

When I enter this code in repl:

from machine import TouchPad
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: can't import name TouchPad

So I further confirm whether it exists:

>>> import machine
>>> machine.
ADC             DAC             DEEPSLEEP       DEEPSLEEP_RESET
EXT0_WAKE       EXT1_WAKE       HARD_RESET      I2C
I2S             PIN_WAKE        PWM             PWRON_RESET
Pin             RTC             SLEEP           SOFT_RESET
SPI             Signal          SoftI2C         SoftSPI
TIMER_WAKE      TOUCHPAD_WAKE   Timer           UART
ULP_WAKE        WDT             WDT_RESET       bitstream
deepsleep       disable_irq     enable_irq      freq
idle            lightsleep      mem16           mem32
mem8            reset           reset_cause     sleep
soft_reset      time_pulse_us   unique_id       wake_reason
>>> machine.

What is hard to understand is , TOUCHPAD_WAKE is still there, but the TouchPad is gone?!

I reconfirmed that touchpad has been supported on esp32s2 and s3

https://github.com/micropython/micropython/blob/23a150789df1029def2a26cb757e7d6703520159/ports/esp32/machine_touchpad.c#L59-L62

I'm not sure if there's anything I haven't checked.

Hope to get some inspiration or help.

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied