From 22e7bf32b894acc1f9e2820e213f05a57bd4148c Mon Sep 17 00:00:00 2001 From: Mark Arigo Date: Fri, 27 Jun 2008 18:40:25 +0000 Subject: My Devcon 2008 contribution: port for Philips GoGear HDD1630 (PP5022-based). Current status is that the bootloader works to load Rockbox, but dual boot does not work: it freezes after decrypting the OF. When Rockbox boots, it freezes somewhere between showing the logo and the main menu. And there's no driver for the touchpad. So lots of work left. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17809 a1c6a512-1295-4272-9138-f99709370657 --- .../target/arm/philips/hdd1630/powermgmt-hdd1630.c | 62 ++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 firmware/target/arm/philips/hdd1630/powermgmt-hdd1630.c (limited to 'firmware/target/arm/philips/hdd1630/powermgmt-hdd1630.c') diff --git a/firmware/target/arm/philips/hdd1630/powermgmt-hdd1630.c b/firmware/target/arm/philips/hdd1630/powermgmt-hdd1630.c new file mode 100644 index 0000000000..71781182fa --- /dev/null +++ b/firmware/target/arm/philips/hdd1630/powermgmt-hdd1630.c @@ -0,0 +1,62 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) 2002 by Heikki Hannikainen, Uwe Freese + * Revisions copyright (C) 2005 by Gerald Van Baren + * + * All files in this archive are subject to the GNU General Public License. + * See the file COPYING in the source tree root for full license agreement. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ + +#include "config.h" +#include "adc.h" +#include "powermgmt.h" + +const unsigned short battery_level_dangerous[BATTERY_TYPES_COUNT] = +{ + 3450 +}; + +const unsigned short battery_level_shutoff[BATTERY_TYPES_COUNT] = +{ + 3400 +}; + +/* voltages (millivolt) of 0%, 10%, ... 100% when charging disabled */ +const unsigned short percent_to_volt_discharge[BATTERY_TYPES_COUNT][11] = +{ + { 3480, 3550, 3590, 3610, 3630, 3650, 3700, 3760, 3800, 3910, 3990 }, +}; + +#if CONFIG_CHARGING +/* voltages (millivolt) of 0%, 10%, ... 100% when charging enabled */ +const unsigned short percent_to_volt_charge[11] = +{ + 3480, 3550, 3590, 3610, 3630, 3650, 3700, 3760, 3800, 3910, 3990 +}; +#endif /* CONFIG_CHARGING */ + +#define BATTERY_SCALE_FACTOR 6003 +/* full-scale ADC readout (2^10) in millivolt */ + +/* adc readout + * max with charger connected: 690 + * max fully charged: 682 + * min just before shutdown: 570 + */ + +/* Returns battery voltage from ADC [millivolts] */ +unsigned int battery_adc_voltage(void) +{ + return (adc_read(ADC_UNREG_POWER) * BATTERY_SCALE_FACTOR) >> 10; +} -- cgit v1.2.3