summaryrefslogtreecommitdiff
path: root/firmware/drivers/pcf50605.c
diff options
context:
space:
mode:
authorBrandon Low <lostlogic@rockbox.org>2006-03-09 01:36:22 +0000
committerBrandon Low <lostlogic@rockbox.org>2006-03-09 01:36:22 +0000
commitca9e8b6cf5d1bdadf0040eb2f4baec1cbd5e3d7a (patch)
tree4b3253906eb2397fe80ac747f6873878fc11861a /firmware/drivers/pcf50605.c
parentc24569feeedc9e6bda80b84d9dd6398f1bb9c586 (diff)
downloadrockbox-ca9e8b6cf5d1bdadf0040eb2f4baec1cbd5e3d7a.tar.gz
rockbox-ca9e8b6cf5d1bdadf0040eb2f4baec1cbd5e3d7a.zip
Use an 8 bit ADC read for battery reading on ipod, that provides better than centivolt precision any way, also enable charging, it seems to detect fine when charging by USB
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8966 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers/pcf50605.c')
-rw-r--r--firmware/drivers/pcf50605.c12
1 files changed, 0 insertions, 12 deletions
diff --git a/firmware/drivers/pcf50605.c b/firmware/drivers/pcf50605.c
index 7d2036e807..c8ea4a499f 100644
--- a/firmware/drivers/pcf50605.c
+++ b/firmware/drivers/pcf50605.c
@@ -98,18 +98,6 @@ int pcf50605_write_multiple(int address, const unsigned char* buf, int count)
98 return 0; 98 return 0;
99} 99}
100 100
101unsigned short pcf50605_a2d_read(int adc_input)
102{
103 unsigned short hi;
104 unsigned char lo;
105
106 ipod_i2c_send(0x8, 0x2f, (adc_input<<1) | 0x1); /* ADCC2, ADCMUX = adc_input, ADCSTART = 1 */
107 hi = i2c_readbyte(0x8, 0x30); /* ADCS1 */
108 lo = (i2c_readbyte(0x8, 0x31) & 0x3); /* ADCS2 */
109
110 return (hi << 2) | lo;
111}
112
113/* The following command puts the iPod into a deep sleep. Warning 101/* The following command puts the iPod into a deep sleep. Warning
114 from the good people of ipodlinux - never issue this command 102 from the good people of ipodlinux - never issue this command
115 without setting CHGWAK or EXTONWAK if you ever want to be able to 103 without setting CHGWAK or EXTONWAK if you ever want to be able to