This class provides APIs to all of the registers of the TI BQ24295 battery charger chip, as used on the u-blox C030 board. This class is not required to charge a battery connected to the C030 board, charging will begin automatically when a battery is connected. This class is only required if the user wishes to monitor the charger's state or change the charger's settings. The caller should instantiate an I2C interface and pass this to init(), which will initialise the chip and place it into its lowest power state. The chip may then be configured using the API calls. Once the chip is configured, battery charging can be enabled. If battery charging is disabled the chip will once more be put into its lowest power state.

Dependents:   example-battery-charger-bq24295 example-C030-out-of-box-demo example-C030-out-of-box-demo Amit

Revision:
3:340d65a1a133
Parent:
2:f0bbe0269d67
Child:
8:2a758bf86bb7
--- a/battery_charger_bq24295.h	Tue Apr 11 09:56:38 2017 +0000
+++ b/battery_charger_bq24295.h	Tue Jun 06 12:59:11 2017 +0100
@@ -71,8 +71,11 @@
     /** Initialise the BQ24295 chip.
     * After initialisation the chip will be put into its lowest
     * power state and should be configured if the default settings
-    * are not satisfactory.  Once the chip is correctly configured,
-    * charging should be enabled.
+    * are not satisfactory.
+    * Note: the BQ24295 charging chip will automonously charge a
+    * LiPo cell that is connected to it, without host interaction.
+    * This class is only required where the configuration of the
+    * chip needs to be changed or the charger state is to be monitored.
     * @param pI2c a pointer to the I2C instance to use.
     * @param address 7-bit I2C address of the battery charger chip.
     * @return true if successful, otherwise false.
@@ -397,6 +400,26 @@
     */
     char getChargerFaults(void);
     
+    /** Feed the watchdog timer.
+    * Use this if it is necessary to keep the BQ24295 chip in Host
+    * mode (see section 8.4.1 of the data sheet for details).
+    * @return true if successful, otherwise false.
+    */
+    bool feedWatchdog(void);
+    
+    /** Get the watchdog timer of the BQ24295 chip.
+    * @param pWatchdogS a place to put the watchdog timer (in seconds).
+    * @return true if successful, otherwise false.
+    */
+    bool getWatchdog (int32_t *pWatchdogS);
+    
+    /** Set the watchdog timer of the BQ24295 chip.
+    * @param watchdogS the watchdog timer (in seconds), 0 to disable,
+    *                  max 160 seconds.
+    * @return true if successful, otherwise false.
+    */
+    bool setWatchdog (int32_t watchdogS);
+    
     /** Enable shipping mode.
     * In shipping mode the battery is disconnected from the system
     * to avoid leakage.  Default is disabled.