summaryrefslogtreecommitdiff
path: root/firmware/export/powermgmt.h
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/export/powermgmt.h')
-rw-r--r--firmware/export/powermgmt.h30
1 files changed, 27 insertions, 3 deletions
diff --git a/firmware/export/powermgmt.h b/firmware/export/powermgmt.h
index 3c4a61fb87..25c18eabad 100644
--- a/firmware/export/powermgmt.h
+++ b/firmware/export/powermgmt.h
@@ -79,18 +79,38 @@ extern int trickle_sec; /* trickle charge: How many seconds per minute
79 79
80#endif /* HAVE_CHARGE_CTRL */ 80#endif /* HAVE_CHARGE_CTRL */
81 81
82#if defined(HAVE_CHARGE_CTRL) || (CONFIG_BATTERY == BATT_LIION2200) 82#if defined(HAVE_CHARGE_CTRL) || \
83 (CONFIG_BATTERY == BATT_LIION2200) || \
84 defined(HAVE_CHARGE_STATE)
83typedef enum { 85typedef enum {
84 DISCHARGING, 86 DISCHARGING,
85 CHARGING, 87 CHARGING,
88#ifdef HAVE_CHARGE_CTRL
86 TOPOFF, 89 TOPOFF,
87 TRICKLE 90 TRICKLE
91#endif
88} charge_state_type; 92} charge_state_type;
89 93
90/* tells what the charger is doing */ 94/* tells what the charger is doing */
91extern charge_state_type charge_state; 95extern charge_state_type charge_state;
92#endif /* defined(HAVE_CHARGE_CTRL) || (CONFIG_BATTERY == BATT_LIION2200) */ 96#endif /* defined(HAVE_CHARGE_CTRL) || (CONFIG_BATTERY == BATT_LIION2200) */
93 97
98#ifdef HAVE_CHARGING
99/*
100 * Flag that the charger has been plugged in/removed: this is set for exactly
101 * one time through the power loop when the charger has been plugged in.
102 */
103typedef enum {
104 NO_CHARGER,
105 CHARGER_UNPLUGGED, /* transient state */
106 CHARGER_PLUGGED, /* transient state */
107 CHARGER
108} charger_input_state_type;
109
110/* tells the state of the charge input */
111extern charger_input_state_type charger_input_state;
112#endif
113
94#ifdef HAVE_MMC /* Values for Ondio */ 114#ifdef HAVE_MMC /* Values for Ondio */
95# define CURRENT_NORMAL 95 /* average, nearly proportional to 1/U */ 115# define CURRENT_NORMAL 95 /* average, nearly proportional to 1/U */
96# define CURRENT_USB 1 /* host powered in USB mode; avoid zero-div */ 116# define CURRENT_USB 1 /* host powered in USB mode; avoid zero-div */
@@ -106,9 +126,13 @@ extern charge_state_type charge_state;
106 126
107# define CURRENT_MIN_CHG 70 /* minimum charge current */ 127# define CURRENT_MIN_CHG 70 /* minimum charge current */
108# define MIN_CHG_V 8500 /* at 8.5v charger voltage get CURRENT_MIN_CHG */ 128# define MIN_CHG_V 8500 /* at 8.5v charger voltage get CURRENT_MIN_CHG */
109# define CURRENT_MAX_CHG 350 /* maximum charging current */ 129# ifdef IRIVER_H300_SERIES
130# define CURRENT_MAX_CHG 650 /* maximum charging current */
131# else
132# define CURRENT_MAX_CHG 350 /* maximum charging current */
133# endif
110# define MAX_CHG_V 10250 /* anything over 10.25v gives CURRENT_MAX_CHG */ 134# define MAX_CHG_V 10250 /* anything over 10.25v gives CURRENT_MAX_CHG */
111#endif /* HAVE_MMC */ 135#endif /* not HAVE_MMC */
112 136
113extern unsigned int bat; /* filtered battery voltage, centivolts */ 137extern unsigned int bat; /* filtered battery voltage, centivolts */
114extern unsigned short power_history[POWER_HISTORY_LEN]; 138extern unsigned short power_history[POWER_HISTORY_LEN];