You can use an external interrupt to wake up the ESP32 from deep sleep. There are two types of external wake-ups in the ESP32.
- ext0: This is used when a single GPIO pin is being accessed.
- ext1: This is used when several GPIO pins are being accessed e.g. through different push buttons.
Only Real-time clock or RTC input-output pins can be used as a wake up source and you need to make sure that during deep sleep the RTC peripherals are powered ON. So, you can only use the RTC GPIOs to trigger the ext0, ext1 external wake-up.
GPIO wakeup for ESP32-C3
https://docs.espressif.com/projects/esp-idf/en/latest/esp32c3/api-reference/system/sleep_modes.html
Any IO can be used as the external input to wake up the chip from Light-sleep.
IOs that are powered by the VDD3P3_RTC power domain (see esp32-c3 datasheet “Pin Description” section) can be used to wake up the chip from Deep-sleep.
Digital GPIOs (GPIO6 ~ 21) are in a high impedance state in Deep-sleep mode.