Power Management Example
Demonstrates the PM state machine with automatic idle transitions, peripheral power domain reference counting, wake source registration (GPIO button + UART), custom battery-aware power policy, transition notifications, and runtime power statistics.
Language implementations
| Language | Source | WASM Demo |
|---|---|---|
| C | apps/c/heap/example_pm/ |
Run in browser |
| C++ | apps/cpp/heap/example_pm/ |
Run in browser |
| Rust | apps/rust/heap/example_pm/ |
Not available |
| Zig | apps/zig/heap/example_pm/ |
Not yet available |
Zero-heap variants live under apps/<lang>/zeroheap/example_pm/.
Key APIs demonstrated
ove_pm_init, ove_pm_set_state, ove_pm_activity, ove_pm_wake_register, ove_pm_domain_request/release, ove_pm_set_policy, ove_pm_notify_register, ove_pm_get_stats, ove_pm_set_budget
Required Kconfig
CONFIG_OVE_PM=y, CONFIG_OVE_TIMER=y
How to build
make host.posix.example_pm_c # C
make host.posix.example_pm_cpp # C++
make configure && make download && make && make run