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 19:25:26 2013 +0000
Parent:
17:cd02fb66a5fc
Commit message:
Add parameter to power functionality, so we determine at that point whether the LISA will use USB or UART (really, whether we allow uart to be enabled)

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 00:36:38 2013 +0000
+++ b/C027.cpp	Fri Dec 13 19:25:26 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,11 +42,13 @@
     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;    
 }
 
 void C027::LeakageTest( void )
@@ -58,10 +60,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
--- a/C027.h	Fri Dec 13 00:36:38 2013 +0000
+++ b/C027.h	Fri Dec 13 19:25:26 2013 +0000
@@ -20,7 +20,7 @@
 public:
     C027();
 
-    void mdmPower(bool enable);
+    void mdmPower(bool enable, bool use_mdmuart);
     void mdmUsbEnable(bool enable); // enable the USB interface
     void mdmReset(void);
     void mdmWakeup(void);