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.h56
1 files changed, 28 insertions, 28 deletions
diff --git a/firmware/export/powermgmt.h b/firmware/export/powermgmt.h
index 77764b5a31..4bdaa4387d 100644
--- a/firmware/export/powermgmt.h
+++ b/firmware/export/powermgmt.h
@@ -26,6 +26,34 @@
26#define CHARGE_END_LONGD 50 /* stop when N minutes have passed with 26#define CHARGE_END_LONGD 50 /* stop when N minutes have passed with
27 * avg delta being < -0.02 V */ 27 * avg delta being < -0.02 V */
28 28
29#if CONFIG_CHARGING >= CHARGING_MONITOR
30typedef enum { /* sorted by increasing charging current */
31 DISCHARGING = 0,
32 TRICKLE, /* Can occur for CONFIG_CHARGING >= CHARGING_MONITOR */
33 TOPOFF, /* Can occur for CONFIG_CHARGING == CHARGING_CONTROL */
34 CHARGING /* Can occur for all CONFIG_CHARGING options */
35} charge_state_type;
36
37/* tells what the charger is doing */
38extern charge_state_type charge_state;
39#endif /* CONFIG_CHARGING >= CHARGING_MONITOR */
40
41#ifdef CONFIG_CHARGING
42/*
43 * Flag that the charger has been plugged in/removed: this is set for exactly
44 * one time through the power loop when the charger has been plugged in.
45 */
46typedef enum {
47 NO_CHARGER,
48 CHARGER_UNPLUGGED, /* transient state */
49 CHARGER_PLUGGED, /* transient state */
50 CHARGER
51} charger_input_state_type;
52
53/* tells the state of the charge input */
54extern charger_input_state_type charger_input_state;
55#endif
56
29#ifndef SIMULATOR 57#ifndef SIMULATOR
30 58
31#if CONFIG_CHARGING == CHARGING_CONTROL 59#if CONFIG_CHARGING == CHARGING_CONTROL
@@ -61,34 +89,6 @@ extern int trickle_sec; /* trickle charge: How many seconds per minute
61 89
62#endif /* CONFIG_CHARGING == CHARGING_CONTROL */ 90#endif /* CONFIG_CHARGING == CHARGING_CONTROL */
63 91
64#if CONFIG_CHARGING >= CHARGING_MONITOR
65typedef enum { /* sorted by increasing charging current */
66 DISCHARGING = 0,
67 TRICKLE, /* Can occur for CONFIG_CHARGING >= CHARGING_MONITOR */
68 TOPOFF, /* Can occur for CONFIG_CHARGING == CHARGING_CONTROL */
69 CHARGING /* Can occur for all CONFIG_CHARGING options */
70} charge_state_type;
71
72/* tells what the charger is doing */
73extern charge_state_type charge_state;
74#endif /* CONFIG_CHARGING >= CHARGING_MONITOR */
75
76#ifdef CONFIG_CHARGING
77/*
78 * Flag that the charger has been plugged in/removed: this is set for exactly
79 * one time through the power loop when the charger has been plugged in.
80 */
81typedef enum {
82 NO_CHARGER,
83 CHARGER_UNPLUGGED, /* transient state */
84 CHARGER_PLUGGED, /* transient state */
85 CHARGER
86} charger_input_state_type;
87
88/* tells the state of the charge input */
89extern charger_input_state_type charger_input_state;
90#endif
91
92#ifdef HAVE_MMC /* Values for Ondio */ 92#ifdef HAVE_MMC /* Values for Ondio */
93# define CURRENT_NORMAL 95 /* average, nearly proportional to 1/U */ 93# define CURRENT_NORMAL 95 /* average, nearly proportional to 1/U */
94# define CURRENT_USB 1 /* host powered in USB mode; avoid zero-div */ 94# define CURRENT_USB 1 /* host powered in USB mode; avoid zero-div */