|
Swadge ESP32-S2/S3
APIs to develop for the Magfest Swadge
|
Prior to the Fairy Swadge, the power switch would cut power between the battery and the ESP.
As of the Fairy Swadge, the power switch is connected to a GPIO on one end and either a 10K pullup to VCC or GND on the other end.
The Swadge enters or exits deep sleep depending on the GPIO state.
The GPIO is configured as an RTC GPIO in order to wake the ESP from deep sleep.
This component is not intended to be used by developers. It is set up and used in app_main() and should only be used there.
Go to the source code of this file.
Functions | |
| esp_err_t | initSleepSwitch (gpio_num_t gpio) |
| Initialize a GPIO as an RTC GPIO which monitors the sleep switch. | |
| bool | sleepSwitchShouldSleep (void) |
| Check if the sleep switch should put the Swadge to sleep. This function does not call esp_deep_sleep_start(). That must be done by the caller after de-initializing the Swadge mode, hardware peripherals, etc. | |
| esp_err_t initSleepSwitch | ( | gpio_num_t | gpio | ) |
Initialize a GPIO as an RTC GPIO which monitors the sleep switch.
| gpio | The GPIO connected to the sleep switch. Must ben an RTC GPIO (GPIO_NUM_0 through GPIO_NUM_21 on ESP32-S3) |
| bool sleepSwitchShouldSleep | ( | void | ) |
Check if the sleep switch should put the Swadge to sleep. This function does not call esp_deep_sleep_start(). That must be done by the caller after de-initializing the Swadge mode, hardware peripherals, etc.