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:
7:cc08662947cd
Parent:
3:340d65a1a133
Child:
8:2a758bf86bb7
--- a/bq24295.cpp	Wed Jun 07 10:33:22 2017 +0000
+++ b/bq24295.cpp	Wed Jun 14 17:35:12 2017 +0100
@@ -638,7 +638,7 @@
                 success = setRegister (0x05, reg);
 #ifdef DEBUG_BQ24295
                 if (success) {
-                    printf("BatteryChargerBq24295 (I2C 0x%02x): fast charging safety timer now set to %d hours.\r\n", gAddress >> 1, timerHours);
+                    printf("BatteryChargerBq24295 (I2C 0x%02x): fast charging safety timer now set to %d hours.\r\n", gAddress >> 1, (int) timerHours);
                 }
 #endif
             }
@@ -684,7 +684,7 @@
                     }
                 }
 #ifdef DEBUG_BQ24295
-                printf("BatteryChargerBq24295 (I2C 0x%02x): fast charging safety timer is %d hours.\r\n", gAddress >> 1, *pTimerHours);
+                printf("BatteryChargerBq24295 (I2C 0x%02x): fast charging safety timer is %d hours.\r\n", gAddress >> 1, (int) *pTimerHours);
 #endif
             }
         }
@@ -1171,7 +1171,7 @@
             success = setRegister (0x06, reg);
 #ifdef DEBUG_BQ24295
             if (success) {
-                printf("BatteryChargerBq24295 (I2C 0x%02x): boost mode lower temperature limit now set to %d C.\r\n", gAddress >> 1, temperatureC);
+                printf("BatteryChargerBq24295 (I2C 0x%02x): boost mode lower temperature limit now set to %d C.\r\n", gAddress >> 1, (int) temperatureC);
             }
 #endif
         }
@@ -1210,7 +1210,7 @@
                         break;
                     }
 #ifdef DEBUG_BQ24295
-                    printf("BatteryChargerBq24295 (I2C 0x%02x): boost mode upper temperature limit is %d C.\r\n", gAddress >> 1, *pTemperatureC);
+                    printf("BatteryChargerBq24295 (I2C 0x%02x): boost mode upper temperature limit is %d C.\r\n", gAddress >> 1, (int) *pTemperatureC);
 #endif
                 }
             }
@@ -1594,7 +1594,7 @@
             success = setRegister (0x06, reg);
 #ifdef DEBUG_BQ24295
             if (success) {
-                printf("BatteryChargerBq24295 (I2C 0x%02x): chip thermal regulation threshold now set to %d C.\r\n", gAddress >> 1, temperatureC);
+                printf("BatteryChargerBq24295 (I2C 0x%02x): chip thermal regulation threshold now set to %d C.\r\n", gAddress >> 1, (int) temperatureC);
             }
 #endif
         }
@@ -1634,7 +1634,7 @@
                     break;
                 }
 #ifdef DEBUG_BQ24295
-                printf("BatteryChargerBq24295 (I2C 0x%02x): chip thermal regulation threshold is %d C.\r\n", gAddress >> 1, *pTemperatureC);
+                printf("BatteryChargerBq24295 (I2C 0x%02x): chip thermal regulation threshold is %d C.\r\n", gAddress >> 1, (int) *pTemperatureC);
 #endif
             }
         }
@@ -1717,7 +1717,7 @@
             }
 #ifdef DEBUG_BQ24295
             if (success) {
-                printf("BatteryChargerBq24295 (I2C 0x%02x): watchdog is %d seconds.\r\n", gAddress >> 1, *pWatchdogS);
+                printf("BatteryChargerBq24295 (I2C 0x%02x): watchdog is %d seconds.\r\n", gAddress >> 1, (int) *pWatchdogS);
             }
 #endif
         }
@@ -1752,7 +1752,7 @@
             success = setRegister(0x05, reg);
 #ifdef DEBUG_BQ24295
             if (success) {
-                printf("BatteryChargerBq24295 (I2C 0x%02x): watchdog set to %d seconds.\r\n", gAddress >> 1, watchdogS);
+                printf("BatteryChargerBq24295 (I2C 0x%02x): watchdog set to %d seconds.\r\n", gAddress >> 1, (int) watchdogS);
             }
 #endif
         }