17#ifndef MBED_POWER_MGMT_H
18#define MBED_POWER_MGMT_H
21#include "platform/mbed_toolchain.h"
22#include "hal/ticker_api.h"
93#ifdef MBED_SLEEP_TRACING_ENABLED
95void sleep_tracker_lock(
const char *
const filename,
int line);
96void sleep_tracker_unlock(
const char *
const filename,
int line);
98#define sleep_manager_lock_deep_sleep() \
101 sleep_manager_lock_deep_sleep_internal(); \
102 sleep_tracker_lock(MBED_FILENAME, __LINE__); \
105#define sleep_manager_unlock_deep_sleep() \
108 sleep_manager_unlock_deep_sleep_internal(); \
109 sleep_tracker_unlock(MBED_FILENAME, __LINE__); \
114#define sleep_manager_lock_deep_sleep() \
115 sleep_manager_lock_deep_sleep_internal()
117#define sleep_manager_unlock_deep_sleep() \
118 sleep_manager_unlock_deep_sleep_internal()
195static inline void mbed_sleep(
void)
198#if (MBED_CONF_RTOS_PRESENT == 0) || (DEVICE_SYSTICK_CLK_OFF_DURING_SLEEP == 0) || defined(MBED_TICKLESS)
us_timestamp_t mbed_time_idle(void)
Provides the time spent in idle mode since boot.
us_timestamp_t mbed_time_deepsleep(void)
Provides the time spent in deep sleep mode since boot.
bool sleep_manager_can_deep_sleep(void)
Get the status of deep sleep allowance for a target.
bool sleep_manager_can_deep_sleep_test_check(void)
Check if the target can deep sleep within a period of time.
us_timestamp_t mbed_uptime(void)
Provides the time since the system is up i.e.
void sleep_manager_lock_deep_sleep_internal(void)
Lock the deep sleep mode.
void sleep_manager_unlock_deep_sleep_internal(void)
Unlock the deep sleep mode.
us_timestamp_t mbed_time_sleep(void)
Provides the time spent in sleep mode since boot.
void sleep_manager_sleep_auto(void)
Enter auto selected sleep mode.
uint64_t us_timestamp_t
A us timestamp stored in a 64 bit integer.