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:
20:2ae219d82c0e
Parent:
19:82c9967207f1
Child:
21:db7c445289f5
--- a/C027.cpp	Fri Dec 13 20:10:00 2013 +0000
+++ b/C027.cpp	Fri Dec 13 20:21:59 2013 +0000
@@ -25,7 +25,7 @@
     }
 }
 
-C027::C027() :
+C027::C027():
     mdmEn(MDMEN),       mdmRst(MDMRST),         mdmPwrOn(MDMPWRON),   // MDM CTRL
     mdmLvlOe(MDMLVLOE), mdmILvlOe(MDMILVLOE),   mdmUsbDet(MDMUSBDET), // MDM IF
     gpsEn(GPSEN),       gpsRst(GPSRST)                                // GPS CTRL
@@ -42,18 +42,19 @@
     mdmLvlOe  = 1;  // LVLEN:  1=disabled (uart/gpio)
     mdmILvlOe = 1;  // ILVLEN: 0=disabled (i2c)
     mdmUsbDet = 1;  // USBDET: 0=disabled
+  
+
     mdmPwrOn  = 1;  // PWRON:  1=idle, 0=action
     mdmEn     = 0;  // LDOEN:  1=on, 0=off
     mdmRst    = 1;  // RESET:  0=reset, 1=operating
     mdmIsEnabled = false;
-    mdmUseUsb = false;
-    
-    
+    mdmUseUsb = false;    
+
     // The USB insertion and removal, and the Reset Button 
     // can cause multiple resets to the device.  Wait for
     // a period of time for this to settle before proceeding
     // with turning on various components on the board.
-    wait_ms(3000);  
+    wait_ms(3000);      
 }
 
 void C027::LeakageTest( void )
@@ -65,10 +66,12 @@
     mdmPwrOn  = 1;  //hi (no meaning this context)
 }
 
-void C027::mdmPower(bool enable)
+void C027::mdmPower(bool enable, bool use_mdmuart)
 {
     if (!mdmIsEnabled && enable) // enable modem
     {
+        mdmUsbDet = ( use_mdmuart? 0:1 ); // USBDET: 0=enable uart, 1=USB Only
+        wait_ms(10); 
         mdmEn     = 1;  // LDOEN:  0=off -> 1=on
         wait_ms(50);    //         RST line will come up as soon as 
         mdmPwrOn  = 0;  // PWRON:  0=turn on -> 1=idle