Fuzev2: Preliminary button support. Scrollwheel does not work yet.
[kugel-rb.git] / firmware / target / arm / sandisk / powermgmt-target.h
blobaa6a0e0e3d2eb432b3257553cac3e09331d65a1a
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2009 by Michael Sevakis
11 * Copyright (C) 2008 by Bertrik Sikken
13 * This program is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU General Public License
15 * as published by the Free Software Foundation; either version 2
16 * of the License, or (at your option) any later version.
18 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 * KIND, either express or implied.
21 ****************************************************************************/
22 #ifndef POWERMGMT_TARGET_H
23 #define POWERMGMT_TARGET_H
25 #if defined(SANSA_C200)
26 /* This configuration triggers a single charge cycle upon plugging and stops.
27 * The true voltage cannot be read accurately and so monitoring isn't really
28 * possible. The battery filter is still synced to have a proper reading
29 * when disconnecting. */
30 #define BATT_FULL_VOLTAGE 5121 /* Won't read this high - force start */
31 #define BATT_VAUTO_RECHARGE 0 /* Won't read this low - force one cycle */
32 #define BATT_CHG_V CHG_V_4_20V
33 #define BATT_CHG_I CHG_I_300MA
34 #define CHARGER_TOTAL_TIMER (4*3600*2) /* 4 hours enough? */
35 #define ADC_BATTERY ADC_BVDD
36 #elif defined(SANSA_E200)
37 /* PREFERRED - Check if topped-off and monitor voltage while plugged. */
38 #define BATT_FULL_VOLTAGE 4160
39 #define BATT_VAUTO_RECHARGE 4100
40 #define BATT_CHG_V CHG_V_4_20V
41 #define BATT_CHG_I CHG_I_300MA
42 #define CHARGER_TOTAL_TIMER (4*3600*2) /* 4 hours enough? */
43 /* On e200 ADC_RTCSUP seems to represent battery voltage better than
44 * ADC_BVDD during charging (ADC_BVDD is way too high) and appears the
45 * same in normal use.
47 #define ADC_BATTERY ADC_RTCSUP
48 #endif
50 void powermgmt_init_target(void);
51 void charging_algorithm_step(void);
52 void charging_algorithm_close(void);
54 /* We want to be able to reset the averaging filter */
55 #define HAVE_RESET_BATTERY_FILTER
57 #define BATT_AVE_SAMPLES 32
59 #endif /* POWERMGMT_TARGET_H */