Quite problematic chip with quite bad documentation. More...
Go to the source code of this file.
Data Structures | |
| struct | Bq27220ControlStatus |
| struct | Bq27220BatteryStatus |
| struct | Bq27220OperationStatus |
| struct | Bq27220GaugingStatus |
Macros | |
| #define | BQ27220_ERROR 0x0 |
| #define | BQ27220_SUCCESS 0x1 |
Typedefs | |
| typedef struct BQ27220DMData | BQ27220DMData |
Enumerations | |
| enum | Bq27220OperationStatusSec { Bq27220OperationStatusSecSealed = 0b11 , Bq27220OperationStatusSecUnsealed = 0b10 , Bq27220OperationStatusSecFull = 0b01 } |
Functions | |
| bool | bq27220_init (const FuriHalI2cBusHandle *handle, const BQ27220DMData *data_memory) |
| Initialize Driver. | |
| bool | bq27220_reset (const FuriHalI2cBusHandle *handle) |
| Reset gauge. | |
| bool | bq27220_seal (const FuriHalI2cBusHandle *handle) |
| Seal gauge access. | |
| bool | bq27220_unseal (const FuriHalI2cBusHandle *handle) |
| Unseal gauge access. | |
| bool | bq27220_full_access (const FuriHalI2cBusHandle *handle) |
| Get full access. | |
| uint16_t | bq27220_get_voltage (const FuriHalI2cBusHandle *handle) |
| Get battery voltage. | |
| int16_t | bq27220_get_current (const FuriHalI2cBusHandle *handle) |
| Get current. | |
| bool | bq27220_get_control_status (const FuriHalI2cBusHandle *handle, Bq27220ControlStatus *control_status) |
| Get control status. | |
| bool | bq27220_get_battery_status (const FuriHalI2cBusHandle *handle, Bq27220BatteryStatus *battery_status) |
| Get battery status. | |
| bool | bq27220_get_operation_status (const FuriHalI2cBusHandle *handle, Bq27220OperationStatus *operation_status) |
| Get operation status. | |
| bool | bq27220_get_gauging_status (const FuriHalI2cBusHandle *handle, Bq27220GaugingStatus *gauging_status) |
| Get gauging status. | |
| uint16_t | bq27220_get_temperature (const FuriHalI2cBusHandle *handle) |
| Get temperature. | |
| uint16_t | bq27220_get_full_charge_capacity (const FuriHalI2cBusHandle *handle) |
| Get compensated full charge capacity. | |
| uint16_t | bq27220_get_design_capacity (const FuriHalI2cBusHandle *handle) |
| Get design capacity. | |
| uint16_t | bq27220_get_remaining_capacity (const FuriHalI2cBusHandle *handle) |
| Get remaining capacity. | |
| uint16_t | bq27220_get_state_of_charge (const FuriHalI2cBusHandle *handle) |
| Get predicted remaining battery capacity. | |
| uint16_t | bq27220_get_state_of_health (const FuriHalI2cBusHandle *handle) |
| Get ratio of full charge capacity over design capacity. | |
Quite problematic chip with quite bad documentation.
Couple things to keep in mind:
Couple advises if you'll need to modify this driver:
| bool bq27220_full_access | ( | const FuriHalI2cBusHandle * | handle | ) |
Get full access.
| handle | The I2C Bus handle |
| bool bq27220_get_battery_status | ( | const FuriHalI2cBusHandle * | handle, |
| Bq27220BatteryStatus * | battery_status ) |
Get battery status.
| handle | The handle |
| battery_status | The battery status |
| bool bq27220_get_control_status | ( | const FuriHalI2cBusHandle * | handle, |
| Bq27220ControlStatus * | control_status ) |
Get control status.
| handle | The handle |
| control_status | The control status |
| int16_t bq27220_get_current | ( | const FuriHalI2cBusHandle * | handle | ) |
Get current.
| handle | The I2C Bus handle |
| uint16_t bq27220_get_design_capacity | ( | const FuriHalI2cBusHandle * | handle | ) |
Get design capacity.
| handle | The I2C Bus handle |
| uint16_t bq27220_get_full_charge_capacity | ( | const FuriHalI2cBusHandle * | handle | ) |
Get compensated full charge capacity.
| handle | The I2C Bus handle |
| bool bq27220_get_gauging_status | ( | const FuriHalI2cBusHandle * | handle, |
| Bq27220GaugingStatus * | gauging_status ) |
Get gauging status.
| handle | The handle |
| gauging_status | The gauging status |
| bool bq27220_get_operation_status | ( | const FuriHalI2cBusHandle * | handle, |
| Bq27220OperationStatus * | operation_status ) |
Get operation status.
| handle | The handle |
| operation_status | The operation status |
| uint16_t bq27220_get_remaining_capacity | ( | const FuriHalI2cBusHandle * | handle | ) |
Get remaining capacity.
| handle | The I2C Bus handle |
| uint16_t bq27220_get_state_of_charge | ( | const FuriHalI2cBusHandle * | handle | ) |
Get predicted remaining battery capacity.
| handle | The I2C Bus handle |
| uint16_t bq27220_get_state_of_health | ( | const FuriHalI2cBusHandle * | handle | ) |
Get ratio of full charge capacity over design capacity.
| handle | The I2C Bus handle |
| uint16_t bq27220_get_temperature | ( | const FuriHalI2cBusHandle * | handle | ) |
Get temperature.
| handle | The I2C Bus handle |
| uint16_t bq27220_get_voltage | ( | const FuriHalI2cBusHandle * | handle | ) |
Get battery voltage.
| handle | The I2C Bus handle |
| bool bq27220_init | ( | const FuriHalI2cBusHandle * | handle, |
| const BQ27220DMData * | data_memory ) |
Initialize Driver.
This routine performs a lot of things under the hood:
| handle | The I2C Bus handle | |
| [in] | data_memory | The data memory to be uploaded into gauge |
| bool bq27220_reset | ( | const FuriHalI2cBusHandle * | handle | ) |
Reset gauge.
| handle | The I2C Bus handle |
| bool bq27220_seal | ( | const FuriHalI2cBusHandle * | handle | ) |
Seal gauge access.
| handle | The I2C Bus handle |
| bool bq27220_unseal | ( | const FuriHalI2cBusHandle * | handle | ) |
Unseal gauge access.
| handle | The I2C Bus handle |