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

Public Member Functions | |
| virtual | ~IPowerManagement ()=default |
| virtual bool | initialize ()=0 |
| virtual void | tick ()=0 |
| virtual bool | initializeWakeSources (const board::Pins &pins)=0 |
| Configure GPIO/button wake sources from the selected board's pin map. | |
| virtual void | allowAutomaticSleep (bool allow)=0 |
| virtual void | waitForWake (uint32_t timeoutMs)=0 |
| virtual void | notifyWake ()=0 |
| virtual void | enterDeepSleep (uint64_t timerUs)=0 |
| virtual bool | acquirePerformance (PerformanceProfile profile, const char *reason)=0 |
| virtual void | releasePerformance (PerformanceProfile profile, const char *reason)=0 |
| Release a performance profile acquired earlier. | |
| virtual void | reportPowerModes ()=0 |
| Emit a one-time power-mode diagnostic report. | |
| virtual bool | getPowerModeReport (char *buffer, size_t capacity)=0 |
| Copy a power-mode report into a caller-owned buffer. | |
| virtual bool | setTestCpuFrequencyMHz (unsigned mhz)=0 |
| Queue a development CPU-frequency override for the next controlled restart. | |
| virtual unsigned | testCpuFrequencyMHz () const =0 |
| Return the queued development CPU-frequency override, or zero for automatic mode. | |
Platform contract for clock scaling, wake sources, and low-power states.
Power policy decides when automatic sleep is appropriate; this interface configures the chip/RTOS and coordinates peripheral locks. The normal idle path waits on the RTOS so automatic sleep can honor BLE and PM constraints.
|
virtualdefault |
|
pure virtual |
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(). |
Implemented in ersa::test::MockPowerManagement, and ersa::hal::Esp32PowerManagement.
|
pure virtual |
Permit FreeRTOS automatic sleep when true; false holds the platform's no-light-sleep guard for display, network, USB, or active interaction.
Implemented in ersa::hal::Esp32PowerManagement, and ersa::test::MockPowerManagement.
|
pure virtual |
Enter deep sleep after configuring enabled GPIO/timer sources. This normally restarts firmware on wake, unlike light sleep.
Implemented in ersa::hal::Esp32PowerManagement, and ersa::test::MockPowerManagement.
|
pure virtual |
Copy a power-mode report into a caller-owned buffer.
Implemented in ersa::test::MockPowerManagement, and ersa::hal::Esp32PowerManagement.
|
pure virtual |
Configure PM/tickless-idle policy before radio stacks acquire locks.
Implemented in ersa::hal::Esp32PowerManagement, and ersa::test::MockPowerManagement.
|
pure virtual |
Configure GPIO/button wake sources from the selected board's pin map.
Implemented in ersa::test::MockPowerManagement, and ersa::hal::Esp32PowerManagement.
|
pure virtual |
Notify the task that new event/driver work is ready to process.
Implemented in ersa::hal::Esp32PowerManagement, and ersa::test::MockPowerManagement.
|
pure virtual |
Release a performance profile acquired earlier.
Implemented in ersa::test::MockPowerManagement, and ersa::hal::Esp32PowerManagement.
|
pure virtual |
Emit a one-time power-mode diagnostic report.
Implemented in ersa::hal::Esp32PowerManagement, and ersa::test::MockPowerManagement.
|
pure virtual |
Queue a development CPU-frequency override for the next controlled restart.
Implemented in ersa::hal::Esp32PowerManagement, and ersa::test::MockPowerManagement.
|
pure virtual |
Return the queued development CPU-frequency override, or zero for automatic mode.
Implemented in ersa::hal::Esp32PowerManagement, and ersa::test::MockPowerManagement.
|
pure virtual |
Sample or apply deferred PM work without blocking the application task.
Implemented in ersa::hal::Esp32PowerManagement, and ersa::test::MockPowerManagement.
|
pure virtual |
Block the UI task until notifyWake() or timeout to reduce active polling.
Implemented in ersa::hal::Esp32PowerManagement, and ersa::test::MockPowerManagement.