Page 1 of 1

Wake handler GPIO/ADC examples?

Posted: Tue Apr 23, 2019 9:35 pm
by chris1seto
Obviously the wake handler can only use code which is loaded into ROM/RTC memory, but I'm wondering if there are any examples of using peripherals through what limited resources are available in this state. Looking through the header files for the ROM code, I see function to manipulate GPIOs, for example, but there is also a function called "gpio_init()". Do I need to call this? I also don't see any header files for an ADC driver. Do I have no other choice other than direct register operations to manipulate peripherals during the wake handler?

Re: Wake handler GPIO/ADC examples?

Posted: Wed Apr 24, 2019 1:19 am
by chris1seto
Another question: What is the best way to find out the wake cause in the stub, given that esp_sleep_get_wakeup_cause() isn't loaded into IRAM?

For right now, I've just been slightly tweaking any higher level functions (GPIO, etc) I need and loading them into IRAM under a new name. I'm trying to avoid having to use the lower level macros, mostly because it's hard to tell what is best practice to use. Is there a better way to do this that I am missing?

Re: Wake handler GPIO/ADC examples?

Posted: Thu Apr 25, 2019 12:31 am
by WiFive
It would be nice to have a wake stub library with useful functions in rtc_wake_stub_* files but I don't think it exists yet.