Zephyr API Documentation 4.0.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
policy.h File Reference
#include <stdbool.h>
#include <stdint.h>
#include <zephyr/device.h>
#include <zephyr/pm/state.h>
#include <zephyr/sys/slist.h>
#include <zephyr/toolchain.h>

Go to the source code of this file.

Data Structures

struct  pm_policy_latency_subscription
 Latency change subscription. More...
 
struct  pm_policy_latency_request
 Latency request. More...
 
struct  pm_policy_event
 Event. More...
 

Macros

#define PM_ALL_SUBSTATES   (UINT8_MAX)
 Special value for 'all substates'.
 

Typedefs

typedef void(* pm_policy_latency_changed_cb_t) (int32_t latency)
 Callback to notify when maximum latency changes.
 

Functions

void pm_policy_state_lock_get (enum pm_state state, uint8_t substate_id)
 Increase a power state lock counter.
 
void pm_policy_state_lock_put (enum pm_state state, uint8_t substate_id)
 Decrease a power state lock counter.
 
bool pm_policy_state_lock_is_active (enum pm_state state, uint8_t substate_id)
 Check if a power state lock is active (not allowed).
 
void pm_policy_event_register (struct pm_policy_event *evt, int64_t uptime_ticks)
 Register an event.
 
void pm_policy_event_update (struct pm_policy_event *evt, int64_t uptime_ticks)
 Update an event.
 
void pm_policy_event_unregister (struct pm_policy_event *evt)
 Unregister an event.
 
void pm_policy_device_power_lock_get (const struct device *dev)
 Increase power state locks.
 
void pm_policy_device_power_lock_put (const struct device *dev)
 Decrease power state locks.
 
int64_t pm_policy_next_event_ticks (void)
 Returns the ticks until the next event.
 
void pm_policy_latency_request_add (struct pm_policy_latency_request *req, uint32_t value_us)
 Add a new latency requirement.
 
void pm_policy_latency_request_update (struct pm_policy_latency_request *req, uint32_t value_us)
 Update a latency requirement.
 
void pm_policy_latency_request_remove (struct pm_policy_latency_request *req)
 Remove a latency requirement.
 
void pm_policy_latency_changed_subscribe (struct pm_policy_latency_subscription *req, pm_policy_latency_changed_cb_t cb)
 Subscribe to maximum latency changes.
 
void pm_policy_latency_changed_unsubscribe (struct pm_policy_latency_subscription *req)
 Unsubscribe to maximum latency changes.