BQ28Z610 Driver
BQ28Z610 Battery fuel gauge device driver for Arduino
|
12.1 Standard Data Commands headers More...
Go to the source code of this file.
Functions | |
word | ManufacturerAccessControl () |
12.1.1 0x00/01 ManufacturerAccessControl More... | |
float | Temperature () |
12.1.4 0x06/07 Temperature More... | |
float | Voltage () |
12.1.5 0x08/09 Voltage More... | |
word | BatteryStatus () |
12.1.6 0x0A/0B BatteryStatus More... | |
int | Current () |
12.1.7 0x0C/0D Current More... | |
word | RemainingCapacity () |
12.1.9 0x10/11 RemainingCapacity More... | |
word | FullChargeCapacity () |
12.1.10 0x12/13 FullChargeCapacity More... | |
int | AverageCurrent () |
12.1.11 0x14/15 AverageCurrent More... | |
word | CycleCount () |
12.1.22 0x2A/2B CycleCount More... | |
word | RelativeStateOfCharge () |
12.1.23 0x2C/2D RelativeStateOfCharge More... | |
word | StateOfHealth () |
12.1.24 0x2E/2F State-of-Health (SOH) More... | |
float | ChargingVoltage () |
12.1.25 0x30/31 ChargingVoltage More... | |
word | ChargingCurrent () |
12.1.26 0x32/33 ChargingCurrent More... | |
word | DesignCapacity () |
12.1.27 0x3C/3D DesignCapacity More... | |
12.1 Standard Data Commands headers
The host controller communicates with the gauge through gauge commands. A gauge command is the equivalent to a register. For example, reading the state of charge is accomplished through the StateOfCharge() gauge command, which has the command codes 0x1C and 0x1D. So if the interface is I2C, reading from device register 0x1C and 0x1D returns the current state of charge of the battery as calculated by the gauge.
To enable the system to read and write battery information, the BQ28Z610 uses a series of 2-byte standard I2C commands with a 7-bit device address of 0x55 (8 bits = 0xAA to write and 0xAB to read). Each standard command has an associated command code pair, as indicated in Table 12-1, Standard Commands. Each protocol has specific means to access the data at each command code. Data RAM is updated and read by the gauge once per second.
BQ28Z610 Technical Reference Manual (c) Texas Instruments Literature Number: SLUUA65E
MIT License
Copyright (c) 2024 Oleksii Sylichenko
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
int AverageCurrent | ( | ) |
12.1.11 0x14/15 AverageCurrent
The value is updated every 1s. Units are mA.
12.1.11 0x14/15 AverageCurrent
word BatteryStatus | ( | ) |
12.1.6 0x0A/0B BatteryStatus
Bits 3:0: EC3,EC2,EC1,EC0 - Error Code: 0x00 = OK 0x1 = Busy 0x2 = Reserved Command 0x3 = Unsupported Command 0x4 = AccessDenied 0x5 = Overflow/Underflow 0x6 = BadSize 0x7 = UnknownError Bit 4: FD—Fully Discharged 0 = Battery ok 1 = Battery fully depleted Bit 5: FC—Fully Charged 0 = Battery not fully charged 1 = Battery fully charged Bit 6: DSG—Discharging 0 = Battery is charging. 1 = Battery is discharging. Bit 7: INIT—Initialization 0 = Inactive 1 = Active Bit 8: RTA—Remaining Time Alarm 0 = Inactive 1 = Active Bit 9: RCA—Remaining Capacity Alarm 0 = Inactive 1 = Active Bit 10: Reserved Bit 11: TDA—Terminate Discharge Alarm 0 = Inactive 1 = Active Bit 12: OTA—Overtemperature Alarm 0 = Inactive 1 = Active Bit 13: Reserved Bit 14: TCA—Terminate Charge Alarm 0 = Inactive 1 = Active Bit 15: OCA—Overcharged Alarm 0 = Inactive 1 = Active
word ChargingCurrent | ( | ) |
12.1.26 0x32/33 ChargingCurrent
float ChargingVoltage | ( | ) |
12.1.25 0x30/31 ChargingVoltage
int Current | ( | ) |
12.1.7 0x0C/0D Current
word CycleCount | ( | ) |
12.1.22 0x2A/2B CycleCount
word DesignCapacity | ( | ) |
12.1.27 0x3C/3D DesignCapacity
word FullChargeCapacity | ( | ) |
12.1.10 0x12/13 FullChargeCapacity
word ManufacturerAccessControl | ( | ) |
12.1.1 0x00/01 ManufacturerAccessControl
A read on this register returns the Control bits.
This Control Register is an I2C register, and the control bits are read back on register 0x00/0x01. These control bits are provided for backward compatibility/ease-of-use.
word RelativeStateOfCharge | ( | ) |
12.1.23 0x2C/2D RelativeStateOfCharge
word RemainingCapacity | ( | ) |
12.1.9 0x10/11 RemainingCapacity
word StateOfHealth | ( | ) |
12.1.24 0x2E/2F State-of-Health (SOH)
float Temperature | ( | ) |
12.1.4 0x06/07 Temperature
float Voltage | ( | ) |
12.1.5 0x08/09 Voltage