minimizing power on C027

Dependencies:   C027_Support mbed

Fork of PowerControl by Michael Wei

Files at this revision

API Documentation at this revision

Comitter:
coyotebush
Date:
Wed May 27 05:59:21 2015 +0000
Parent:
0:9bd5f1bdb845
Commit message:
Test C027 features

Changed in this revision

C027_Support.lib Show annotated file Show diff for this revision Revisions of this file
PowerControl/PowerControl.h Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/C027_Support.lib	Wed May 27 05:59:21 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/teams/ublox/code/C027_Support/#db878a234544
--- a/PowerControl/PowerControl.h	Sat Jan 30 02:23:30 2010 +0000
+++ b/PowerControl/PowerControl.h	Wed May 27 05:59:21 2015 +0000
@@ -6,7 +6,8 @@
 #define MBED_POWERCONTROL_H 
 
 //shouldn't have to include, but fixes weird problems with defines
-#include "LPC1768/LPC17xx.h"
+//#include "LPC1768/LPC17xx.h"
+#include "C027_api.h"
 
 //System Control Register
 // bit 0: Reserved
--- a/main.cpp	Sat Jan 30 02:23:30 2010 +0000
+++ b/main.cpp	Wed May 27 05:59:21 2015 +0000
@@ -1,15 +1,35 @@
 #include "mbed.h"
 #include "PowerControl/PowerControl.h"
 #include "PowerControl/EthernetPowerControl.h"
+#include "MDM.h"
+#include "GPS.h"
+
+DigitalOut led(LED);
+void hello() {
+    led = !led;
+}
 
 int main() {
-    //turn OSC1 down
-     PHY_PowerDown();
-     wait(5);
-     LPC_GPIO1->FIODIR = 0x8000000;
-     LPC_GPIO1->FIOCLR = 0x8000000;
-     wait(5);
-     LPC_GPIO1->FIOSET = 0x8000000;
-     wait(5);
-     PHY_PowerUp();
+    printf("Starting\r\n");
+    wait(5);
+    printf("Modem on\r\n");
+    MDMSerial mdm;
+    wait(5);
+    printf("GPS on\r\n");
+    GPSI2C gps;
+    wait(5);
+    printf("PHY off\r\n");
+    PHY_PowerDown();
+    wait(5);
+    printf("Modem off\r\n");
+    mdm.powerOff();
+    wait(5);
+    printf("GPS off\r\n");
+    gps.powerOff();
+    printf("Sleeping\r\n");
+    Timeout t;
+    t.attach(&hello, 5.0f);
+    Sleep();
+    printf("Woke up\r\n");
+    while (true);
 }
\ No newline at end of file
--- a/mbed.bld	Sat Jan 30 02:23:30 2010 +0000
+++ b/mbed.bld	Wed May 27 05:59:21 2015 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/mbed/builds/49a220cc26e0
+http://mbed.org/users/mbed_official/code/mbed/builds/dbbf35b96557
\ No newline at end of file