mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-08 16:41:55 +00:00
This CL adds a charge state machine for SMB compliant battery pack. Vendor specific charge constraints can be applied through function call, defined in battery_pack.h . BUG=chrome-os-partner:7526 TEST=Attach EC serial console Unplug AC adapter: state ==> "discharge" Plug AC adapter: state ==> "charge" Battery full: state ==> "idle" Unplug battery: state ==> "error" Change-Id: Iabff0988a6067d37c17c11b060bbb7e66505c118
25 lines
616 B
C
25 lines
616 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;
|
|
};
|
|
|
|
/* Vendor provided parameters for battery charging */
|
|
void battery_vendor_params(struct batt_params *batt);
|
|
|
|
#endif //__CROS_EC_BATTERY_PACK_H
|
|
|