Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: battery-charger-bq24295 gnss ublox-cellular-base ublox-cellular-driver-gen
Fork of example-C030-out-of-box-demo by
Revision 2:c95852ac6953, committed 2017-09-26
- Comitter:
- euygun
- Date:
- Tue Sep 26 15:41:17 2017 +0000
- Parent:
- 1:e11c75d931b5
- Child:
- 3:b9051f3f2fcd
- Commit message:
- Fixing the missing code in the previous commit
Changed in this revision
| battery-charger-bq24295.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 |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/battery-charger-bq24295.lib Tue Sep 26 15:41:17 2017 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/teams/ublox/code/battery-charger-bq24295/#2a758bf86bb7
--- a/main.cpp Tue Sep 26 14:49:17 2017 +0000
+++ b/main.cpp Tue Sep 26 15:41:17 2017 +0000
@@ -15,9 +15,13 @@
*/
#include "mbed.h"
+#include "battery_charger_bq24295.h"
#include "UbloxCellularDriverGen.h"
#include "onboard_modem_api.h"
+// Set the minimum input voltage limit for the BQ24295 to 3.8 Volt
+#define MIN_INPUT_VOLTAGE_LIMIT_MV 3880
+
// User LEDs
DigitalOut ledRed(LED1, 1);
DigitalOut ledGreen(LED2, 1);
@@ -34,6 +38,12 @@
InterruptIn userButton(SW0);
#endif
+// i2c3 Bus
+I2C i2c3(I2C_SDA_B, I2C_SCL_B);
+
+// Battery Charger BQ24295
+BatteryChargerBq24295 charger;
+
// Delay between LED changes in second
volatile float delay = 0.5;
@@ -64,6 +74,12 @@
int main()
{
+ // The battery charger initialisation
+ charger.init(&i2c3);
+ charger.setInputVoltageLimit(MIN_INPUT_VOLTAGE_LIMIT_MV);
+ // Disable the battery charger's watchdog, otherwise it resets the battry charger
+ charger.setWatchdog(0);
+
// Initialised the modem
onboard_modem_init();
