Zephyr API Documentation 4.2.99
A Scalable Open Source RTOS
|
System Power Management States. More...
Data Structures | |
struct | pm_state_info |
Information about a power management state. More... | |
struct | pm_state_constraint |
Power state information needed to lock a power state. More... |
Macros | |
#define | PM_STATE_INFO_DT_INIT(node_id) |
Initializer for struct pm_state_info given a DT node identifier with zephyr,power-state compatible. | |
#define | PM_STATE_DT_INIT(node_id) |
Initializer for enum pm_state given a DT node identifier with zephyr,power-state compatible. | |
#define | DT_NUM_CPU_POWER_STATES(node_id) |
Obtain number of CPU power states supported and enabled by the given CPU node identifier. | |
#define | PM_STATE_INFO_LIST_FROM_DT_CPU(node_id) |
Initialize an array of struct pm_state_info with information from all the states present and enabled in the given CPU node identifier. | |
#define | PM_STATE_LIST_FROM_DT_CPU(node_id) |
Initialize an array of struct pm_state with information from all the states present and enabled in the given CPU node identifier. |
Enumerations | |
enum | pm_state { PM_STATE_ACTIVE , PM_STATE_RUNTIME_IDLE , PM_STATE_SUSPEND_TO_IDLE , PM_STATE_STANDBY , PM_STATE_SUSPEND_TO_RAM , PM_STATE_SUSPEND_TO_DISK , PM_STATE_SOFT_OFF , PM_STATE_COUNT } |
Power management state. More... |
Functions | |
uint8_t | pm_state_cpu_get_all (uint8_t cpu, const struct pm_state_info **states) |
Obtain information about all supported states by a CPU. | |
const struct pm_state_info * | pm_state_get (uint8_t cpu, enum pm_state state, uint8_t substate_id) |
Get power state structure. | |
const char * | pm_state_to_str (enum pm_state state) |
Convert a pm_state enum value to its string representation. | |
int | pm_state_from_str (const char *name, enum pm_state *out) |
Parse a string and convert it to a pm_state enum value. |
System Power Management States.
#define DT_NUM_CPU_POWER_STATES | ( | node_id | ) |
#include <zephyr/pm/state.h>
Obtain number of CPU power states supported and enabled by the given CPU node identifier.
node_id | A CPU node identifier. |
#define PM_STATE_DT_INIT | ( | node_id | ) |
#include <zephyr/pm/state.h>
Initializer for enum pm_state given a DT node identifier with zephyr,power-state compatible.
node_id | A node identifier with compatible zephyr,power-state |
#define PM_STATE_INFO_DT_INIT | ( | node_id | ) |
#include <zephyr/pm/state.h>
Initializer for struct pm_state_info given a DT node identifier with zephyr,power-state compatible.
node_id | A node identifier with compatible zephyr,power-state |
#define PM_STATE_INFO_LIST_FROM_DT_CPU | ( | node_id | ) |
#include <zephyr/pm/state.h>
Initialize an array of struct pm_state_info with information from all the states present and enabled in the given CPU node identifier.
Example devicetree fragment:
Example usage:
node_id | A CPU node identifier. |
#define PM_STATE_LIST_FROM_DT_CPU | ( | node_id | ) |
#include <zephyr/pm/state.h>
Initialize an array of struct pm_state with information from all the states present and enabled in the given CPU node identifier.
Example devicetree fragment:
Example usage:
node_id | A CPU node identifier. |
enum pm_state |
#include <zephyr/pm/state.h>
Power management state.
uint8_t pm_state_cpu_get_all | ( | uint8_t | cpu, |
const struct pm_state_info ** | states ) |
#include <zephyr/pm/state.h>
Obtain information about all supported states by a CPU.
cpu | CPU index. |
states | Where to store the list of supported states. |
int pm_state_from_str | ( | const char * | name, |
enum pm_state * | out ) |
#include <zephyr/pm/state.h>
Parse a string and convert it to a pm_state enum value.
name | Input string (e.g., "suspend-to-ram"). |
out | Pointer to store the parsed pm_state value. |
const struct pm_state_info * pm_state_get | ( | uint8_t | cpu, |
enum pm_state | state, | ||
uint8_t | substate_id ) |
#include <zephyr/pm/state.h>
Get power state structure.
Function searches in all states assigned to the CPU and in disabled states.
cpu | CPU index. |
state | Power state. |
substate_id | Substate. |
const char * pm_state_to_str | ( | enum pm_state | state | ) |
#include <zephyr/pm/state.h>
Convert a pm_state enum value to its string representation.
state | Power state. |