|
CDC Badge OS
Firmware for the CDC Badge v1.0 hardware security key
|
#include <ISleepController.h>
Public Member Functions | |
| virtual | ~ISleepController ()=default |
| virtual void | enterLightSleep ()=0 |
| virtual void | enterDeepSleep ()=0 |
| virtual WakeupSource | getWakeupSource () const =0 |
| virtual bool | wasInDeepSleep () const =0 |
| virtual void | clearDeepSleepFlag ()=0 |
| virtual void | setLightSleepInterval (uint32_t seconds)=0 |
| virtual uint32_t | getLightSleepInterval () const =0 |
| virtual void | prepareGpioForSleep ()=0 |
| virtual void | stabilizeGpioAfterWakeup ()=0 |
| virtual bool | registerPreSleepCallback (const SleepCallbackEntry &entry)=0 |
| virtual bool | registerWakeupCallback (const SleepCallbackEntry &entry)=0 |
| virtual void | unregisterCallbacks (const char *moduleName)=0 |
| Public Member Functions inherited from cdc::core::IService | |
| virtual | ~IService ()=default |
| virtual bool | init ()=0 |
| virtual bool | start ()=0 |
| virtual void | stop ()=0 |
| virtual ServiceState | getState () const =0 |
| virtual const char * | getName () const =0 |
Sleep Controller Interface
Manages light sleep and deep sleep modes for the ESP32-S3.
Light Sleep: CPU paused, RTC running, fast wake (<10ms), GPIO wakeup Deep Sleep: Full power down, causes reset on wake, survives in RTC memory
Reference: ~/GIT/cdc-badge-os-legacy/main/app_power.cpp
Definition at line 54 of file ISleepController.h.
|
virtualdefault |
|
pure virtual |
Clear deep sleep flag (call after handling deep sleep wake)
Implemented in cdc::hal::Esp32SleepController.
|
pure virtual |
Enter deep sleep mode
Full power down. Causes RESET on wakeup. Only GPIO wakeup is configured (no timer).
Before calling:
This function does NOT return.
Implemented in cdc::hal::Esp32SleepController.
|
pure virtual |
Enter light sleep mode
CPU is paused, but RTC continues. Wakes on:
Returns immediately after wakeup.
Implemented in cdc::hal::Esp32SleepController.
|
pure virtual |
Get light sleep timer interval
Implemented in cdc::hal::Esp32SleepController.
|
pure virtual |
Get last wakeup source
Implemented in cdc::hal::Esp32SleepController.
|
pure virtual |
Prepare GPIO for sleep (disable interrupts to avoid conflicts)
Implemented in cdc::hal::Esp32SleepController.
|
pure virtual |
Register a callback to be called BEFORE entering sleep Use to prepare module state (stop timers, save data, etc.)
| entry | Callback entry with module name and priority |
Implemented in cdc::hal::Esp32SleepController.
|
pure virtual |
Register a callback to be called AFTER waking from light sleep Use to resume module operations, refresh data, etc. NOTE: Not called after deep sleep (that's a reset)
| entry | Callback entry with module name and priority |
Implemented in cdc::hal::Esp32SleepController.
|
pure virtual |
Set light sleep timer interval in seconds
| seconds | Interval between timer wakeups (0 = no timer wakeup) |
Implemented in cdc::hal::Esp32SleepController.
|
pure virtual |
Stabilize GPIO after wakeup (restore edge trigger)
Implemented in cdc::hal::Esp32SleepController.
|
pure virtual |
Unregister all callbacks for a module
| moduleName | Module name used in registration |
Implemented in cdc::hal::Esp32SleepController.
|
pure virtual |
Check if device just woke from deep sleep (persistent flag in RTC memory)
Implemented in cdc::hal::Esp32SleepController.