The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.

Dependents:   hello SerialTestv11 SerialTestv12 Sierpinski ... more

mbed 2

This is the mbed 2 library. If you'd like to learn about Mbed OS please see the mbed-os docs.

Revision:
169:a7c7b631e539
Parent:
165:d1b4690b3f8b
Child:
170:e95d10626187
--- a/platform/mbed_power_mgmt.h	Thu May 24 15:35:55 2018 +0100
+++ b/platform/mbed_power_mgmt.h	Fri Jun 22 15:38:59 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
 }