StefanS wrote: ↑Sat Feb 02, 2019 10:23 am
I'd like to control a GPIO PIN in the deep sleep wake stub.
I tried the following code but the GPIO does not turn on.
Code: Select all
#define SU_HARDWARE_PWRREG GPIO_NUM_23
void RTC_IRAM_ATTR esp_wake_deep_sleep(void)
{
esp_default_wake_deep_sleep();
gpio_pad_select_gpio(SU_HARDWARE_PWRREG);
// Ripped from gpio_set_level
if(SU_HARDWARE_PWRREG < 32)
GPIO.out_w1ts = (1 << SU_HARDWARE_PWRREG);
else
GPIO.out1_w1ts.data = (1 << (SU_HARDWARE_PWRREG - 32));
// Ripped from gpio_set_direction
if(SU_HARDWARE_PWRREG < 32)
GPIO.enable_w1ts = (0x1 << SU_HARDWARE_PWRREG);
else
GPIO.enable1_w1ts.data = (0x1 << (SU_HARDWARE_PWRREG - 32));
gpio_matrix_out(SU_HARDWARE_PWRREG, SIG_GPIO_OUT_IDX, false, false);
}
Do I need to enable somethng else before I can control the GPIOs?
Thank you
Hi,
I think the steps you have followed are wrong. Means first you have to set GPIO matrix functionality then set direction and then set level.
Did you try your code into normal scenario without deep sleep mode and wake up call? Is it working fine into that scenario?
So, I suggest to check first into normal mode if works fine then would you please check any other GPIO apart from that? If still not working into deep sleep wake up and working into normal mode then need to check in details after that.
So, please check first as I suggested then let me know ow result for that.