Distingishing touch wakeups on the ESP32

I wish to use multiple touch keys to wake up a sleeping ESP32. The wakeup reason function distinguishes only that a wakeup is due to a touch, but doesn't distinguish between keys. I did not find any references as to how to distinguish a touch wakeup online. Does anyone know if there is an ESP32 function that doe this?

Thanks in advance for and suggestions.

jrdoner

This is what you need:

esp_sleep_get_touchpad_wakeup_status();

Modem sleep, light sleep or deep sleep?

With modem and light sleep, using the above suggestion will work.

Deep sleep does a reset upon waking. If you really want to know the touched pad then you'll need to program the ULP processor using RTC ram/IO. The ULP processor is an ultra low power processor that has RTC slow and fast ram that can retain data through a reboot.

The ULP processor, under the Arduino IDE, can be programmed using the Legacy GNU method, ESP32 API API Reference - ESP32 - — ESP-IDF Programming Guide latest documentation. The ULP processor is programmed using assembly code, ULP Instruction set ESP32 ULP coprocessor instruction set - ESP32 - — ESP-IDF Programming Guide latest documentation.

I use the ULP processor as a 3rd processor to compute some non critical items whose output are made available to the main processor, core0 and core1. An easy example would be to blink the onboard LED, without using the main processor.

Answer, yes it can be done.