|
Ersa Wearable Platform
Embedded smartwatch firmware and application framework
|
#include <esp32_power_management.h>


Public Member Functions | |
| bool | initialize () override |
| void | tick () override |
| bool | initializeWakeSources (const board::Pins &pins) override |
| void | allowAutomaticSleep (bool allow) override |
| void | waitForWake (uint32_t timeoutMs) override |
| void | notifyWake () override |
| void | enterDeepSleep (uint64_t timerUs) override |
| bool | acquirePerformance (PerformanceProfile profile, const char *reason) override |
| void | releasePerformance (PerformanceProfile profile, const char *reason) override |
| Release a performance profile acquired earlier. | |
| void | reportPowerModes () override |
| Emit a one-time power-mode diagnostic report. | |
| bool | getPowerModeReport (char *buffer, size_t capacity) override |
| Copy a power-mode report into a caller-owned buffer. | |
| bool | setTestCpuFrequencyMHz (unsigned mhz) override |
| Queue a development CPU-frequency override for the next controlled restart. | |
| unsigned | testCpuFrequencyMHz () const override |
| Return the queued development CPU-frequency override, or zero for automatic mode. | |
Public Member Functions inherited from ersa::hal::IPowerManagement | |
| virtual | ~IPowerManagement ()=default |
Static Private Member Functions | |
| static void | buttonIsr () |
Private Attributes | |
| void * | uiTask_ {nullptr} |
| void * | noSleepLock_ {nullptr} |
| int | topButtonPin_ {-1} |
| int | bottomButtonPin_ {-1} |
| bool | initialized_ {false} |
| bool | noSleepLockHeld_ {true} |
Static Private Attributes | |
| static Esp32PowerManagement * | active_ = nullptr |
ESP-IDF power backend for automatic sleep, wake sources, and CPU profiles. It coordinates FreeRTOS tickless idle and PM locks with BLE/radio policy.
|
overridevirtual |
Acquire a temporary CPU/APB minimum for latency-sensitive work.
| profile | Workload class selecting the platform's performance guarantee. |
| reason | Short diagnostic label paired with releasePerformance(). |
Implements ersa::hal::IPowerManagement.
|
overridevirtual |
Permit FreeRTOS automatic sleep when true; false holds the platform's no-light-sleep guard for display, network, USB, or active interaction.
Implements ersa::hal::IPowerManagement.
|
staticprivate |
|
overridevirtual |
Enter deep sleep after configuring enabled GPIO/timer sources. This normally restarts firmware on wake, unlike light sleep.
Implements ersa::hal::IPowerManagement.
|
overridevirtual |
Copy a power-mode report into a caller-owned buffer.
Implements ersa::hal::IPowerManagement.
|
overridevirtual |
Configure ESP-IDF dynamic frequency scaling and automatic light sleep.
Implements ersa::hal::IPowerManagement.
|
overridevirtual |
Configure Terra's GPIO wake sources from its board pinctrl contract.
Implements ersa::hal::IPowerManagement.
|
overridevirtual |
Notify the task that new event/driver work is ready to process.
Implements ersa::hal::IPowerManagement.
|
overridevirtual |
Release a performance profile acquired earlier.
Implements ersa::hal::IPowerManagement.
|
overridevirtual |
Emit a one-time power-mode diagnostic report.
Implements ersa::hal::IPowerManagement.
|
overridevirtual |
Queue a development CPU-frequency override for the next controlled restart.
Implements ersa::hal::IPowerManagement.
|
overridevirtual |
Return the queued development CPU-frequency override, or zero for automatic mode.
Implements ersa::hal::IPowerManagement.
|
overridevirtual |
Sample/debug power state while the UI task is active.
Implements ersa::hal::IPowerManagement.
|
overridevirtual |
Block the UI task until notifyWake() or timeout to reduce active polling.
Implements ersa::hal::IPowerManagement.
|
staticprivate |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |