From 909e4c6c06e004a6063cab014c12bcef6a2b37e5 Mon Sep 17 00:00:00 2001 From: Andree Buschmann Date: Tue, 16 Feb 2010 22:53:54 +0000 Subject: 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 --- firmware/export/config/ipod3g.h | 7 +++ firmware/export/config/ipodcolor.h | 7 +++ firmware/target/arm/ipod/powermgmt-ipod-pcf.c | 65 +++++++++++++++++---------- 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 @@ /* Hardware controlled charging? FIXME */ #define CONFIG_CHARGING CHARGING_SIMPLE +/* define current usage levels */ +#define CURRENT_NORMAL 275 /* ~4h (1100mAh) */ +#define CURRENT_BACKLIGHT 20 /* FIXME: this needs adjusting */ +#if defined(HAVE_RECORDING) +#define CURRENT_RECORD 35 /* FIXME: this needs adjusting */ +#endif + /* Define this if you have a PortalPlayer PP5002 */ #define CONFIG_CPU PP5002 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 @@ /* define this if the unit can be powered or charged via USB */ #define HAVE_USB_POWER +/* define current usage levels */ +#define CURRENT_NORMAL 69 /* ~10h (700mAh), see FS#9072 */ +#define CURRENT_BACKLIGHT 20 /* FIXME: this needs adjusting */ +#if defined(HAVE_RECORDING) +#define CURRENT_RECORD 35 /* FIXME: this needs adjusting */ +#endif + /* Define Apple remote tuner */ #define CONFIG_TUNER IPOD_REMOTE_TUNER #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 @@ const unsigned short battery_level_dangerous[BATTERY_TYPES_COUNT] = { -#ifdef IPOD_NANO +#if defined(IPOD_NANO) 3330 -#elif defined IPOD_VIDEO +#elif defined(IPOD_VIDEO) 3300 +#elif defined(IPOD_COLOR) + 3300 +#elif defined(IPOD_3G) + 3700 #else - /* FIXME: calibrate value for other 3G+ ipods */ - 3380 + /* FIXME: calibrate value for other iPods */ + 3300 #endif }; const unsigned short battery_level_shutoff[BATTERY_TYPES_COUNT] = { -#ifdef IPOD_NANO +#if defined(IPOD_NANO) 3230 -#elif defined IPOD_VIDEO +#elif defined(IPOD_VIDEO) 3300 +#elif defined(IPOD_COLOR) + 3300 +#elif defined(IPOD_3G) + 3500 #else - /* FIXME: calibrate value for other 3G+ ipods */ - 3020 + /* FIXME: calibrate value for other iPods */ + 3000 #endif }; /* voltages (millivolt) of 0%, 10%, ... 100% when charging disabled */ const unsigned short percent_to_volt_discharge[BATTERY_TYPES_COUNT][11] = { -#ifdef IPOD_NANO +#if defined(IPOD_NANO) /* measured values */ { 3230, 3620, 3700, 3730, 3750, 3780, 3830, 3890, 3950, 4030, 4160 }, -#elif defined IPOD_VIDEO - /* iPOD Video 30GB Li-Ion 400mAh, first approach based upon measurements */ +#elif defined(IPOD_VIDEO) + /* iPod Video 30GB Li-Ion 400mAh, first approach based upon measurements */ { 3450, 3670, 3710, 3750, 3790, 3830, 3870, 3930, 4010, 4100, 4180 }, -#elif defined IPOD_COLOR - /* iPOD Color 60GB Li-Ion, first approach based upon measurements */ - { 3500, 3676, 3729, 3755, 3778, 3805, 3847, 3919, 3961, 4071, 4109 }, +#elif defined(IPOD_COLOR) + /* iPod Photo 30GB, see FS#9072 */ + { 3450, 3660, 3700, 3730, 3750, 3770, 3820, 3870, 3920, 4040, 4170 }, +#elif defined(IPOD_3G) + /* iPod 3G 40GB, first approach based upon measurements */ + { 3720, 3740, 3760, 3780, 3830, 3870, 3910, 3970, 4020, 4060, 4090 }, #else - /* FIXME: calibrate value for other 3G+ ipods */ - /* Table is "inherited" from iriver H100. */ - { 3370, 3650, 3700, 3740, 3780, 3820, 3870, 3930, 4000, 4080, 4160 } + /* FIXME: calibrate value for other iPods */ + /* Table is "provisional" from IPOD_COLOR */ + { 3450, 3660, 3700, 3730, 3750, 3770, 3820, 3870, 3920, 4040, 4170 } #endif }; @@ -73,16 +84,22 @@ const unsigned short percent_to_volt_discharge[BATTERY_TYPES_COUNT][11] = /* voltages (millivolt) of 0%, 10%, ... 100% when charging enabled */ const unsigned short percent_to_volt_charge[11] = { -#ifdef IPOD_NANO +#if defined(IPOD_NANO) /* measured values */ 3230, 3620, 3700, 3730, 3750, 3780, 3830, 3890, 3950, 4030, 4160 -#elif defined IPOD_VIDEO +#elif defined(IPOD_VIDEO) /* iPOD Video 30GB Li-Ion 400mAh, first approach based upon measurements */ 3450, 3670, 3710, 3750, 3790, 3830, 3870, 3930, 4010, 4100, 4180 +#elif defined(IPOD_COLOR) + /* iPod Photo 30GB, see FS#9072 */ + 3450, 3660, 3700, 3730, 3750, 3770, 3820, 3870, 3920, 4040, 4170 +#elif defined(IPOD_3G) + /* iPod 3G 40GB, first approach based upon measurements */ + 3720, 3740, 3760, 3780, 3830, 3870, 3910, 3970, 4020, 4060, 4090 #else - /* FIXME: calibrate value for other 3G+ ipods */ - /* Table is "inherited" from iriver H100. */ - 3540, 3860, 3930, 3980, 4000, 4020, 4040, 4080, 4130, 4180, 4230 + /* FIXME: calibrate value for other iPods */ + /* Table is "provisional" from IPOD_COLOR */ + 3450, 3660, 3700, 3730, 3750, 3770, 3820, 3870, 3920, 4040, 4170 #endif }; #endif /* CONFIG_CHARGING */ @@ -101,12 +118,12 @@ void accessory_supply_set(bool enable) { if (enable) { - /* Accessory voltage supply */ + /* Accessory voltage supply on */ pcf50605_write(PCF5060X_D2REGC1, 0xf8); /* 3.3V ON */ } else { - /* Accessory voltage supply */ + /* Accessory voltage supply off */ pcf50605_write(PCF5060X_D2REGC1, 0x18); /* OFF */ } -- cgit v1.2.3