Fork to support REVB hardware.

Dependents:   C027_BootTest_revb C027_EthernetSniffTest C027_M3_SerialEcho C027_HelloWorld_revb ... more

Fork of C027 by u-blox

Revision:
21:db7c445289f5
Parent:
20:2ae219d82c0e
Child:
22:2ab87e985526
--- 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
     }
 }