mbed library sources. Supersedes mbed-src.
Dependents: Nucleo_Hello_Encoder BLE_iBeaconScan AM1805_DEMO DISCO-F429ZI_ExportTemplate1 ... more
Diff: platform/mbed_power_mgmt.h
- Revision:
- 186:707f6e361f3e
- Parent:
- 184:08ed48f1de7f
- Child:
- 187:0387e8f68319
--- a/platform/mbed_power_mgmt.h Thu Apr 19 17:12:19 2018 +0100 +++ b/platform/mbed_power_mgmt.h Fri Jun 22 16:45:37 2018 +0100 @@ -25,6 +25,7 @@ #include "sleep_api.h" #include "mbed_toolchain.h" +#include "hal/ticker_api.h" #include <stdbool.h> #ifdef __cplusplus @@ -205,6 +206,34 @@ { NVIC_SystemReset(); } + +/** Provides the time spent in sleep mode since boot. + * + * @return Time spent in sleep + * @note Works only if platform supports LP ticker. + */ +us_timestamp_t mbed_time_sleep(void); + +/** Provides the time spent in deep sleep mode since boot. + * + * @return Time spent in deep sleep + * @note Works only if platform supports LP ticker. + */ +us_timestamp_t mbed_time_deepsleep(void); + +/** Provides the time spent in idle mode since boot. + * + * @return Idle thread time. + * @note Works only if platform supports LP ticker. + */ +us_timestamp_t mbed_time_idle(void); + +/** Provides the time since the system is up i.e. boot. + * + * @return System uptime. + * @note Works only if platform supports LP ticker. + */ +us_timestamp_t mbed_uptime(void); #ifdef __cplusplus }