Add power enabled check to power API (#68)

This commit is contained in:
Ken Van Hoeylandt
2024-11-03 22:30:41 +01:00
committed by GitHub
parent 632d7ccccf
commit 28c456e2d9
4 changed files with 27 additions and 2 deletions
+2
View File
@@ -8,12 +8,14 @@ extern "C" {
#include <stdint.h>
typedef bool (*PowerIsCharging)();
typedef bool (*PowerIsChargingEnabled)();
typedef void (*PowerSetChargingEnabled)(bool enabled);
typedef uint8_t (*PowerGetBatteryCharge)(); // Power value [0, 255] which maps to 0-100% charge
typedef int32_t (*PowerGetCurrent)(); // Consumption or charge current in mAh
typedef struct {
PowerIsCharging is_charging;
PowerIsChargingEnabled is_charging_enabled;
PowerSetChargingEnabled set_charging_enabled;
PowerGetBatteryCharge get_charge_level;
PowerGetCurrent get_current;