oveRTOS C++ API
C++20 RAII wrappers for the oveRTOS C API
Loading...
Searching...
No Matches
Namespaces | Typedefs | Functions
pm.hpp File Reference

Power management framework — state machine, wake sources, peripheral domains, and runtime statistics. More...

#include <ove/pm.h>
#include <ove/types.hpp>
#include <ove/error.hpp>
Include dependency graph for pm.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  ove
 Top-level namespace for all oveRTOS C++ abstractions.
 
namespace  ove::pm
 Thin C++ wrappers around the oveRTOS power management API.
 

Typedefs

using ove::pm::State = ove_pm_state_t
 System power state (active / sleep / deep-sleep / off).
 
using ove::pm::WakeType = ove_pm_wake_type_t
 Wake-source kind (GPIO, RTC, timer, …).
 
using ove::pm::Domain = ove_pm_domain_t
 Peripheral power domain identifier.
 
using ove::pm::Event = ove_pm_event_t
 PM event delivered to subscribers (entering/exiting a state, etc.).
 
using ove::pm::WakeSrc = ove_pm_wake_src
 Wake-source descriptor passed to enable_wake_src().
 
using ove::pm::Cfg = ove_pm_cfg
 Runtime configuration consumed by init().
 
using ove::pm::Stats = ove_pm_stats
 Aggregated runtime statistics (time in each state, etc.).
 

Functions

Result< void > ove::pm::init (const Cfg &cfg) noexcept
 Initialise the PM subsystem.
 
void ove::pm::deinit ()
 Tear down the PM subsystem and release resources.
 
Result< void > ove::pm::set_state (State state) noexcept
 Request an explicit power state transition.
 
State ove::pm::get_state ()
 Query the current power state.
 
void ove::pm::activity ()
 Report system activity (ISR-safe).
 
Result< void > ove::pm::wake_register (const WakeSrc &src) noexcept
 Register a wake source.
 
Result< void > ove::pm::wake_unregister (const WakeSrc &src) noexcept
 Unregister a previously registered wake source.
 
Result< void > ove::pm::domain_request (Domain domain) noexcept
 Increment the reference count for a peripheral power domain.
 
Result< void > ove::pm::domain_release (Domain domain) noexcept
 Decrement the reference count for a peripheral power domain.
 
Result< int > ove::pm::domain_get_refcount (Domain domain) noexcept
 Query the current reference count for a domain.
 
Result< void > ove::pm::set_policy (ove_pm_policy_fn policy, void *user_data=nullptr) noexcept
 Register a custom power policy callback.
 
Result< void > ove::pm::notify_register (ove_pm_notify_fn cb, void *user_data=nullptr) noexcept
 Register a transition notification callback.
 
Result< void > ove::pm::notify_unregister (ove_pm_notify_fn cb, void *user_data=nullptr) noexcept
 Unregister a transition notification callback.
 
Result< Statsove::pm::get_stats () noexcept
 Query accumulated power statistics.
 
void ove::pm::reset_stats ()
 Reset all accumulated power statistics to zero.
 
Result< void > ove::pm::set_budget (uint32_t target_pct_x100) noexcept
 Set a target percentage of time in low-power states.
 
Result< uint32_t > ove::pm::get_budget_status () noexcept
 Query actual low-power percentage vs. budget target.
 
void ove::pm::idle_process ()
 Process idle — drive the PM state machine.
 

Detailed Description

Power management framework — state machine, wake sources, peripheral domains, and runtime statistics.