Zephyr API Documentation  3.7.0-rc1
A Scalable Open Source RTOS
Loading...
Searching...
No Matches

System Power Management API. More...

Modules

 Hooks
 System Power Management Hooks.
 
 Policy
 System Power Management Policy API.
 

Data Structures

struct  pm_notifier
 Power management notifier struct. More...
 

Functions

bool pm_state_force (uint8_t cpu, const struct pm_state_info *info)
 Force usage of given power state.
 
void pm_notifier_register (struct pm_notifier *notifier)
 Register a power management notifier.
 
int pm_notifier_unregister (struct pm_notifier *notifier)
 Unregister a power management notifier.
 
const struct pm_state_infopm_state_next_get (uint8_t cpu)
 Gets the next power state that will be used.
 
void pm_system_resume (void)
 Notify exit from kernel sleep.
 

Detailed Description

System Power Management API.

Since
1.2

Function Documentation

◆ pm_notifier_register()

void pm_notifier_register ( struct pm_notifier notifier)

#include <zephyr/pm/pm.h>

Register a power management notifier.

Register the given notifier from the power management notification list.

Parameters
notifierpm_notifier object to be registered.

◆ pm_notifier_unregister()

int pm_notifier_unregister ( struct pm_notifier notifier)

#include <zephyr/pm/pm.h>

Unregister a power management notifier.

Remove the given notifier from the power management notification list. After that this object callbacks will not be called.

Parameters
notifierpm_notifier object to be unregistered.
Returns
0 if the notifier was successfully removed, a negative value otherwise.

◆ pm_state_force()

bool pm_state_force ( uint8_t  cpu,
const struct pm_state_info info 
)

#include <zephyr/pm/pm.h>

Force usage of given power state.

This function overrides decision made by PM policy forcing usage of given power state upon next entry of the idle thread.

Note
This function can only run in thread context
Parameters
cpuCPU index.
infoPower state which should be used in the ongoing suspend operation.

◆ pm_state_next_get()

const struct pm_state_info * pm_state_next_get ( uint8_t  cpu)

#include <zephyr/pm/pm.h>

Gets the next power state that will be used.

This function returns the next power state that will be used by the SoC.

Parameters
cpuCPU index.
Returns
next pm_state_info that will be used

◆ pm_system_resume()

void pm_system_resume ( void  )

#include <zephyr/pm/pm.h>

Notify exit from kernel sleep.

This function would notify exit from kernel idling if a corresponding pm_system_suspend() notification was handled and did not return PM_STATE_ACTIVE.

This function should be called from the ISR context of the event that caused the exit from kernel idling.

This is required for cpu power states that would require interrupts to be enabled while entering low power states. e.g. C1 in x86. In those cases, the ISR would be invoked immediately after the event wakes up the CPU, before code following the CPU wait, gets a chance to execute. This can be ignored if no operation needs to be done at the wake event notification.