| The Following 79 Users Say Thank You to NIN101 For This Useful Post: | ||
AapoRantalainen, aathava, abill_uk, ade, ahmadamaj, Alfred, arora.rohan, behrooz, bingomion, c4rl05, Captwheeto, conred, Copernicus, corduroysack, cproc, debernardis, don_falcone, dzano, eddieselamp, ejasmudar, elyout, ersanpermana, Estel, Fabry, fw190, gregoranderson, Helmuth, hirabayashitaro, Hurrian, isfr21, ivyking, joerg_rw, JorgeFX, jpala16, krutznikov, Lemonadium, Magik, Maj3stic, MartinK, Megaltariak, melisa queen, Mentalist Traceur, MFaroTusino, michaelxy, moepda, mosiomm, mrsellout, mr_jrt, mr_pingu, n0idea, N900L, Netweaver, nicolai, nkirk, Oboroten, onil, p24, panjgoori, Pantokrator, peterleinchen, pichlo, prankster, PUNK, qhubekela, reinob, sethkha, shanttu, Sin, sinaisix, Skaven2k2, Skry, Sourav.dubey, SSLMM, techno2001, unknown.obvious, Wikiwide, wumpwoast, Zaerc, zoner | ||
|
|
07-31-2011
, 11:15 AM
|
|
Banned |
Posts: 696 |
Thanked: 308 times |
Joined on Apr 2011
@ originally pakistan ,now in china
|
#2
|
|
|
07-31-2011
, 11:21 AM
|
|
Banned |
Posts: 3,412 |
Thanked: 1,043 times |
Joined on Feb 2010
|
#3
|
|
|
07-31-2011
, 03:53 PM
|
|
|
Posts: 474 |
Thanked: 195 times |
Joined on Jun 2010
@ India, Mumbai
|
#4
|
|
|
08-01-2011
, 11:12 PM
|
|
|
Posts: 1,101 |
Thanked: 671 times |
Joined on Apr 2010
@ Australia
|
#5
|
I would!
|
|
08-02-2011
, 05:29 AM
|
|
Posts: 103 |
Thanked: 267 times |
Joined on Dec 2010
|
#6
|
| The Following 9 Users Say Thank You to NIN101 For This Useful Post: | ||
|
|
08-02-2011
, 08:48 PM
|
|
Posts: 296 |
Thanked: 184 times |
Joined on Dec 2009
@ Norway
|
#7
|

|
|
08-03-2011
, 08:26 AM
|
|
Posts: 828 |
Thanked: 1,131 times |
Joined on May 2010
|
#9
|
Once RescueOS can charge the battery, I think more people will find a usecase for it.
#/bin/bash
# Reset
#echo -n Reset...
#i2cset -y -m 0x80 2 0x6b 0x04 80
#echo -n Done. Sleep 1...
#sleep 1
#echo -n Done.
#echo "Charger: " $(cat /sys/devices/platform/musb_hdrc/charger)
# Disable charger for configuration:
i2cset -y 2 0x6b 0x01 0xcc # No limit, 3.4V weak threshold, enable term, charger disable
# Register 0x04
# 8: reset
# 4: 27.2mV # charge current
# 2: 13.6mV
# 1: 6.8mV
# 8: N/A
# 4: 13.6mV # termination current
# 2: 6.8mV
# 1: 3.4mV
# 7-1250 6-1150 5-1050 4-950 3-850 2-750 1-650 0-550
# 7-400 6-350 5-300 4-250 3-200 2-150 1-100 0-50
i2cset -y -m 0xFF 2 0x6b 0x04 0x50;
# Register 0x02
# 8: .640 V
# 4: .320 V
# 2: .160 V
# 1: .080
# 8: .040
# 4: .020 (+ 3.5)
# 2: otg pin active at high (default 1)
# 1: enable otg pin
i2cset -y -m 0xfc 2 0x6b 0x02 0x8c;
# 4.2 = 3.5 + .640 + .040 + .02 = 8c
# 4.16 = 3.5 + .640V + .020 = 84
# 4.1 = 3.5 + .320 + .160 + .08 + .04 = 78
# 4.0 = 3.5 + .320 + .160 + .02 = 64
# 3.9 = 3.5 + .320 + .080 = 50
# Register 0x1
# 8: 00 = 100, 01 = 500, 10 = 800mA
# 4: 11 = no limit
# 2: 200mV weak threshold default 1
# 1: 100mV weak treshold defsult 1 (3.4 - 3.7)
# 8: enable termination
# 4: charger disable
# 2: high imp mode
# 1: boost
i2cset -y 2 0x6b 0x01 0xc8;
# Register 0x00
# 8: Read: OTG Pin Status
# Write: Timer Reset
# 4: Enable Stat Pin
# 2: Stat : 00 Ready 01 In Progress
# 1: : 10 Done 11 Fault
# 8: Boost Mode
# 4: Fault: 000 Normal 001 VBUS OVP 010 Sleep Mode
# 2: 011 Poor input or Vbus < UVLO
# 1: 100 Battery OVP 101 Thermal Shutdown
# 110 Timer Fault 111 NA
i2cset -y 2 0x6b 0x00 0x00;
#echo -n "Charge parameters programmed. Sleep 1..."
sleep 1
#echo "Status: " $(i2cget -y 2 0x6b 0x00)
i2cset -y 2 0x6b 0x00 0x80 # timer reset
cat /sys/devices/platform/musb_hdrc/charger >/dev/null
# Initialize variables
THROTTLE=0
FULL=0
MODE="STANDBY"
WALLCHARGER=0
# Assuming a nice round number 20mOhm for bq27200 sense resistor
RS=20
get_nac ()
{
NAC=$(i2cget -y 2 0x55 0x0c w)
NAC=$(($NAC * 3570 / $RS / 1000))
}
get_rsoc ()
{
RSOC=$(i2cget -y 2 0x55 0x0b)
RSOC=$((RSOC))
}
get_volt ()
{
VOLT=$(i2cget -y 2 0x55 0x08 w)
VOLT=$(($VOLT))
}
STATUS=$(i2cget -y 2 0x6b 0x00)
while true ; do
sleep 15;
STATUS=$(i2cget -y 2 0x6b 0x00)
#echo $STATUS
i2cset -y -m 0x80 2 0x6b 0x00 0x80; # timer reset
get_nac
get_rsoc
get_volt
if [ $MODE == "STANDBY" ] ; then
if [ $STATUS == 0x10 ] || [ $STATUS == 0x90 ] ; then
MODE="CHARGING"
#echo $(date) "standby -> CHARGING. Current available capacity: " $NAC "mAh" >> /home/user/MyDocs/charger.log
echo 60 > /sys/class/backlight/acx565akm/brightness
WALLCHARGER=$(cat /sys/devices/platform/musb_hdrc/charger)
fi
fi
if [ $MODE == "CHARGING" ] ; then
if [ $STATUS == 0x00 ] ; then
MODE="STANDBY"
echo 15 > /sys/class/backlight/acx565akm/brightness
#echo $(date) "charging -> STANDBY. Current available capacity: " $NAC "mAh" >> /home/user/MyDocs/charger.log
WALLCHARGER=0
# This will stop USB from eating power as long as you haven't plugged it into a PC
echo 0 > /sys/devices/platform/musb_hdrc/connect
fi
fi
if [ $STATUS == 0xa0 ] && [ $FULL == 0 ] ; then
#echo "Charge done"
#echo $(date) "FULL: " $NAC "mAh" >> /home/user/MyDocs/charger.log
FULL=1
fi
if [ $STATUS == 0x00 ] && [ $FULL == 1 ] ; then
FULL=0
fi
echo Status: $STATUS Mode: $MODE Full: $FULL WallCharger: $WALLCHARGER Battery Voltage: $VOLT NAC: $NAC Battery level: $RSOC %
done
|
|
08-12-2011
, 08:35 AM
|
|
Posts: 201 |
Thanked: 56 times |
Joined on May 2010
|
#10
|
![]() |
| Thread Tools | Search this Thread |
|
Please keep in mind that this is a testing release which might mean that something won't work. It comes with absolutely no warranty! Usage at own risk
To use it, you need to be familiar with the linux console.
Version 1.0:
Download: here
This project is not the meego rescue initrd.
Thx to: The meego project(mainly for the kernel), #maemo on freenode and everyone who's work I have used here :-).
Update 2012-12-30
I've stopped working on it for quite some time. This doesn't necessarily mean that it won't see changes anymore though. In particular, localized keymaps will be very helpful. Feel free to help out! For example, you can finish the german version, but keymaps for any N900 keyboard out there are very welcome.
Other ideas:
-Integrating backupmenu
-more...
Last edited by NIN101; 03-23-2013 at 06:24 PM. Reason: Information