C++ refactoring (#91)
This commit is contained in:
committed by
GitHub
parent
d06137ba76
commit
ca5d4b8226
@@ -0,0 +1,21 @@
|
||||
#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
|
||||
Reference in New Issue
Block a user