summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndree Buschmann <AndreeBuschmann@t-online.de>2010-02-16 22:53:54 +0000
committerAndree Buschmann <AndreeBuschmann@t-online.de>2010-02-16 22:53:54 +0000
commit909e4c6c06e004a6063cab014c12bcef6a2b37e5 (patch)
treeb64c604449db683cf13928cda463131bfb0696f0
parent53b1af7a61898ac76a94018fc1863c2a2abf9d3c (diff)
downloadrockbox-909e4c6c06e004a6063cab014c12bcef6a2b37e5.tar.gz
rockbox-909e4c6c06e004a6063cab014c12bcef6a2b37e5.zip
Add iPod 3G and iPod Color/Photo (FS#9072) current consumption and battery discharge curves to allow reasonable runtime estimation.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24709 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/export/config/ipod3g.h7
-rw-r--r--firmware/export/config/ipodcolor.h7
-rw-r--r--firmware/target/arm/ipod/powermgmt-ipod-pcf.c65
3 files changed, 55 insertions, 24 deletions
diff --git a/firmware/export/config/ipod3g.h b/firmware/export/config/ipod3g.h
index e82cc92f56..2eafe8141d 100644
--- a/firmware/export/config/ipod3g.h
+++ b/firmware/export/config/ipod3g.h
@@ -127,6 +127,13 @@
127/* Hardware controlled charging? FIXME */ 127/* Hardware controlled charging? FIXME */
128#define CONFIG_CHARGING CHARGING_SIMPLE 128#define CONFIG_CHARGING CHARGING_SIMPLE
129 129
130/* define current usage levels */
131#define CURRENT_NORMAL 275 /* ~4h (1100mAh) */
132#define CURRENT_BACKLIGHT 20 /* FIXME: this needs adjusting */
133#if defined(HAVE_RECORDING)
134#define CURRENT_RECORD 35 /* FIXME: this needs adjusting */
135#endif
136
130/* Define this if you have a PortalPlayer PP5002 */ 137/* Define this if you have a PortalPlayer PP5002 */
131#define CONFIG_CPU PP5002 138#define CONFIG_CPU PP5002
132 139
diff --git a/firmware/export/config/ipodcolor.h b/firmware/export/config/ipodcolor.h
index c0168d9886..aa76f7420a 100644
--- a/firmware/export/config/ipodcolor.h
+++ b/firmware/export/config/ipodcolor.h
@@ -121,6 +121,13 @@
121/* define this if the unit can be powered or charged via USB */ 121/* define this if the unit can be powered or charged via USB */
122#define HAVE_USB_POWER 122#define HAVE_USB_POWER
123 123
124/* define current usage levels */
125#define CURRENT_NORMAL 69 /* ~10h (700mAh), see FS#9072 */
126#define CURRENT_BACKLIGHT 20 /* FIXME: this needs adjusting */
127#if defined(HAVE_RECORDING)
128#define CURRENT_RECORD 35 /* FIXME: this needs adjusting */
129#endif
130
124/* Define Apple remote tuner */ 131/* Define Apple remote tuner */
125#define CONFIG_TUNER IPOD_REMOTE_TUNER 132#define CONFIG_TUNER IPOD_REMOTE_TUNER
126#define HAVE_RDS_CAP 133#define HAVE_RDS_CAP
diff --git a/firmware/target/arm/ipod/powermgmt-ipod-pcf.c b/firmware/target/arm/ipod/powermgmt-ipod-pcf.c
index 703d1da833..5b8f974fda 100644
--- a/firmware/target/arm/ipod/powermgmt-ipod-pcf.c
+++ b/firmware/target/arm/ipod/powermgmt-ipod-pcf.c
@@ -28,44 +28,55 @@
28 28
29const unsigned short battery_level_dangerous[BATTERY_TYPES_COUNT] = 29const unsigned short battery_level_dangerous[BATTERY_TYPES_COUNT] =
30{ 30{
31#ifdef IPOD_NANO 31#if defined(IPOD_NANO)
32 3330 32 3330
33#elif defined IPOD_VIDEO 33#elif defined(IPOD_VIDEO)
34 3300 34 3300
35#elif defined(IPOD_COLOR)
36 3300
37#elif defined(IPOD_3G)
38 3700
35#else 39#else
36 /* FIXME: calibrate value for other 3G+ ipods */ 40 /* FIXME: calibrate value for other iPods */
37 3380 41 3300
38#endif 42#endif
39}; 43};
40 44
41const unsigned short battery_level_shutoff[BATTERY_TYPES_COUNT] = 45const unsigned short battery_level_shutoff[BATTERY_TYPES_COUNT] =
42{ 46{
43#ifdef IPOD_NANO 47#if defined(IPOD_NANO)
44 3230 48 3230
45#elif defined IPOD_VIDEO 49#elif defined(IPOD_VIDEO)
46 3300 50 3300
51#elif defined(IPOD_COLOR)
52 3300
53#elif defined(IPOD_3G)
54 3500
47#else 55#else
48 /* FIXME: calibrate value for other 3G+ ipods */ 56 /* FIXME: calibrate value for other iPods */
49 3020 57 3000
50#endif 58#endif
51}; 59};
52 60
53/* voltages (millivolt) of 0%, 10%, ... 100% when charging disabled */ 61/* voltages (millivolt) of 0%, 10%, ... 100% when charging disabled */
54const unsigned short percent_to_volt_discharge[BATTERY_TYPES_COUNT][11] = 62const unsigned short percent_to_volt_discharge[BATTERY_TYPES_COUNT][11] =
55{ 63{
56#ifdef IPOD_NANO 64#if defined(IPOD_NANO)
57 /* measured values */ 65 /* measured values */
58 { 3230, 3620, 3700, 3730, 3750, 3780, 3830, 3890, 3950, 4030, 4160 }, 66 { 3230, 3620, 3700, 3730, 3750, 3780, 3830, 3890, 3950, 4030, 4160 },
59#elif defined IPOD_VIDEO 67#elif defined(IPOD_VIDEO)
60 /* iPOD Video 30GB Li-Ion 400mAh, first approach based upon measurements */ 68 /* iPod Video 30GB Li-Ion 400mAh, first approach based upon measurements */
61 { 3450, 3670, 3710, 3750, 3790, 3830, 3870, 3930, 4010, 4100, 4180 }, 69 { 3450, 3670, 3710, 3750, 3790, 3830, 3870, 3930, 4010, 4100, 4180 },
62#elif defined IPOD_COLOR 70#elif defined(IPOD_COLOR)
63 /* iPOD Color 60GB Li-Ion, first approach based upon measurements */ 71 /* iPod Photo 30GB, see FS#9072 */
64 { 3500, 3676, 3729, 3755, 3778, 3805, 3847, 3919, 3961, 4071, 4109 }, 72 { 3450, 3660, 3700, 3730, 3750, 3770, 3820, 3870, 3920, 4040, 4170 },
73#elif defined(IPOD_3G)
74 /* iPod 3G 40GB, first approach based upon measurements */
75 { 3720, 3740, 3760, 3780, 3830, 3870, 3910, 3970, 4020, 4060, 4090 },
65#else 76#else
66 /* FIXME: calibrate value for other 3G+ ipods */ 77 /* FIXME: calibrate value for other iPods */
67 /* Table is "inherited" from iriver H100. */ 78 /* Table is "provisional" from IPOD_COLOR */
68 { 3370, 3650, 3700, 3740, 3780, 3820, 3870, 3930, 4000, 4080, 4160 } 79 { 3450, 3660, 3700, 3730, 3750, 3770, 3820, 3870, 3920, 4040, 4170 }
69#endif 80#endif
70}; 81};
71 82
@@ -73,16 +84,22 @@ const unsigned short percent_to_volt_discharge[BATTERY_TYPES_COUNT][11] =
73/* voltages (millivolt) of 0%, 10%, ... 100% when charging enabled */ 84/* voltages (millivolt) of 0%, 10%, ... 100% when charging enabled */
74const unsigned short percent_to_volt_charge[11] = 85const unsigned short percent_to_volt_charge[11] =
75{ 86{
76#ifdef IPOD_NANO 87#if defined(IPOD_NANO)
77 /* measured values */ 88 /* measured values */
78 3230, 3620, 3700, 3730, 3750, 3780, 3830, 3890, 3950, 4030, 4160 89 3230, 3620, 3700, 3730, 3750, 3780, 3830, 3890, 3950, 4030, 4160
79#elif defined IPOD_VIDEO 90#elif defined(IPOD_VIDEO)
80 /* iPOD Video 30GB Li-Ion 400mAh, first approach based upon measurements */ 91 /* iPOD Video 30GB Li-Ion 400mAh, first approach based upon measurements */
81 3450, 3670, 3710, 3750, 3790, 3830, 3870, 3930, 4010, 4100, 4180 92 3450, 3670, 3710, 3750, 3790, 3830, 3870, 3930, 4010, 4100, 4180
93#elif defined(IPOD_COLOR)
94 /* iPod Photo 30GB, see FS#9072 */
95 3450, 3660, 3700, 3730, 3750, 3770, 3820, 3870, 3920, 4040, 4170
96#elif defined(IPOD_3G)
97 /* iPod 3G 40GB, first approach based upon measurements */
98 3720, 3740, 3760, 3780, 3830, 3870, 3910, 3970, 4020, 4060, 4090
82#else 99#else
83 /* FIXME: calibrate value for other 3G+ ipods */ 100 /* FIXME: calibrate value for other iPods */
84 /* Table is "inherited" from iriver H100. */ 101 /* Table is "provisional" from IPOD_COLOR */
85 3540, 3860, 3930, 3980, 4000, 4020, 4040, 4080, 4130, 4180, 4230 102 3450, 3660, 3700, 3730, 3750, 3770, 3820, 3870, 3920, 4040, 4170
86#endif 103#endif
87}; 104};
88#endif /* CONFIG_CHARGING */ 105#endif /* CONFIG_CHARGING */
@@ -101,12 +118,12 @@ void accessory_supply_set(bool enable)
101{ 118{
102 if (enable) 119 if (enable)
103 { 120 {
104 /* Accessory voltage supply */ 121 /* Accessory voltage supply on */
105 pcf50605_write(PCF5060X_D2REGC1, 0xf8); /* 3.3V ON */ 122 pcf50605_write(PCF5060X_D2REGC1, 0xf8); /* 3.3V ON */
106 } 123 }
107 else 124 else
108 { 125 {
109 /* Accessory voltage supply */ 126 /* Accessory voltage supply off */
110 pcf50605_write(PCF5060X_D2REGC1, 0x18); /* OFF */ 127 pcf50605_write(PCF5060X_D2REGC1, 0x18); /* OFF */
111 } 128 }
112 129