mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2024-11-27 15:00:46 +00:00
3a6fbff8c3
* 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>
40 lines
744 B
C
40 lines
744 B
C
#pragma once
|
|
|
|
#include <stdint.h>
|
|
#include <stdbool.h>
|
|
#include <m-string.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/* Initialize drivers */
|
|
void api_hal_power_init();
|
|
|
|
/* Get predicted remaining battery capacity in percents */
|
|
uint8_t api_hal_power_get_pct();
|
|
|
|
/* Get charging status */
|
|
bool api_hal_power_is_charging();
|
|
|
|
/* Poweroff system */
|
|
void api_hal_power_off();
|
|
|
|
/* OTG enable */
|
|
void api_hal_power_enable_otg();
|
|
|
|
/* OTG disable */
|
|
void api_hal_power_disable_otg();
|
|
|
|
/* Get battery voltage in V */
|
|
float api_hal_power_get_battery_voltage();
|
|
|
|
/* Get battery current in A */
|
|
float api_hal_power_get_battery_current();
|
|
|
|
/* Get power system component state */
|
|
void api_hal_power_dump_state(string_t buffer);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|