BQ27x00: Difference between revisions

From ArmadeusWiki
(New page: How to use the BQ27x00 battery charger Before installing the driver, the plateforme file (ie apf27-dev.c) has to be correctly modified to support the BQ27200 i2C chip. ==Driver installat...)
 
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
How to use the BQ27x00 battery charger
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.
Before trying to use the driver, the plateform file (ex apf27-dev.c) has to be correctly modified to support the BQ27200 I2C chip.


==Driver installation==
==Driver installation==
<pre class="host">
<pre class="host">
  $ make linux26-menuconfig
  $ make linux-menuconfig
</pre>
</pre>


Line 47: Line 47:
</pre>
</pre>
Remark: the capacity can only be estimated after a complete discharge/charge cycle. See BQ27200 datasheet for more informations.
Remark: the capacity can only be estimated after a complete discharge/charge cycle. See BQ27200 datasheet for more informations.


==Links==
==Links==

Latest revision as of 18:08, 4 September 2013

How to use the BQ27x00 battery gas gauge.

Before trying to use the driver, the plateform file (ex apf27-dev.c) has to be correctly modified to support the BQ27200 I2C chip.

Driver installation

 $ make linux-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.

Links