Cellular module AT Serial interface passthrough to Debug COM port. This program can be used on the C030 boards excluding the C030 N2xx version.

Files at this revision

API Documentation at this revision

Comitter:
mudassar0121
Date:
Fri Aug 30 11:26:10 2019 +0500
Parent:
0:fd90bb768e20
Child:
2:7764d92551ff
Commit message:
Updated example for C030_R412M, C030_R410M and C030_U201

Changed in this revision

bq27441.lib Show annotated file Show diff for this revision Revisions of this file
gnss.lib 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-os.lib Show annotated file Show diff for this revision Revisions of this file
ublox-cellular-base.lib Show annotated file Show diff for this revision Revisions of this file
ublox-cellular-driver-gen.lib Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bq27441.lib	Fri Aug 30 11:26:10 2019 +0500
@@ -0,0 +1,1 @@
+https://os.mbed.com/teams/ublox/code/battery-gauge-bq27441/
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gnss.lib	Fri Aug 30 11:26:10 2019 +0500
@@ -0,0 +1,1 @@
+https://mbed.org/teams/ublox/code/gnss/#56eda66d585b
\ No newline at end of file
--- a/main.cpp	Thu May 10 14:53:51 2018 +0000
+++ b/main.cpp	Fri Aug 30 11:26:10 2019 +0500
@@ -14,21 +14,25 @@
  * limitations under the License.
  */
 
+/* The example program for the u-blox C030 boards. It sets up
+ * - the GNSS module  for automatic fix
+ * - the I2C3 Bus to access bq27441 Battery Charger
+ * - the bq27441 Battery Charger.
+ *
+ */
+
 #include "mbed.h"
 #include "gnss.h"
-#include "battery_charger_bq24295.h"
+#include "battery_gauge_bq27441.h"
 #include "UbloxCellularDriverGen.h"
 #include "onboard_modem_api.h"
 
-// Set the minimum input voltage limit for the BQ24295 to 3.8 Volt
+// Set the Baudrate for mcu(pc) and modem(dev)
+#define BAUDRATE 115200
+
+// Set the minimum input voltage limit for the bq27441 to 3.8 Volt
 #define MIN_INPUT_VOLTAGE_LIMIT_MV  3880
 
-/* The example program for the u-blox C030 boards. It sets up
- * - the GNSS module  for automatic fix
- * - the I2C3 Bus to access BQ24295 Battery Charger
- * - the BQ24295 Battery Charger for 3.88 Volt input supply threshold
- * 
- */
 
 // User LEDs
 DigitalOut ledRed(LED1, 1);
@@ -52,8 +56,11 @@
 // i2c3 Bus
 I2C i2c3(I2C_SDA_B, I2C_SCL_B);
     
-// Battery Charger BQ24295
-BatteryChargerBq24295 charger;
+// Battery Charger bq27441
+BatteryGaugeBq27441 charger;
+
+RawSerial  pc(PD_5, PD_6);
+RawSerial  dev(PA_9, PA_10);
 
 // Delay between LED changes in second
 volatile float delay = 0.5;
@@ -76,13 +83,9 @@
         }
     }
 }
-
-RawSerial  pc(PD_5, PD_6);
-RawSerial  dev(PA_9, PA_10);
  
 void dev_recv()
 {
-
     while(dev.readable()) {
         pc.putc(dev.getc());
     }
@@ -90,38 +93,33 @@
  
 void pc_recv()
 {
-
     while(pc.readable()) {
         dev.putc(pc.getc());
     }
 }
+
 /*
 ** Out of the Box Demo for C030 variants
 ** 
 */
-
 int main()
 {
     printf("u-blox C030-R410M Bring-up baseline using Out-of-the-Box Demo\n\r");
 
     // GNSS initialisation
     if(gnss.init()) {
-        printf("GNSS initialised.\n\r");
+        printf("GNSS initialized.\n\r");
     }
     else {
-        printf("GNSS initialisation failure.\n\r");
+        printf("GNSS initialization failure.\n\r");
     }
     
     // The battery charger initialisation
     if(charger.init(&i2c3)) {
-        printf("Battery charger initialised.\n\r");
-               
-        charger.setInputVoltageLimit(MIN_INPUT_VOLTAGE_LIMIT_MV); 
-        // Disable the battery charger's watchdog, otherwise it resets the battry charger
-        charger.setWatchdog(0);
+        printf("Battery charger initialized.\n\r");
     } 
     else {
-        printf("Battery charger initialisation failure.\n\r");    
+        printf("Battery charger initialization failure.\n\r");
     }  
     printf("\n\r"); 
      
@@ -139,16 +137,11 @@
     ledGreen = 1;
     ledBlue = 1;
     
-    pc.baud(115200);
-    dev.baud(115200);
+    pc.baud(BAUDRATE);
+    dev.baud(BAUDRATE);
  
     pc.attach(&pc_recv, Serial::RxIrq);
     dev.attach(&dev_recv, Serial::RxIrq);
- 
-    while(1) {
-        sleep();
-    }
-    
     
     // Main loop
     while(1) {
@@ -161,4 +154,5 @@
     }
 }
 
-// End Of File
\ No newline at end of file
+// End Of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-os.lib	Fri Aug 30 11:26:10 2019 +0500
@@ -0,0 +1,1 @@
+https://github.com/ARMmbed/mbed-os/#73f096399b4cda1f780b140c87afad9446047432
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ublox-cellular-base.lib	Fri Aug 30 11:26:10 2019 +0500
@@ -0,0 +1,1 @@
+https://developer.mbed.org/teams/ublox/code/ublox-cellular-base/#38230504a646
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ublox-cellular-driver-gen.lib	Fri Aug 30 11:26:10 2019 +0500
@@ -0,0 +1,1 @@
+https://mbed.org/teams/ublox/code/ublox-cellular-driver-gen/#a5389248c8d0