nRF Connect SDK API 0.1.0
Loading...
Searching...
No Matches
power_manager_event.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2021 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5 */
6
7#ifndef _POWER_MANAGER_EVENT_H_
8#define _POWER_MANAGER_EVENT_H_
9
17#include <app_event_manager.h>
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
24
47
49 APP_EM_ENFORCE_ENUM_SIZE(POWER_MANAGER_LEVEL)
50};
51
52
61 struct app_event_header header;
68 size_t module_idx;
73};
74
76
83static inline void power_manager_restrict(size_t module_idx, enum power_manager_level lvl)
84{
85 struct power_manager_restrict_event *event = new_power_manager_restrict_event();
86
87 event->module_idx = module_idx;
88 event->level = lvl;
89 APP_EVENT_SUBMIT(event);
90}
91
92#ifdef __cplusplus
93}
94#endif
95
100#endif /* _POWER_MANAGER_EVENT_H_ */
Application Event Manager header.
Application Event Manager profiler tracer header.
#define APP_EVENT_TYPE_DECLARE(ename)
Declare an event type.
Definition: app_event_manager.h:143
#define APP_EVENT_SUBMIT(event)
Submit an event.
Definition: app_event_manager.h:198
static void power_manager_restrict(size_t module_idx, enum power_manager_level lvl)
Set the deepest power sleep mode allowed.
Definition: power_manager_event.h:83
power_manager_level
Available power levels.
Definition: power_manager_event.h:30
@ POWER_MANAGER_LEVEL_OFF
Go to full power off.
Definition: power_manager_event.h:42
@ POWER_MANAGER_LEVEL_MAX
Number of supported levels.
Definition: power_manager_event.h:46
@ POWER_MANAGER_LEVEL_ALIVE
Stay alive.
Definition: power_manager_event.h:34
@ POWER_MANAGER_LEVEL_SUSPENDED
Suspend but do not go to power off.
Definition: power_manager_event.h:38
@ APP_EM_ENFORCE_ENUM_SIZE
Definition: power_manager_event.h:49
size_t module_idx
The module index.
Definition: power_manager_event.h:68
struct app_event_header header
Definition: power_manager_event.h:61
enum power_manager_level level
The deepest sleep mode allowed.
Definition: power_manager_event.h:72
An event to specify which power state is allowed by module.
Definition: power_manager_event.h:59