EXT1 Wakeup from Deep Sleep

slaughterjim
Posts: 12
Joined: Tue Sep 14, 2021 6:39 pm

EXT1 Wakeup from Deep Sleep

Postby slaughterjim » Thu Nov 04, 2021 8:41 pm

[Codebox=c file=Untitled.c][/Codebox]

I have 2 RTC GPIO inputs that either one can wakeup the ESP32 from deep sleep.
I am using esp_sleep_enable_ext1_wakeup().

The 2 return values from esp_sleep_get_wakeup_cause(void) are:
ESP_EXT1_WAKEUP_ALL_LOW = 0
Wake the chip when all selected GPIOs go low.
ESP_EXT1_WAKEUP_ANY_HIGH = 1
Wake the chip when any of the selected GPIOs go high.

I need to know which GPIO caused the interrupt?
Can I read each GPIO with some function?

There was a similar post in 2020 but I did not understand the answer?
Thanks.

JWS
;

felmue
Posts: 70
Joined: Mon Nov 16, 2020 2:55 pm

Re: EXT1 Wakeup from Deep Sleep

Postby felmue » Sun Nov 07, 2021 6:40 pm

Hello @slaughterjim

check out this example here https://randomnerdtutorials.com/esp32-e ... eep-sleep/ - section Code Multiple GPIOs – External Wake Up.

Thanks
Felix

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 138 guests