Fork to support REVB hardware.

Dependents:   C027_BootTest_revb C027_EthernetSniffTest C027_M3_SerialEcho C027_HelloWorld_revb ... more

Fork of C027 by u-blox

Files at this revision

API Documentation at this revision

Comitter:
dixter1
Date:
Fri Dec 13 23:32:11 2013 +0000
Parent:
20:2ae219d82c0e
Child:
22:2ab87e985526
Commit message:
GPS Cleanup, and Switch for M3 vs LISA for GPS Signals.

Changed in this revision

C027.cpp Show annotated file Show diff for this revision Revisions of this file
C027.h Show annotated file Show diff for this revision Revisions of this file
--- a/C027.cpp	Fri Dec 13 20:21:59 2013 +0000
+++ b/C027.cpp	Fri Dec 13 23:32:11 2013 +0000
@@ -94,12 +94,7 @@
         // now we can savely switch off the ldo
         mdmRst    = 0;  // RESET:  1=operating -> 0=reset
         mdmEn     = 0;  // LDOEN:  1=on -> 0=off
-#ifdef C027_REVA
-        // the gps ldo may no longer be needed level shifters of the modem
-        // so we switch it off if the gps is not enabled
-        if (!gpsIsEnabled)
-            gpsEn = 0;  // LDOEN(gps): 1=on -> 0=off
-#endif
+        gpsEn     = 0;  // LDOEN(gps): 1=on -> 0=off
     }
         
 }
@@ -155,7 +150,9 @@
     }
 }
 
-void C027::gpsPower(bool enable)
+// enable:    enable the gps power
+// lisa_gps:  connect GPS to the LISA chip
+void C027::gpsPower(bool enable, bool lisa_gps )
 {
     if (!gpsIsEnabled && enable) // enable gps
     {
@@ -165,21 +162,21 @@
         gpsRst   = 1;   // RESET: 0=reset -> 1=operating
         gpsIsEnabled = true;
         // the gps schould be fully ready after 50ms
-        if (mdmIsEnabled) 
-            mdmILvlOe = 1; // ILVLEN: 0=enabled (i2c)
+        if (mdmIsEnabled && lisa_gps ) 
+        {
+            mdmILvlOe = 0; // ILVLEN: 0=enabled (i2c)
+        }
+        else
+        {
+            mdmILvlOe = 1; // ILVLEN: 0=enabled (i2c)        
+        }
     }
     else if (gpsIsEnabled && !enable) // diasble gps
     {
         gpsIsEnabled = false;
         mdmILvlOe = 0;   // ILVLEN: 0=disabled (i2c)
         gpsRst    = 0;   // RESET: 1=operating -> 0=reset
-#ifdef C027_REVA
-        // the gps ldo may have to remain enabled for the level shifters of the modem
-        if (!mdmIsEnabled) 
-            gpsEn = 0;   // LDOEN: 1=on -> 0=off 
-#else
         gpsEn     = 0;   // LDOEN: 1=on -> 0=off 
-#endif
     }
 }
 
--- a/C027.h	Fri Dec 13 20:21:59 2013 +0000
+++ b/C027.h	Fri Dec 13 23:32:11 2013 +0000
@@ -13,8 +13,6 @@
 // We do not have fancy leds that can be flashed on the C027.
 void mbed_die(void);
 
-//#define C027_REVA // remove this define for the revision B boards
-
 class C027
 {
 public:
@@ -25,7 +23,7 @@
     void mdmReset(void);
     void mdmWakeup(void);
     void mdmSleep(void);
-    void gpsPower(bool enable);
+    void gpsPower(bool enable, bool lisa_gps);
     void gpsReset(void);
     void LeakageTest(void);