mirror of
https://github.com/ByteWelder/Tactility.git
synced 2026-02-18 19:03:16 +00:00
22 lines
607 B
C++
22 lines
607 B
C++
#pragma once
|
|
|
|
#include <cstdint>
|
|
|
|
namespace tt::hal {
|
|
|
|
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 isCharging;
|
|
PowerIsChargingEnabled isChargingEnabled;
|
|
PowerSetChargingEnabled setChargingEnabled;
|
|
PowerGetBatteryCharge getChargeLevel;
|
|
PowerGetCurrent getCurrent;
|
|
} Power;
|
|
|
|
} // namespace tt
|