![]() |
Data Gator
Hardware and software documentation for the Data Gator project.
|
This file implements firebeetle sleep (ESP32) More...
#include <Arduino.h>
#include <esp_pm.h>
Go to the source code of this file.
Macros | |
#define | uS_TO_S_FACTOR 1000000ULL |
#define | TIME_TO_SLEEP 5 |
Functions | |
void | deep_sleep (uint16_t time_to_sleep) |
Configure the ESP32 for sleep and then enter deep sleep. | |
void | hibernate (uint16_t time_to_sleep) |
Hibernate for time_to_sleep seconds. | |
void | light_sleep () |
Puts the device into light sleep. | |
uint16_t | seconds_to_uS (uint16_t seconds) |
Convert seconds to micro-seconds. | |
void | print_wakeup_reason () |
Method to print the reason by which ESP32 has been awaken from sleep. | |
Variables | |
RTC_DATA_ATTR int | bootCount = 0 |
This file implements firebeetle sleep (ESP32)
Implements wrapper functions used to put the uC processor of the ESP32 into a power conserving sleep mode. The deep_sleep function configures the ESP32 to turn off RTC peripherals but still wake from sleep without external prompting via the reset pin.
#define TIME_TO_SLEEP 5 |
Time ESP32 will go to sleep (in seconds)
#define uS_TO_S_FACTOR 1000000ULL |
Conversion factor for micro seconds to seconds
Configure the ESP32 for sleep and then enter deep sleep.
[in] | time_to_sleep | time to elapse in seconds before waking up |
Hibernate for time_to_sleep
seconds.
[in] | time_to_sleep | The number of seconds to put the device to sleep for |
void light_sleep | ( | ) |
Puts the device into light sleep.
Light sleep allows some types of power sections to continue operating.