2020-12-02 13:47:13 +03:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include <stdint.h>
|
2022-01-05 19:10:18 +03:00
|
|
|
#include <furi_hal_i2c.h>
|
2020-12-02 13:47:13 +03:00
|
|
|
|
2021-03-24 12:35:33 +03:00
|
|
|
/** Initialize Driver */
|
2021-11-28 21:28:19 +03:00
|
|
|
void bq25896_init(FuriHalI2cBusHandle* handle);
|
2020-12-02 13:47:13 +03:00
|
|
|
|
2021-03-24 12:35:33 +03:00
|
|
|
/** Send device into shipping mode */
|
2021-11-28 21:28:19 +03:00
|
|
|
void bq25896_poweroff(FuriHalI2cBusHandle* handle);
|
2020-12-02 13:47:13 +03:00
|
|
|
|
2021-03-24 12:35:33 +03:00
|
|
|
/** Is currently charging */
|
2021-11-28 21:28:19 +03:00
|
|
|
bool bq25896_is_charging(FuriHalI2cBusHandle* handle);
|
2020-12-02 13:47:13 +03:00
|
|
|
|
2021-10-04 10:01:41 +03:00
|
|
|
/** Enable charging */
|
2021-11-28 21:28:19 +03:00
|
|
|
void bq25896_enable_charging(FuriHalI2cBusHandle* handle);
|
2021-10-04 10:01:41 +03:00
|
|
|
|
|
|
|
/** Disable charging */
|
2021-11-28 21:28:19 +03:00
|
|
|
void bq25896_disable_charging(FuriHalI2cBusHandle* handle);
|
2021-10-04 10:01:41 +03:00
|
|
|
|
2021-03-24 12:35:33 +03:00
|
|
|
/** Enable otg */
|
2021-11-28 21:28:19 +03:00
|
|
|
void bq25896_enable_otg(FuriHalI2cBusHandle* handle);
|
2020-12-02 13:47:13 +03:00
|
|
|
|
2021-03-24 12:35:33 +03:00
|
|
|
/** Disable otg */
|
2021-11-28 21:28:19 +03:00
|
|
|
void bq25896_disable_otg(FuriHalI2cBusHandle* handle);
|
2020-12-02 13:47:13 +03:00
|
|
|
|
2021-09-30 23:03:28 +03:00
|
|
|
/** Is otg enabled */
|
2021-11-28 21:28:19 +03:00
|
|
|
bool bq25896_is_otg_enabled(FuriHalI2cBusHandle* handle);
|
2021-09-30 23:03:28 +03:00
|
|
|
|
2022-01-21 19:55:44 +03:00
|
|
|
/** Check OTG BOOST Fault status */
|
|
|
|
bool bq25896_check_otg_fault(FuriHalI2cBusHandle* handle);
|
|
|
|
|
2021-03-24 12:35:33 +03:00
|
|
|
/** Get VBUS Voltage in mV */
|
2021-11-28 21:28:19 +03:00
|
|
|
uint16_t bq25896_get_vbus_voltage(FuriHalI2cBusHandle* handle);
|
2020-12-02 13:47:13 +03:00
|
|
|
|
2021-03-24 12:35:33 +03:00
|
|
|
/** Get VSYS Voltage in mV */
|
2021-11-28 21:28:19 +03:00
|
|
|
uint16_t bq25896_get_vsys_voltage(FuriHalI2cBusHandle* handle);
|
2020-12-02 13:47:13 +03:00
|
|
|
|
2021-03-24 12:35:33 +03:00
|
|
|
/** Get VBAT Voltage in mV */
|
2021-11-28 21:28:19 +03:00
|
|
|
uint16_t bq25896_get_vbat_voltage(FuriHalI2cBusHandle* handle);
|
2020-12-02 13:47:13 +03:00
|
|
|
|
2021-03-24 12:35:33 +03:00
|
|
|
/** Get VBAT current in mA */
|
2021-11-28 21:28:19 +03:00
|
|
|
uint16_t bq25896_get_vbat_current(FuriHalI2cBusHandle* handle);
|
2020-12-02 13:47:13 +03:00
|
|
|
|
2021-03-24 12:35:33 +03:00
|
|
|
/** Get NTC voltage in mpct of REGN */
|
2021-11-28 21:28:19 +03:00
|
|
|
uint32_t bq25896_get_ntc_mpct(FuriHalI2cBusHandle* handle);
|