35#define BQ27220_ERROR 0x0
36#define BQ27220_SUCCESS 0x1
49_Static_assert(
sizeof(
Bq27220ControlStatus) == 2,
"Incorrect Bq27220ControlStatus structure size");
72_Static_assert(
sizeof(
Bq27220BatteryStatus) == 2,
"Incorrect Bq27220BatteryStatus structure size");
75 Bq27220OperationStatusSecSealed = 0b11,
76 Bq27220OperationStatusSecUnsealed = 0b10,
77 Bq27220OperationStatusSecFull = 0b01,
78} Bq27220OperationStatusSec;
97 "Incorrect Bq27220OperationStatus structure size");
118_Static_assert(
sizeof(
Bq27220GaugingStatus) == 2,
"Incorrect Bq27220GaugingStatus structure size");
bool bq27220_get_control_status(FuriHalI2cBusHandle *handle, Bq27220ControlStatus *control_status)
Get control status.
Definition bq27220.c:529
bool bq27220_init(FuriHalI2cBusHandle *handle, const BQ27220DMData *data_memory)
Initialize Driver.
Definition bq27220.c:271
uint16_t bq27220_get_state_of_health(FuriHalI2cBusHandle *handle)
Get ratio of full charge capacity over design capacity.
Definition bq27220.c:575
bool bq27220_unseal(FuriHalI2cBusHandle *handle)
Unseal gauge access.
Definition bq27220.c:434
uint16_t bq27220_get_remaining_capacity(FuriHalI2cBusHandle *handle)
Get remaining capacity.
Definition bq27220.c:567
bool bq27220_full_access(FuriHalI2cBusHandle *handle)
Get full access.
Definition bq27220.c:468
bool bq27220_reset(FuriHalI2cBusHandle *handle)
Reset gauge.
Definition bq27220.c:368
uint16_t bq27220_get_voltage(FuriHalI2cBusHandle *handle)
Get battery voltage.
Definition bq27220.c:521
bool bq27220_seal(FuriHalI2cBusHandle *handle)
Seal gauge access.
Definition bq27220.c:399
uint16_t bq27220_get_temperature(FuriHalI2cBusHandle *handle)
Get temperature.
Definition bq27220.c:555
uint16_t bq27220_get_full_charge_capacity(FuriHalI2cBusHandle *handle)
Get compensated full charge capacity.
Definition bq27220.c:559
bool bq27220_get_battery_status(FuriHalI2cBusHandle *handle, Bq27220BatteryStatus *battery_status)
Get battery status.
Definition bq27220.c:533
uint16_t bq27220_get_state_of_charge(FuriHalI2cBusHandle *handle)
Get predicted remaining battery capacity.
Definition bq27220.c:571
bool bq27220_get_operation_status(FuriHalI2cBusHandle *handle, Bq27220OperationStatus *operation_status)
Get operation status.
Definition bq27220.c:537
bool bq27220_get_gauging_status(FuriHalI2cBusHandle *handle, Bq27220GaugingStatus *gauging_status)
Get gauging status.
Definition bq27220.c:543
int16_t bq27220_get_current(FuriHalI2cBusHandle *handle)
Get current.
Definition bq27220.c:525
uint16_t bq27220_get_design_capacity(FuriHalI2cBusHandle *handle)
Get design capacity.
Definition bq27220.c:563
Definition bq27220_data_memory.h:54
bool TCA
Terminate Charge Alarm.
Definition bq27220.h:59
bool FD
Full-discharge is detected.
Definition bq27220.h:69
bool AUTH_GD
Detect inserted battery.
Definition bq27220.h:57
bool RSVD
Reserved.
Definition bq27220.h:60
bool SYSDWN
System down bit indicating the system should shut down.
Definition bq27220.h:54
bool OTD
Overtemperature in discharge condition is detected.
Definition bq27220.h:64
bool OTC
Overtemperature in charge condition is detected.
Definition bq27220.h:65
bool DSG
The device is in DISCHARGE.
Definition bq27220.h:53
bool OCVGD
Good OCV measurement taken.
Definition bq27220.h:58
bool TDA
Terminate Discharge Alarm.
Definition bq27220.h:55
bool SLEEP
Device is operating in SLEEP mode when set.
Definition bq27220.h:66
bool OCVCOMP
An OCV measurement update is complete.
Definition bq27220.h:68
bool CHGINH
Charge inhibit.
Definition bq27220.h:62
bool OCVFAIL
Status bit indicating that the OCV reading failed due to current.
Definition bq27220.h:67
bool BATTPRES
Battery Present detected.
Definition bq27220.h:56
bool FC
Full-charged is detected.
Definition bq27220.h:63
bool CCA
Coulomb Counter Calibration routine is active.
Definition bq27220.h:43
uint8_t BATT_ID
Battery Identification.
Definition bq27220.h:40
bool SNOOZE
SNOOZE mode is enabled.
Definition bq27220.h:41
uint8_t RSVD1
Reserved.
Definition bq27220.h:46
bool BCA
fuel gauge board calibration routine is active
Definition bq27220.h:42
uint8_t RSVD0
Reserved.
Definition bq27220.h:44
bool RSVD0
Reserved.
Definition bq27220.h:105
bool FD
Full Discharge.
Definition bq27220.h:101
bool EDV2
Cell voltage is above or below EDV2 threshold.
Definition bq27220.h:114
bool EDV1
Cell voltage is above or below EDV1 threshold.
Definition bq27220.h:113
bool TC
Terminate Charge.
Definition bq27220.h:104
bool TD
Terminate Discharge.
Definition bq27220.h:103
bool VDQ
Charge cycle FCC update qualification.
Definition bq27220.h:115
bool FCCX
fcc1hz clock going into CC: 0 = 1 Hz, 1 = 16 Hz
Definition bq27220.h:111
bool FC
Full Charge.
Definition bq27220.h:102
bool DSG
DISCHARGE or RELAXATION.
Definition bq27220.h:107
uint8_t RSVD2
Reserved.
Definition bq27220.h:112
bool EDV
Cell voltage is above or below EDV0 threshold.
Definition bq27220.h:106
uint8_t RSVD1
Reserved.
Definition bq27220.h:110
bool CF
Battery conditioning is needed.
Definition bq27220.h:108
uint8_t RSVD1
Reserved.
Definition bq27220.h:90
bool VDQ
Indicates if Current discharge cycle is NOT qualified or qualified for an FCC updated.
Definition bq27220.h:85
bool SMTH
RemainingCapacity is scaled by smooth engine.
Definition bq27220.h:87
bool CFGUPDATE
Gauge is in CONFIG UPDATE mode.
Definition bq27220.h:91
bool BTPINT
BTP threshold has been crossed.
Definition bq27220.h:88
bool CALMD
Calibration mode enabled.
Definition bq27220.h:82
bool INITCOMP
gauge initialization is complete
Definition bq27220.h:86
bool EDV2
EDV2 threshold exceeded.
Definition bq27220.h:84
uint8_t SEC
Current security access.
Definition bq27220.h:83
uint8_t RSVD0
Reserved.
Definition bq27220.h:92
FuriHal i2c handle.
Definition furi_hal_i2c_types.h:44