rockbox/firmware/target/arm/as3525/powermgmt-target.h
Rafaël Carré 12af2926e5 Make Clip+ bootloader build
Now making the Fuzev2 bootloader build should be pretty easy

TODO:
    - write button driver (FlynDice found all buttons already)
    - find button light
    - decide if lcd-ssd1303.c must be modified for Clip+ using SSP or forked
    - check if backlight code works (I copied Clipv2 code)

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24520 a1c6a512-1295-4272-9138-f99709370657
2010-02-05 12:40:25 +00:00

80 lines
2.7 KiB
C

/***************************************************************************
* __________ __ ___.
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
* \/ \/ \/ \/ \/
* $Id$
*
* Copyright (C) 2009 by Michael Sevakis
* Copyright (C) 2008 by Bertrik Sikken
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
****************************************************************************/
#ifndef POWERMGMT_TARGET_H
#define POWERMGMT_TARGET_H
#if defined(SANSA_CLIP) \
|| defined(SANSA_CLIPV2) /* FIXME */ \
|| defined(SANSA_CLIPPLUS) /* FIXME */
/* Check if topped-off and monitor voltage while plugged. */
#define BATT_FULL_VOLTAGE 4160
#define BATT_VAUTO_RECHARGE 4100
#define BATT_CHG_V CHG_V_4_20V
#define BATT_CHG_I CHG_I_100MA
#define CHARGER_TOTAL_TIMER (6*3600*2) /* about 1.5 * capacity / current */
#define ADC_BATTERY ADC_BVDD
#elif defined(SANSA_E200V2)
/* Check if topped-off and monitor voltage while plugged. */
#define BATT_FULL_VOLTAGE 4160
#define BATT_VAUTO_RECHARGE 4100
#define BATT_CHG_V CHG_V_4_20V
#define BATT_CHG_I CHG_I_300MA
#define CHARGER_TOTAL_TIMER (4*3600*2)
#define ADC_BATTERY ADC_BVDD
#elif defined(SANSA_FUZE)
/* Check if topped-off and monitor voltage while plugged. */
#define BATT_FULL_VOLTAGE 4160
#define BATT_VAUTO_RECHARGE 4100
#define BATT_CHG_V CHG_V_4_20V
#define BATT_CHG_I CHG_I_200MA
#define CHARGER_TOTAL_TIMER (4*3600*2)
#define ADC_BATTERY ADC_BVDD
#elif defined(SANSA_C200V2)
/* Check if topped-off and monitor voltage while plugged. */
#define BATT_FULL_VOLTAGE 4160
#define BATT_VAUTO_RECHARGE 4100
#define BATT_CHG_V CHG_V_4_20V
#define BATT_CHG_I CHG_I_200MA
#define CHARGER_TOTAL_TIMER (4*3600*2)
#define ADC_BATTERY ADC_BVDD
#else
#error "Charger settings not defined!"
#endif
void powermgmt_init_target(void);
void charging_algorithm_step(void);
void charging_algorithm_close(void);
/* We want to be able to reset the averaging filter */
#define HAVE_RESET_BATTERY_FILTER
#define BATT_AVE_SAMPLES 32
#endif /* POWERMGMT_TARGET_H */