Open eme-bennytang opened 1 year ago
Hi @eme-bennytang! You may take a look at this chapter in TRM 6.7 RTC IO MUX for Low Power and Analog Input/Output.
You can try to use gpio_hold_en() gpio_hold_dis().
gpio_hold_dis(num_pin);
...
gpio_set_level(num_pin, 0);
gpio_hold_en(num_pin);
esp_sleep_enable_timer_wakeup(30 * 1000); // 30 sec sleep
esp_light_sleep_start();
gpio_hold_dis(num_pin);
@eme-bennytang If you are using autolight sleep controlled by esp_pm, It is recommended to use gpio_sleep_sel_dis
to disable automatic switching of gpio mode when entering sleep, because if PM_SLP_DISABLE_GPIO
or ESP_SLEEP_GPIO_RESET_WORKAROUND
is enabled, the system will configure all gpio sleep modes to high impedance during startup.
If no more issues, this thread can be closed.
Answers checklist.
General issue report
Hi,
I am trying out the lightsleep for my ESP32S3. I set a GPIO to High before going to sleep, but I found that when it enter sleep, the GPIO go down immediately. After some digging, seems the GPIO will be set to High Impedance after sleep?
Is there any way I can hold some IO to its original state (state before sleep) while sleeping?
Thanks