Wake handler GPIO/ADC examples?

chris1seto
Posts: 20
Joined: Tue Jun 12, 2018 5:05 pm

Wake handler GPIO/ADC examples?

Postby chris1seto » Tue Apr 23, 2019 9:35 pm

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?

chris1seto
Posts: 20
Joined: Tue Jun 12, 2018 5:05 pm

Re: Wake handler GPIO/ADC examples?

Postby chris1seto » Wed Apr 24, 2019 1:19 am

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?

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: Wake handler GPIO/ADC examples?

Postby WiFive » Thu Apr 25, 2019 12:31 am

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.

Who is online

Users browsing this forum: No registered users and 107 guests