summaryrefslogtreecommitdiff
path: root/include/battery.h
diff options
context:
space:
mode:
authorJack Rosenthal <jrosenth@chromium.org>2022-06-27 15:07:41 -0600
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-07-01 18:35:46 +0000
commit598f6737b19b4d1fb8375d6b93fa116bbf9989c4 (patch)
tree8bcbb165ea2e07d377470fe9b7ef636a958212c1 /include/battery.h
parent603579741270831b39a56ed32adf9508f2a7877a (diff)
downloadchrome-ec-598f6737b19b4d1fb8375d6b93fa116bbf9989c4.tar.gz
include/battery.h: Format with clang-format
BUG=b:236386294 BRANCH=none TEST=none Change-Id: I8f8909add60978837db0014341495b61307d0575 Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3730209 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
Diffstat (limited to 'include/battery.h')
-rw-r--r--include/battery.h72
1 files changed, 36 insertions, 36 deletions
diff --git a/include/battery.h b/include/battery.h
index 9daf1ce981..8a99c9b7e6 100644
--- a/include/battery.h
+++ b/include/battery.h
@@ -23,32 +23,32 @@
#else /* !CONFIG_ZEPHYR */
/* Stop charge when charging and battery level >= this percentage */
-#define BATTERY_LEVEL_FULL 100
+#define BATTERY_LEVEL_FULL 100
/* Tell host we're charged when battery level >= this percentage */
#ifdef CONFIG_BATTERY_LEVEL_NEAR_FULL
-#define BATTERY_LEVEL_NEAR_FULL CONFIG_BATTERY_LEVEL_NEAR_FULL
+#define BATTERY_LEVEL_NEAR_FULL CONFIG_BATTERY_LEVEL_NEAR_FULL
#else
-#define BATTERY_LEVEL_NEAR_FULL 97
+#define BATTERY_LEVEL_NEAR_FULL 97
#endif
/*
* Send battery-low host event when discharging and battery level <= this level
*/
-#define BATTERY_LEVEL_LOW 10
+#define BATTERY_LEVEL_LOW 10
/*
* Send battery-critical host event when discharging and battery level <= this
* level.
*/
-#define BATTERY_LEVEL_CRITICAL 5
+#define BATTERY_LEVEL_CRITICAL 5
/*
* Shut down main processor and/or hibernate EC when discharging and battery
* level < this level. Setting this too low makes the battery discharge too
* deeply, which isn't good for the battery health.
*/
-#define BATTERY_LEVEL_SHUTDOWN 3
+#define BATTERY_LEVEL_SHUTDOWN 3
#endif /* CONFIG_ZEPHYR */
@@ -66,7 +66,7 @@ enum battery_index {
* Sometimes we have hardware to detect battery present, sometimes we have to
* wait until we've been able to talk to the battery.
*/
-FORWARD_DECLARE_ENUM(battery_present) {
+FORWARD_DECLARE_ENUM(battery_present){
BP_NOT_INIT = -1,
BP_NO = 0,
BP_YES = 1,
@@ -97,10 +97,10 @@ struct battery_static_info {
* char chemistry[32];
*/
/* Max string size in the SB spec is 31. */
- char manufacturer_ext[32]; /* SB_MANUFACTURER_NAME */
- char model_ext[32]; /* SB_DEVICE_NAME */
- char serial_ext[32]; /* SB_SERIAL_NUMBER */
- char type_ext[32]; /* SB_DEVICE_CHEMISTRY */
+ char manufacturer_ext[32]; /* SB_MANUFACTURER_NAME */
+ char model_ext[32]; /* SB_DEVICE_NAME */
+ char serial_ext[32]; /* SB_SERIAL_NUMBER */
+ char type_ext[32]; /* SB_DEVICE_CHEMISTRY */
#ifdef CONFIG_BATTERY_VENDOR_PARAM
uint8_t vendor_param[32];
#endif
@@ -111,18 +111,18 @@ extern struct ec_response_battery_dynamic_info battery_dynamic[];
/* Battery parameters */
struct batt_params {
- int temperature; /* Temperature in 0.1 K */
- int state_of_charge; /* State of charge (percent, 0-100) */
- int voltage; /* Battery voltage (mV) */
- int current; /* Battery current (mA); negative=discharging */
- int desired_voltage; /* Charging voltage desired by battery (mV) */
- int desired_current; /* Charging current desired by battery (mA) */
- int remaining_capacity; /* Remaining capacity in mAh */
- int full_capacity; /* Capacity in mAh (might change occasionally) */
- int display_charge; /* Display charge in 10ths of a % (1000=100.0%) */
- int status; /* Battery status */
+ int temperature; /* Temperature in 0.1 K */
+ int state_of_charge; /* State of charge (percent, 0-100) */
+ int voltage; /* Battery voltage (mV) */
+ int current; /* Battery current (mA); negative=discharging */
+ int desired_voltage; /* Charging voltage desired by battery (mV) */
+ int desired_current; /* Charging current desired by battery (mA) */
+ int remaining_capacity; /* Remaining capacity in mAh */
+ int full_capacity; /* Capacity in mAh (might change occasionally) */
+ int display_charge; /* Display charge in 10ths of a % (1000=100.0%) */
+ int status; /* Battery status */
enum battery_present is_present; /* Is the battery physically present */
- int flags; /* Flags */
+ int flags; /* Flags */
};
/*
@@ -138,25 +138,25 @@ int battery_get_avg_voltage(void); /* in mV */
/* Flags for batt_params */
/* Battery wants to be charged */
-#define BATT_FLAG_WANT_CHARGE 0x00000001
+#define BATT_FLAG_WANT_CHARGE 0x00000001
/* Battery is responsive (talking to us via I2C) */
-#define BATT_FLAG_RESPONSIVE 0x00000002
+#define BATT_FLAG_RESPONSIVE 0x00000002
/* Bits to indicate which parameter(s) could not be read */
-#define BATT_FLAG_BAD_TEMPERATURE 0x00000004
-#define BATT_FLAG_BAD_STATE_OF_CHARGE 0x00000008
-#define BATT_FLAG_BAD_VOLTAGE 0x00000010
-#define BATT_FLAG_BAD_CURRENT 0x00000020
-#define BATT_FLAG_BAD_DESIRED_VOLTAGE 0x00000040
-#define BATT_FLAG_BAD_DESIRED_CURRENT 0x00000080
-#define BATT_FLAG_BAD_REMAINING_CAPACITY 0x00000100
-#define BATT_FLAG_BAD_FULL_CAPACITY 0x00000200
-#define BATT_FLAG_BAD_STATUS 0x00000400
-#define BATT_FLAG_IMBALANCED_CELL 0x00000800
-#define BATT_FLAG_BAD_AVERAGE_CURRENT 0x00001000
+#define BATT_FLAG_BAD_TEMPERATURE 0x00000004
+#define BATT_FLAG_BAD_STATE_OF_CHARGE 0x00000008
+#define BATT_FLAG_BAD_VOLTAGE 0x00000010
+#define BATT_FLAG_BAD_CURRENT 0x00000020
+#define BATT_FLAG_BAD_DESIRED_VOLTAGE 0x00000040
+#define BATT_FLAG_BAD_DESIRED_CURRENT 0x00000080
+#define BATT_FLAG_BAD_REMAINING_CAPACITY 0x00000100
+#define BATT_FLAG_BAD_FULL_CAPACITY 0x00000200
+#define BATT_FLAG_BAD_STATUS 0x00000400
+#define BATT_FLAG_IMBALANCED_CELL 0x00000800
+#define BATT_FLAG_BAD_AVERAGE_CURRENT 0x00001000
/* All of the above BATT_FLAG_BAD_* bits */
-#define BATT_FLAG_BAD_ANY 0x000017fc
+#define BATT_FLAG_BAD_ANY 0x000017fc
/* Battery constants */
struct battery_info {