first draft for putting bq24150 into fastcharge mode at a reasonable charge end voltage, and keep it in charge mode until battery is full:
Code:
i2cset -y -m 0x77 2 0x6b 0x04 0xc9;
# next register 0x03 is device ID, always 4b and r/o; so we skip to 0x04
i2cset -y -m 0xff 2 0x6b 0x02 0x8c;
# 0x8c = 3v5 + .640 + .040 + .020 = 4V200, BE CAREFUL and DON'T CHANGE
# unless you know what you're doing. 4V2 is ABS MAX!
i2cset -y -m 0xff 2 0x6b 0x01 0xc8;
i2cset -y -m 0xc0 2 0x6b 0x00 0x00;
# tickle watchdog, while status indicates 'charging from wallcharger'
while [ $(i2cget -y 2 0x6b 0x00) = 0x90 ] ; do
sleep 28;
# reset watchdog timer:
i2cset -y -m 0x80 2 0x6b 0x00 0x80;
done
echo "charging finished, status(reg0)=$(i2cget -y 2 0x6b 0x00)"
above code not yet tested, but should result in
Code:
Nokia-N900-02-8:~# ~user/i2c/i2cdump -y -r 0-4 2 0x6b
No size specified (using byte-data access)
0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
00: 90 c8 8c 4b c9 ???K?
which is what bme sets bq24150 to, during normal charge process
Usual disclaimer:
this is addressed to developers only, who exactly understand the above code. ENDUSERS STAY AWAY
cheers
jOERG