BQ28Z610 Driver
BQ28Z610 Battery fuel gauge device driver for Arduino
service.h
Go to the documentation of this file.
1 
29 #pragma once
30 
31 #include <Arduino.h>
32 
33 #include "globals.h"
34 #include "utils.h"
35 #include "std_data_commands.h"
37 #include "data_flash_access.h"
38 
56 int securityMode();
57 
74 
90 
96 void manufactoryChargeFet(bool mode);
97 
104 void manufactoryDischargeFet(bool mode);
105 
111 void fetControl(bool mode);
112 
122 bool isPermanentFail();
123 
128 float cellVoltage1();
129 
134 float cellVoltage2();
135 
140 float batVoltage();
141 
146 float packVoltage();
147 
152 
157 
162 
181 
185 void PermanentFailCheck();
186 
190 void fetsStatus();
191 
201 void setEnabledChargingSocThreshold(bool enabled);
202 
223 void learningCycleInit(int designCapacityMah, int designEnergyCwh, word qMaxCell0, word qMaxCell1, word cycleCount);
224 
241 void learningCycleLog();
242 
247 int dod0PassedQ();
248 
254 int getOccThreshold();
255 
265 void setOccThreshold(int occThreshold);
12.2 0x3E, 0x3F AltManufacturerAccess() headers
static const u32 DEFAULT_FULL_ACCESS_KEY
BQ28Z610 default Full Access key.
Definition: globals.h:93
static const u32 DEFAULT_UNSEAL_KEY
BQ28Z610 default Unseal key.
Definition: globals.h:83
12.2.45 Data Flash Access() 0x4000–0x5FFF headers
Global constants.
void unsealDevice(u32 key=DeviceSecurity::DEFAULT_UNSEAL_KEY)
9.5.2 SEALED to UNSEALED
Definition: service.cpp:84
float batVoltage()
Definition: service.cpp:257
void manufactoryChargeFet(bool mode)
Brings Charge FET into desired mode.
Definition: service.cpp:124
void fetControl(bool mode)
Brings ManufacturingStatus[FET_EN] into desired mode.
Definition: service.cpp:174
void setEnabledChargingSocThreshold(bool enabled)
Enable or Disable turning charging FET off at 60% SOC.
Definition: service.cpp:470
void OvertemperatureInChargeProtectionCheck()
2.8 Overtemperature in Charge Protection
Definition: service.cpp:369
void ShortCircuitInDischargeProtectionCheck()
2.6.3 Short Circuit in Discharge Protection
Definition: service.cpp:338
float packVoltage()
Definition: service.cpp:277
bool isPermanentFail()
Chapter 3: Permanent Fail.
Definition: service.cpp:197
int getOccThreshold()
Overcurrent in Charge trip threshold.
Definition: service.cpp:598
void fetsStatus()
Print flags that correspond to the FETs status.
Definition: service.cpp:436
int dod0PassedQ()
12.2.40 AltManufacturerAccess() 0x0074 ITStatus2
Definition: service.cpp:499
float cellVoltage1()
Definition: service.cpp:217
void CellUndervoltageProtectionCheck()
2.2 Cell Undervoltage Protection
Definition: service.cpp:296
int securityMode()
Request current security mode of the device.
Definition: service.cpp:48
void fullAccessDevice(u32 key=DeviceSecurity::DEFAULT_FULL_ACCESS_KEY)
9.5.3 UNSEALED to FULL ACCESS
Definition: service.cpp:114
void manufactoryDischargeFet(bool mode)
Brings Discharge FET into desired mode.
Definition: service.cpp:150
void setOccThreshold(int occThreshold)
Overcurrent in Charge trip threshold.
Definition: service.cpp:611
float cellVoltage2()
Definition: service.cpp:237
void ShortCircuitInChargeProtectionCheck()
2.6.2 Short Circuit in Charge Protection
Definition: service.cpp:318
void learningCycleLog()
Print into Serial port the important information for the Learning Cycle.
Definition: service.cpp:555
void PermanentFailCheck()
Chapter 3 Permanent Fail.
Definition: service.cpp:408
void learningCycleInit(int designCapacityMah, int designEnergyCwh, word qMaxCell0, word qMaxCell1, word cycleCount)
Write initial parameters to the Gas Gauging Device.
Definition: service.cpp:526
12.1 Standard Data Commands headers
Util functions headers.