BQ28Z610 Driver
BQ28Z610 Battery fuel gauge device driver for Arduino
|
12.2 0x3E, 0x3F AltManufacturerAccess() implementation More...
#include "alt_manufacturer_access.h"
Functions | |
bool | AltManufacturerAccess (const word MACSubcmd, byte *retval, byte *len) |
12.2 0x3E, 0x3F AltManufacturerAccess More... | |
void | AltManufacturerAccess (const word MACSubcmd) |
12.2 0x3E/0x3F AltManufacturerAccess More... | |
word | DeviceType () |
12.2.1 AltManufacturerAccess() 0x0001 Device Type More... | |
void | FirmwareVersion () |
12.2.2 AltManufacturerAccess() 0x0002 Firmware Version. More... | |
word | HardwareVersion () |
12.2.3 AltManufacturerAccess() 0x0003 Hardware Version. More... | |
word | ChemicalID () |
12.2.6 AltManufacturerAccess() 0x0006 Chemical ID. More... | |
void | DeviceReset () |
12.2.12 AltManufacturerAccess() 0x0012 Device Reset More... | |
void | ChargeFET () |
12.2.13 AltManufacturerAccess() 0x001F CHG FET More... | |
void | DischargeFET () |
12.2.14 AltManufacturerAccess() 0x0020 DSG FET More... | |
void | Gauging () |
12.2.15 AltManufacturerAccess() 0x0021 Gauging More... | |
void | FETControl () |
12.2.16 AltManufacturerAccess() 0x0022 FET Control More... | |
void | LifetimeDataReset () |
12.2.19 AltManufacturerAccess() 0x0028 Lifetime Data Reset More... | |
void | PermanentFailureDataReset () |
12.2.20 AltManufacturerAccess() 0x0029 Permanent Fail Data Reset More... | |
void | SealDevice () |
12.2.22 AltManufacturerAccess() 0x0030 Seal Device More... | |
u32 | SafetyAlert () |
12.2.26 AltManufacturerAccess() 0x0050 SafetyAlert More... | |
u32 | SafetyStatus () |
12.2.27 AltManufacturerAccess() 0x0051 SafetyStatus More... | |
u32 | PFAlert () |
12.2.28 AltManufacturerAccess() 0x0052 PFAlert More... | |
u32 | PFStatus () |
12.2.29 AltManufacturerAccess() 0x0053 PFStatus More... | |
u32 | OperationStatus () |
12.2.30 AltManufacturerAccess() 0x0054 OperationStatus More... | |
word | ChargingStatus () |
12.2.31 AltManufacturerAccess() 0x0055 ChargingStatus More... | |
u32 | GaugingStatus () |
12.2.32 AltManufacturerAccess() 0x0056 GaugingStatus More... | |
word | ManufacturingStatus () |
12.2.33 AltManufacturerAccess() 0x0057 ManufacturingStatus More... | |
void | DAStatus1 (byte *retval) |
12.2.37 AltManufacturerAccess() 0x0071 DAStatus1 More... | |
void | DAStatus1 () |
12.2.37 AltManufacturerAccess() 0x0071 DAStatus1 More... | |
void | ITStatus1 (byte *retval) |
12.2.39 AltManufacturerAccess() 0x0073 ITStatus1 More... | |
void | ITStatus1 () |
12.2.39 AltManufacturerAccess() 0x0073 ITStatus1 More... | |
void | ITStatus2 (byte *retval) |
12.2.40 AltManufacturerAccess() 0x0074 ITStatus2 More... | |
void | ITStatus2 () |
12.2.40 AltManufacturerAccess() 0x0074 ITStatus2 More... | |
void | ITStatus3 (byte *retval) |
12.2.41 AltManufacturerAccess() 0x0075 ITStatus3 More... | |
void | ITStatus3 () |
12.2.41 AltManufacturerAccess() 0x0075 ITStatus3 More... | |
12.2 0x3E, 0x3F AltManufacturerAccess() implementation
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.
AltManufacturerAccess() provides a method of reading and writing data in the Manufacturer Access System (MAC). The MAC command is sent via AltManufacturerAccess() by a block protocol. The result is returned on AltManufacturerAccess() via a block read.
Commands are set by writing to registers 0x00/0x01. On valid word access, the MAC command state is set, and commands 0x3E and 0x3F are used for MAC commands. These new addresses work the same as 0x00 and 0x01, but are primarily intended for block writes and reads.
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.
void AltManufacturerAccess | ( | const word | MACSubcmd | ) |
12.2 0x3E/0x3F AltManufacturerAccess
Send subcommand to 0x3E AltManufacturerAccess.
bool AltManufacturerAccess | ( | const word | MACSubcmd, |
byte * | retval, | ||
byte * | len | ||
) |
12.2 0x3E, 0x3F AltManufacturerAccess
Provides a method of reading and writing data in the Manufacturer Access System (MAC). The MAC command is sent via AltManufacturerAccess by a block protocol. The result is returned on AltManufacturerAccess via a block read.
Send subcommand to 0x3E AltManufacturerAccess and request block of data.
void ChargeFET | ( | ) |
12.2.13 AltManufacturerAccess() 0x001F CHG FET
This command turns on/off CHG FET drive function to ease testing during manufacturing.
word ChargingStatus | ( | ) |
12.2.31 AltManufacturerAccess() 0x0055 ChargingStatus
word ChemicalID | ( | ) |
12.2.6 AltManufacturerAccess() 0x0006 Chemical ID.
void DAStatus1 | ( | ) |
12.2.37 AltManufacturerAccess() 0x0071 DAStatus1
Print result of DAStatus1.
void DAStatus1 | ( | byte * | retval | ) |
12.2.37 AltManufacturerAccess() 0x0071 DAStatus1
void DeviceReset | ( | ) |
12.2.12 AltManufacturerAccess() 0x0012 Device Reset
This command resets the device.
word DeviceType | ( | ) |
12.2.1 AltManufacturerAccess() 0x0001 Device Type
The device can be checked for the IC part number.
JBL | 2610 |
void DischargeFET | ( | ) |
12.2.14 AltManufacturerAccess() 0x0020 DSG FET
This command turns on/off DSG FET drive function to ease testing during manufacturing.
void FETControl | ( | ) |
12.2.16 AltManufacturerAccess() 0x0022 FET Control
This command disables/enables control of the CHG, DSG, and PCHG FETs by the firmware.
void FirmwareVersion | ( | ) |
12.2.2 AltManufacturerAccess() 0x0002 Firmware Version.
The device can be checked for the firmware version of the IC
The firmware revision on MACData() in the following format:
ddDDvvVVbbBBTTzzZZRREE
JBL |
|
void Gauging | ( | ) |
12.2.15 AltManufacturerAccess() 0x0021 Gauging
This command enables or disables the gauging function to ease testing during manufacturing.
u32 GaugingStatus | ( | ) |
12.2.32 AltManufacturerAccess() 0x0056 GaugingStatus
word HardwareVersion | ( | ) |
12.2.3 AltManufacturerAccess() 0x0003 Hardware Version.
The device can be checked for the hardware version of the IC.
void ITStatus1 | ( | ) |
12.2.39 AltManufacturerAccess() 0x0073 ITStatus1
Print result of ITStatus1.
void ITStatus1 | ( | byte * | retval | ) |
12.2.39 AltManufacturerAccess() 0x0073 ITStatus1
void ITStatus2 | ( | ) |
12.2.40 AltManufacturerAccess() 0x0074 ITStatus2
Print result of ITStatus2.
void ITStatus2 | ( | byte * | retval | ) |
12.2.40 AltManufacturerAccess() 0x0074 ITStatus2
This command instructs the device to return Impedance Track related gauging information on MACData().
AA: Pack Grid. Active pack grid point (only valid in discharge) BB: LStatus—Learned status of resistance table Bit 3 | Bit 2 | Bit 1| Bit 0 QMax | ITEN | CF1 | CF0 CF1, CF0: QMax Status 0,0 = Battery OK 0,1 = QMax is first updated in learning cycle. 1,0 = QMax and resistance table updated in learning cycle ITEN: IT enable 0 = IT disabled 1 = IT enabled QMax: QMax field updates 0 = QMax is not updated in the field. 1 = QMax is updated in the field. 00: IT disabled 04: Learning in process. 05: QMax is first updated in learning cycle. 06: Resistance table is updated. 0E: Learning finished. CC: Cell Grid 1. Active grid point of Cell1 DD: Cell Grid 2. Active grid point of Cell2 EE: N/A. RSVD FF: N/A. RSVD HHhhGGgg: State Time. Time passed since last state change (Discharge, Charge, Rest) IIii: DOD0_1. Depth of discharge for Cell1 JJjj: DOD0_2. Depth of discharge for Cell2 KKkk: DOD0 Passed Q. Passed charge since DOD0 LLll: DOD0 Passed Energy. Passed energy since the last DOD0 update MMmm: DOD0 Time. Time passed since the last DOD0 update NNnn: DODEOC_1. Cell 1 DOD@EOC OOoo: DODEOC_2. Cell 2 DOD@EOC
void ITStatus3 | ( | ) |
12.2.41 AltManufacturerAccess() 0x0075 ITStatus3
Print result of ITStatus3.
void ITStatus3 | ( | byte * | retval | ) |
12.2.41 AltManufacturerAccess() 0x0075 ITStatus3
void LifetimeDataReset | ( | ) |
12.2.19 AltManufacturerAccess() 0x0028 Lifetime Data Reset
This command resets Lifetime data in data flash for ease of manufacturing.
Clears Lifetime Data in DF:
word ManufacturingStatus | ( | ) |
12.2.33 AltManufacturerAccess() 0x0057 ManufacturingStatus
u32 OperationStatus | ( | ) |
12.2.30 AltManufacturerAccess() 0x0054 OperationStatus
void PermanentFailureDataReset | ( | ) |
12.2.20 AltManufacturerAccess() 0x0029 Permanent Fail Data Reset
This command resets PF data in data flash for ease of manufacturing.
u32 PFAlert | ( | ) |
12.2.28 AltManufacturerAccess() 0x0052 PFAlert
u32 PFStatus | ( | ) |
12.2.29 AltManufacturerAccess() 0x0053 PFStatus
u32 SafetyAlert | ( | ) |
12.2.26 AltManufacturerAccess() 0x0050 SafetyAlert
u32 SafetyStatus | ( | ) |
12.2.27 AltManufacturerAccess() 0x0051 SafetyStatus
void SealDevice | ( | ) |
12.2.22 AltManufacturerAccess() 0x0030 Seal Device
This command seals the device for the field, disabling certain commands and access to DF.