Skip to main content

Module pm

Module pm 

Source
Expand description

Power management framework for oveRTOS.

Provides a unified interface for sleep state management, peripheral power domains, wake source registration, pluggable power policies, and runtime power statistics.

The PM subsystem is a singleton — there is one system-wide power state. Initialise with init and tear down with deinit.

Structs§

Cfg
PM subsystem configuration.
NotifyHandler
A registered power transition notification handler.
PolicyCtx
Per-tick context passed to a PolicyHandler.
PolicyHandler
A registered power-policy handler bound to a static state cell.
Stats
Runtime power statistics.

Enums§

Domain
Peripheral power domain identifiers.
Event
Transition event type for notification callbacks.
State
System power states, ordered by increasing sleep depth.
WakeType
Wake source types.

Functions§

activity
Report system activity (ISR-safe). Resets the idle timer.
clear_policy
Restore the default threshold-based power policy.
deinit
Tear down the PM subsystem and release resources.
domain_get_refcount
Query the current reference count for a domain.
domain_release
Decrement the reference count for a peripheral power domain.
domain_request
Increment the reference count for a peripheral power domain.
get_budget_status
Query actual low-power percentage vs. budget target.
get_state
Query the current power state.
get_stats
Query accumulated power statistics.
init
Initialise the PM subsystem.
notify_register
Register a typed-context transition notification handler.
notify_register_raw
Raw-pointer variant of notify_register.
notify_unregister
Unregister a previously registered notification handler.
notify_unregister_raw
Raw-pointer variant of notify_unregister.
reset_stats
Reset all accumulated power statistics to zero.
set_budget
Set a target percentage of time in low-power states.
set_policy
Register a typed-context power policy handler.
set_policy_raw
Raw-pointer variant of set_policy.
set_state
Request an explicit power state transition.
wake_register_gpio
Register a GPIO wake source.
wake_register_timer
Register a timer wake source.
wake_register_uart
Register a UART wake source.
wake_unregister_gpio
Unregister a GPIO wake source.