machine.TouchPad should be documented
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.
ESP32 S2 or S3 , can not from machine import TouchPad
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.