Data Gator
Hardware and software documentation for the Data Gator project.
Loading...
Searching...
No Matches
firebeetle_sleep.hpp File Reference

This file implements firebeetle sleep (ESP32) More...

#include <Arduino.h>
#include <esp_pm.h>
Include dependency graph for firebeetle_sleep.hpp:
This graph shows which files directly or indirectly include this file:

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
 

Detailed Description

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.

Author
Garrett Wells
Date
2022

Macro Definition Documentation

◆ TIME_TO_SLEEP

#define TIME_TO_SLEEP   5

Time ESP32 will go to sleep (in seconds)

◆ uS_TO_S_FACTOR

#define uS_TO_S_FACTOR   1000000ULL

Conversion factor for micro seconds to seconds

Function Documentation

◆ deep_sleep()

void deep_sleep ( uint16_t  time_to_sleep)

Configure the ESP32 for sleep and then enter deep sleep.

Parameters
[in]time_to_sleeptime to elapse in seconds before waking up

◆ hibernate()

void hibernate ( uint16_t  time_to_sleep)

Hibernate for time_to_sleep seconds.

Parameters
[in]time_to_sleepThe number of seconds to put the device to sleep for

◆ light_sleep()

void light_sleep ( )

Puts the device into light sleep.

Light sleep allows some types of power sections to continue operating.

◆ seconds_to_uS()

uint16_t seconds_to_uS ( uint16_t  seconds)

Convert seconds to micro-seconds.

Parameters
[in]seconds