Files
OpenCellular/common/battery_pack.h
Rong Chang 23b8885a02 Trickle charging state and minor bugs fix
Adding trickle charging mode to precharge batteries with
voltage lower than minimal design value. This CL adds
control to charger voltage to track battery input current
change.

To prevent battery from deeply discharging, this CL preserves
3% of the design capacity.

Minor bug fixes include error state check and charger control
logic.

Signed-off-by: Rong Chang <rongchang@chromium.org>

BUG=chrome-os-partner:8660,8661
TEST=manual
  Plug AC power, the power adapter led should be
  'yellow'. On the EC serial console, type 'battery'
  and 'charger' commands.

  Battery input current should staid close to its
  desired current.

  A deeply discharged battery (5.5V) should be revived to
  a healthy state after 30 minutes ~ 4 hours.

Change-Id: Ibaa2396c6b751639d98db32f5919b1e8ec700e40
2012-04-19 01:16:01 +08:00

43 lines
1000 B
C

/* Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*
* Common API for battery pack vendor provided charging profile
*/
#ifndef __CROS_EC_BATTERY_PACK_H
#define __CROS_EC_BATTERY_PACK_H
/* Battery parameters */
struct batt_params {
int temperature;
int state_of_charge;
int voltage;
int current;
int desired_voltage;
int desired_current;
};
/* Battery constants */
struct battery_info {
/* Design voltage */
int voltage_max;
int voltage_normal;
int voltage_min;
/* Working temperature */
int temp_charge_min;
int temp_charge_max;
int temp_discharge_min;
int temp_discharge_max;
/* Pre-charge */
int precharge_current;
};
/* Vendor provided battery constants */
const struct battery_info *battery_get_info(void);
/* Vendor provided parameters for battery charging */
void battery_vendor_params(struct batt_params *batt);
#endif //__CROS_EC_BATTERY_PACK_H