Hi K.U.

El Thu, Aug 02, 2012 at 03:32:16AM -0700 K.U. ha dit:

>    I am working on an Android-ICS porting project onto a custom Android Tab,
>    which uses AM3730 (TI's ARM) processor. The device is based on the
>    BeagleBoard architecture. The device has a fuel guage (BQ27200) and a
>    charger IC (BQ24150) which communicates with a
>    MSP430 micro-controller firmware.
>    My main problem is how to display the battery status through the "battery
>    icon" on the taskbar? Also I am aware that the other battery related
>    operations/status (charging, discharging, battery low, fully charged)
>    could also be read by the Android system and act accordingly. I could not
>    find a clear set of instructions on how to integrate these features with
>    android.
>    Can some one kindly direct me to a link/site where I can find a guide for
>    this task? Or if any of you can take the time to reply this post, it will
>    be greatly appreciated.

Android gets the battery and charger status from the power supply
devices registered in the kernel. whenever the status of a
power supply changes (charging/discharging, battery level, charger
plugged/unplugged, ...), the kernel sends a so called uevent
(userspace event). user processes can register to these uevents, which
is what Androids BatteryService does. when the BatteryService is
notified about a change in a power supply it reads the updated status
of the power supply from sysfs and sends out the corresponding intents
which cause the update of the battery icon and so on

for the BQ27200 fuel gauge you have the bq27x00_battery driver in the
kernel (drivers/power/bq27x00_battery.c), which provides the
battery status through uevents and sysfs as outlined above. if
configured correctly you should see on your running system a power
supply of type battery in /sys/class/power_supply/ with attributes
like the current battery capacity or the charging status

best regards

-- 
Matthias Kaehlcke
Embedded Linux Developer
Amsterdam

        Representation of the world, like the world itself, is
        the work of men; they describe it from their own point
         of view, which they  confuse with the absolute truth
                          (Simone de Beauvoir)
                                                                 .''`.
    using free software / Debian GNU/Linux | http://debian.org  : :'  :
                                                                `. `'`
gpg --keyserver pgp.mit.edu --recv-keys 47D8E5D4                  `-

-- 
unsubscribe: [email protected]
website: http://groups.google.com/group/android-porting

Reply via email to