This class provides an API to assist with low power behaviour on an STM32F437 micro, as used on the u-blox C030 board. If you need to operate from battery for any significant period, or are mains powered and don't want to take the planet down with you, you should design your code with this in mind. This library uses the https://developer.mbed.org/users/Sissors/code/WakeUp/ library and so could be extended to support all of the MCUs that library supports.

Dependencies:   WakeUp

Dependents:   example-low-power-sleep aconnoCellularGnss

Revision:
3:442c9afc0229
Parent:
1:4f2c412dc013
--- a/low_power.cpp	Mon Apr 10 11:50:47 2017 +0000
+++ b/low_power.cpp	Tue Apr 11 09:57:37 2017 +0000
@@ -34,22 +34,22 @@
 # include <stdio.h>
 #endif
 
-// ----------------------------------------------------------------
-// COMPILE-TIME MACROS
-// ----------------------------------------------------------------
+/* ----------------------------------------------------------------
+ * COMPILE-TIME MACROS
+ * -------------------------------------------------------------- */
 
-/// Location of backup SRAM in memory (on STM23F4, has no effect otherwise).
+// Location of backup SRAM in memory (on STM23F4, has no effect otherwise).
 #define BACKUP_SRAM_START_ADDRESS ((uint32_t *) ((uint32_t) BKPSRAM_BASE))
 
-// ----------------------------------------------------------------
-// PRIVATE VARIABLES
-// ----------------------------------------------------------------
+/* ----------------------------------------------------------------
+ * PRIVATE VARIABLES
+ * -------------------------------------------------------------- */
+ 
+/* ----------------------------------------------------------------
+ * PRIVATE FUNCTIONS
+ * -------------------------------------------------------------- */
 
-// ----------------------------------------------------------------
-// PRIVATE FUNCTIONS
-// ----------------------------------------------------------------
-
-/// Check whether an interrupt is enabled or not.
+// Check whether an interrupt is enabled or not.
 inline uint32_t LowPower::myNVIC_GetEnableIRQ(IRQn_Type IRQn)
 {
     if ((int32_t)(IRQn) >= 0) {
@@ -59,11 +59,11 @@
     }
 }
 
-//----------------------------------------------------------------
-// PUBLIC FUNCTIONS
-// ----------------------------------------------------------------
+/* ----------------------------------------------------------------
+ * PUBLIC FUNCTIONS
+ * -------------------------------------------------------------- */
 
-/// Constructor.
+// Constructor.
 LowPower::LowPower(void)
 {
 #ifdef TARGET_STM
@@ -83,12 +83,12 @@
 #endif        
 }
 
-/// Destructor.
+// Destructor.
 LowPower::~LowPower(void)
 {
 }
 
-/// Enter Stop mode.
+// Enter Stop mode.
 void LowPower::enterStop(uint32_t stopPeriodMilliseconds)
 {
     if (stopPeriodMilliseconds > 0) {
@@ -122,7 +122,7 @@
     }
 }
 
-/// Enter Standby mode.
+// Enter Standby mode.
 void LowPower::enterStandby(uint32_t standbyPeriodMilliseconds, bool powerDownBackupSram)
 {
     if (standbyPeriodMilliseconds > 0) {
@@ -164,7 +164,7 @@
     }
 }
 
-/// Get the number of user interrupts that are enabled.
+// Get the number of user interrupts that are enabled.
 int32_t LowPower::numUserInterruptsEnabled(uint8_t *pList, uint32_t sizeOfList)
 {
     int32_t userInterruptsEnabled = 0;
@@ -196,7 +196,7 @@
     return userInterruptsEnabled;
 }
 
-/// Exit debug mode.
+// Exit debug mode.
 void LowPower::exitDebugMode(void)
 {
 #ifdef TARGET_STM
@@ -213,4 +213,4 @@
 #endif    
 }
 
-// End Of File
+/* End Of File */