Power HAL API. More...
#include <stdint.h>
#include <stdbool.h>
#include <core/string.h>
#include <core/common_defines.h>
#include <toolbox/property.h>
Go to the source code of this file.
Enumerations | |
enum | FuriHalPowerIC { FuriHalPowerICCharger , FuriHalPowerICFuelGauge } |
Power IC type. | |
Functions | |
void | furi_hal_power_init (void) |
Initialize drivers. | |
bool | furi_hal_power_gauge_is_ok (void) |
Check if gauge is ok. | |
bool | furi_hal_power_is_shutdown_requested (void) |
Check if gauge requests system shutdown. | |
uint16_t | furi_hal_power_insomnia_level (void) |
Get current insomnia level. | |
void | furi_hal_power_insomnia_enter (void) |
Enter insomnia mode Prevents device from going to sleep. | |
void | furi_hal_power_insomnia_exit (void) |
Exit insomnia mode Allow device to go to sleep. | |
bool | furi_hal_power_sleep_available (void) |
Check if sleep available. | |
void | furi_hal_power_sleep (void) |
Go to sleep. | |
uint8_t | furi_hal_power_get_pct (void) |
Get predicted remaining battery capacity in percents. | |
uint8_t | furi_hal_power_get_bat_health_pct (void) |
Get battery health state in percents. | |
bool | furi_hal_power_is_charging (void) |
Get charging status. | |
bool | furi_hal_power_is_charging_done (void) |
Get charge complete status. | |
void | furi_hal_power_shutdown (void) |
Switch MCU to SHUTDOWN. | |
void | furi_hal_power_off (void) |
Poweroff device. | |
FURI_NORETURN void | furi_hal_power_reset (void) |
Reset device. | |
bool | furi_hal_power_enable_otg (void) |
OTG enable. | |
void | furi_hal_power_disable_otg (void) |
OTG disable. | |
bool | furi_hal_power_check_otg_fault (void) |
Check OTG status fault. | |
void | furi_hal_power_check_otg_status (void) |
Check OTG status and disable it if falt happened. | |
bool | furi_hal_power_is_otg_enabled (void) |
Get OTG status. | |
float | furi_hal_power_get_battery_charge_voltage_limit (void) |
Get battery charge voltage limit in V. | |
void | furi_hal_power_set_battery_charge_voltage_limit (float voltage) |
Set battery charge voltage limit in V. | |
uint32_t | furi_hal_power_get_battery_remaining_capacity (void) |
Get remaining battery battery capacity in mAh. | |
uint32_t | furi_hal_power_get_battery_full_capacity (void) |
Get full charge battery capacity in mAh. | |
uint32_t | furi_hal_power_get_battery_design_capacity (void) |
Get battery capacity in mAh from battery profile. | |
float | furi_hal_power_get_battery_voltage (FuriHalPowerIC ic) |
Get battery voltage in V. | |
float | furi_hal_power_get_battery_current (FuriHalPowerIC ic) |
Get battery current in A. | |
float | furi_hal_power_get_battery_temperature (FuriHalPowerIC ic) |
Get temperature in C. | |
float | furi_hal_power_get_usb_voltage (void) |
Get USB voltage in V. | |
void | furi_hal_power_enable_external_3_3v (void) |
Enable 3.3v on external gpio and sd card. | |
void | furi_hal_power_disable_external_3_3v (void) |
Disable 3.3v on external gpio and sd card. | |
void | furi_hal_power_suppress_charge_enter (void) |
Enter supress charge mode. | |
void | furi_hal_power_suppress_charge_exit (void) |
Exit supress charge mode. | |
void | furi_hal_power_info_get (PropertyValueCallback callback, char sep, void *context) |
Get power information. | |
void | furi_hal_power_debug_get (PropertyValueCallback callback, void *context) |
Get power debug information. | |
Power HAL API.
void furi_hal_power_debug_get | ( | PropertyValueCallback | callback, |
void * | context ) |
Get power debug information.
[in] | callback | callback to provide with new data |
[in] | context | context to pass to callback |
bool furi_hal_power_gauge_is_ok | ( | void | ) |
Check if gauge is ok.
Verifies that:
uint8_t furi_hal_power_get_bat_health_pct | ( | void | ) |
Get battery health state in percents.
float furi_hal_power_get_battery_charge_voltage_limit | ( | void | ) |
Get battery charge voltage limit in V.
float furi_hal_power_get_battery_current | ( | FuriHalPowerIC | ic | ) |
Get battery current in A.
[in] | ic | FuriHalPowerIc to get measurment |
uint32_t furi_hal_power_get_battery_design_capacity | ( | void | ) |
Get battery capacity in mAh from battery profile.
uint32_t furi_hal_power_get_battery_full_capacity | ( | void | ) |
Get full charge battery capacity in mAh.
uint32_t furi_hal_power_get_battery_remaining_capacity | ( | void | ) |
Get remaining battery battery capacity in mAh.
float furi_hal_power_get_battery_temperature | ( | FuriHalPowerIC | ic | ) |
Get temperature in C.
[in] | ic | FuriHalPowerIc to get measurment |
float furi_hal_power_get_battery_voltage | ( | FuriHalPowerIC | ic | ) |
Get battery voltage in V.
[in] | ic | FuriHalPowerIc to get measurment |
uint8_t furi_hal_power_get_pct | ( | void | ) |
Get predicted remaining battery capacity in percents.
float furi_hal_power_get_usb_voltage | ( | void | ) |
Get USB voltage in V.
void furi_hal_power_info_get | ( | PropertyValueCallback | callback, |
char | sep, | ||
void * | context ) |
Get power information.
[in] | callback | callback to provide with new data |
[in] | sep | category separator character |
[in] | context | context to pass to callback |
void furi_hal_power_insomnia_enter | ( | void | ) |
Enter insomnia mode Prevents device from going to sleep.
void furi_hal_power_insomnia_exit | ( | void | ) |
Exit insomnia mode Allow device to go to sleep.
uint16_t furi_hal_power_insomnia_level | ( | void | ) |
Get current insomnia level.
bool furi_hal_power_is_charging | ( | void | ) |
Get charging status.
bool furi_hal_power_is_charging_done | ( | void | ) |
Get charge complete status.
bool furi_hal_power_is_otg_enabled | ( | void | ) |
Get OTG status.
bool furi_hal_power_is_shutdown_requested | ( | void | ) |
Check if gauge requests system shutdown.
void furi_hal_power_set_battery_charge_voltage_limit | ( | float | voltage | ) |
Set battery charge voltage limit in V.
Invalid values will be clamped downward to the nearest valid value.
[in] | voltage | voltage in V |
bool furi_hal_power_sleep_available | ( | void | ) |
Check if sleep available.
void furi_hal_power_suppress_charge_enter | ( | void | ) |
Enter supress charge mode.
Use this function when your application need clean power supply.