Example program to demonstrate the use of the BatteryChargerBQ24295 class.

Dependencies:   battery-charger-bq24295

Files at this revision

API Documentation at this revision

Comitter:
RobMeades
Date:
Tue Jun 06 08:27:25 2017 +0000
Child:
1:18ffb01b6380
Commit message:
Initial revision: note that this will NOT compile until mbed 5.5 is published.

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
mbed-os.lib 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 Jun 06 08:27:25 2017 +0000
@@ -0,0 +1,1 @@
+https://developer.mbed.org/teams/ublox/code/battery-charger-bq24295/#f0bbe0269d67
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Tue Jun 06 08:27:25 2017 +0000
@@ -0,0 +1,44 @@
+/* mbed Microcontroller Library
+ * Copyright (c) 2017 u-blox
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "mbed.h"
+#include "battery_charger_bq24295.h"
+
+// LEDs
+DigitalOut ledRed(LED1, 1);
+DigitalOut ledGreen(LED2, 1);
+
+/* This example program for the u-blox C030 board instantiates
+ * the BQ24295 battery charger interface and performs a few
+ * example calls to the battery charger API.  Progress may be
+ * monitored with a serial terminal running at 9600 baud.  The
+ * LED on the C030 board will turn green when this program is
+ * operating correctly and will turn red if there is a failure.
+ */
+
+int main()
+{
+    BatteryChargerBq24295 charger;
+    I2C i2C(I2C_SDA_B, I2C_SCL_B);
+
+    charger.init(&i2C);
+    while (1) {
+        ledGreen = 0;
+        // Do something
+    }
+}
+
+// End Of File
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-os.lib	Tue Jun 06 08:27:25 2017 +0000
@@ -0,0 +1,1 @@
+https://github.com/ARMmbed/mbed-os/#5fff7e1daeb395aa3d1ecf3f9ec3f4fead3de0c2