FL-339: cli diagnostic interface for power subsystem. (#256)

* Core, API: add externs for c++
* Makefile: improve debug speed, flash with openocd, cleanup f2 config
* Power: add cli diagnostic.
* Local: fix api hal externs
* Local: fix externs in main and flipper_hal
* F2: power state dump stabs
* Bootloader flashing with openocd
* F3: move bq drivers to libs
* temporary do not build drivers on local
* temporary do not build drivers on f2

Co-authored-by: aanper <mail@s3f.ru>
This commit is contained in:
あく
2020-12-02 13:47:13 +03:00
committed by GitHub
parent f58b322bb5
commit 3a6fbff8c3
31 changed files with 418 additions and 73 deletions

34
lib/drivers/bq25896.h Normal file
View File

@@ -0,0 +1,34 @@
#pragma once
#include <stdbool.h>
#include <stdint.h>
/* Initialize Driver */
void bq25896_init();
/* Send device into shipping mode */
void bq25896_poweroff();
/* Is currently charging */
bool bq25896_is_charging();
/* Enable otg */
void bq25896_enable_otg();
/* Disable otg */
void bq25896_disable_otg();
/* Get VBUS Voltage in mV */
uint16_t bq25896_get_vbus_voltage();
/* Get VSYS Voltage in mV */
uint16_t bq25896_get_vsys_voltage();
/* Get VBAT Voltage in mV */
uint16_t bq25896_get_vbat_voltage();
/* Get VBAT current in mA */
uint16_t bq25896_get_vbat_current();
/* Get NTC voltage in mpct of REGN */
uint32_t bq25896_get_ntc_mpct();