Zephyr API Documentation  3.0.0
A Scalable Open Source RTOS
3.0.0
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
pm.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2012-2014 Wind River Systems, Inc.
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#ifndef ZEPHYR_INCLUDE_PM_PM_H_
8#define ZEPHYR_INCLUDE_PM_PM_H_
9
10#include <zephyr/types.h>
11#include <sys/slist.h>
12#include <pm/state.h>
13#include <toolchain.h>
14#include <stdbool.h>
15
16#ifdef __cplusplus
17extern "C" {
18#endif
19
54 sys_snode_t _node;
59 void (*state_entry)(enum pm_state state);
64 void (*state_exit)(enum pm_state state);
65};
66
67#if defined(CONFIG_PM) || defined(__DOXYGEN__)
81
90void pm_notifier_register(struct pm_notifier *notifier);
91
104
115
140
155
164
186
198
203#else /* CONFIG_PM */
204
205#define pm_notifier_register(notifier)
206#define pm_notifier_unregister(notifier) (-ENOSYS)
207
208#define pm_constraint_set(pm_state)
209#define pm_constraint_release(pm_state)
210#define pm_constraint_get(pm_state) (true)
211
212#define pm_power_state_set(info)
213#define pm_power_state_exit_post_ops(info)
214#define pm_power_state_next_get(cpu) \
215 ((struct pm_state_info){PM_STATE_ACTIVE, 0, 0})
216
217#endif /* CONFIG_PM */
218
219void z_pm_save_idle_exit(void);
220
221#ifdef __cplusplus
222}
223#endif
224
225#endif /* ZEPHYR_INCLUDE_PM_PM_H_ */
pm_state
Definition: state.h:27
void pm_constraint_set(enum pm_state state)
Set a constraint for a power state.
bool pm_constraint_get(enum pm_state state)
Check if particular power state is enabled.
void pm_constraint_release(enum pm_state state)
Release a constraint for a power state.
void pm_power_state_set(struct pm_state_info info)
Put processor into a power state.
void pm_power_state_exit_post_ops(struct pm_state_info info)
Do any SoC or architecture specific post ops after sleep state exits.
void pm_notifier_register(struct pm_notifier *notifier)
Register a power management notifier.
bool pm_power_state_force(uint8_t cpu, struct pm_state_info info)
Force usage of given power state.
struct pm_state_info pm_power_state_next_get(uint8_t cpu)
Gets the next power state that will be used.
int pm_notifier_unregister(struct pm_notifier *notifier)
Unregister a power management notifier.
state
Definition: http_parser_state.h:30
Single-linked list implementation.
struct _snode sys_snode_t
Definition: slist.h:33
__UINT8_TYPE__ uint8_t
Definition: stdint.h:58
Definition: pm.h:53
void(* state_entry)(enum pm_state state)
Definition: pm.h:59
void(* state_exit)(enum pm_state state)
Definition: pm.h:64
Definition: state.h:114
Macros to abstract toolchain specific capabilities.