This class provides APIs to all of the registers of the TI BQ27441 battery gauge, as used on the u-blox C030 board. 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. When battery gauging is enabled, the getRemainingCapacity()/getRemainingPercentage() API calls may be used; otherwise the chip will be maintained in its lowest power state until a voltage/current/temperature reading is requested.

Dependents:   example-battery-gauge-bq27441

Revision:
6:998cc334f8f2
Parent:
5:63b325f2c21a
--- a/battery_gauge_bq27441.h	Wed Jun 14 17:11:40 2017 +0100
+++ b/battery_gauge_bq27441.h	Wed Dec 13 17:14:51 2017 +0000
@@ -113,8 +113,20 @@
     * @return true if successful, otherwise false.
     */
     bool getVoltage (int32_t *pVoltageMV);
+    
+    /** Read the power output the battery.
+    * If battery gauging is off this function will take ~1 second
+    * to return while the ADCs are activated and the reading is taken.
+    * If battery gauging is on, the last voltage reading taken
+    * will be returned without delay.
+    * @param pPowerMW place to put the power reading.
+    * @return true if successful, otherwise false.
+    */
+    bool getPower (int32_t *pPowerMW);
 
     /** Read the current flowing from the battery.
+    * Negative value means battery is being drained
+    * Positive value means battery is being charged
     * If battery gauging is off this function will take ~1 second
     * to return while the ADCs are activated and the reading is taken.
     * If battery gauging is on, the last current reading taken
@@ -242,6 +254,14 @@
     * @return true if successful, otherwise false.
     */
     bool getTwoBytes (uint8_t registerAddress, uint16_t *pBytes);
+    
+    /** Read two bytes starting at a given address (signed int16).
+    * Note: gpI2c should be locked before this is called.
+    * @param registerAddress the register address to start reading from.
+    * @param pBytes place to put the two bytes.
+    * @return true if successful, otherwise false.
+    */
+    bool getTwoBytesSigned (uint8_t registerAddress, int16_t *pBytes);
 
     /** Compute the checksum of a block of memory in the chip.
     * @param pData a pointer to the 32 byte data block.