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.
- Notify
Handler - A registered power transition notification handler.
- Policy
Ctx - Per-tick context passed to a
PolicyHandler. - Policy
Handler - 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.
- Wake
Type - 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.