BQ27x00
From ArmadeusWiki
How to use the BQ27x00 battery gas gauge.
Before installing the driver, the plateforme file (ie apf27-dev.c) has to be correctly modified to support the BQ27200 i2C chip.
Driver installation
$ make linux26-menuconfig
Device Drivers---> <M> Power supply class support ---> <M> BQ27200 battery driver
$ make
Update the APF27 board with the new Linux kernel and rootfs.
Usage
- Load the module:
modprobe bq27x00_battery
- Read internal temperature:
cat /sys/class/power_supply/bq27200-0/temp
- Read battery voltage:
cat /sys/class/power_supply/bq27200-0/voltage_now
- Read battery current:
cat /sys/class/power_supply/bq27200-0/current_now
Remark: the result (mA) has to be scaled depending on the shunt resistor (typically 0.2 0hms). The formula is then: result*3.57/20.
- Read capacity:
cat /sys/class/power_supply/bq27200-0/capacity
Remark: the capacity can only be estimated after a complete discharge/charge cycle. See BQ27200 datasheet for more informations.