Power: bq25896 and bq27220 drivers, portable power api. (#224)
* Power: add portability layer, port to F3. * F3: bq25896 driver stab * GUI: new primary and secondary fonts * F3: bq25896 register map, basic functions * F3: move bq27220 command descritpion to separate file. Code format. * Power: OTG enable/disable * Power: choose more correct profile * F3: pet bq25896 watchdog sometimes
This commit is contained in:
28
firmware/targets/f3/api-hal/api-hal-power.c
Normal file
28
firmware/targets/f3/api-hal/api-hal-power.c
Normal file
@@ -0,0 +1,28 @@
|
||||
#include <api-hal-power.h>
|
||||
#include <bq27220.h>
|
||||
#include <bq25896.h>
|
||||
|
||||
void api_hal_power_init() {
|
||||
bq27220_init();
|
||||
bq25896_init();
|
||||
}
|
||||
|
||||
uint8_t api_hal_power_get_pct() {
|
||||
return bq27220_get_state_of_charge();
|
||||
}
|
||||
|
||||
bool api_hal_power_is_charging() {
|
||||
return bq25896_is_charging();
|
||||
}
|
||||
|
||||
void api_hal_power_off() {
|
||||
bq25896_poweroff();
|
||||
}
|
||||
|
||||
void api_hal_power_enable_otg() {
|
||||
bq25896_enable_otg();
|
||||
}
|
||||
|
||||
void api_hal_power_disable_otg() {
|
||||
bq25896_disable_otg();
|
||||
}
|
Reference in New Issue
Block a user