Unphone battery status (#176)
This commit is contained in:
committed by
GitHub
parent
c3bcf93698
commit
97b8007aca
@@ -0,0 +1,24 @@
|
||||
#pragma once
|
||||
|
||||
#include "hal/Power.h"
|
||||
#include <memory>
|
||||
|
||||
using namespace tt::hal;
|
||||
|
||||
class UnPhonePower : public Power {
|
||||
|
||||
public:
|
||||
|
||||
UnPhonePower() = default;
|
||||
~UnPhonePower() = default;
|
||||
|
||||
bool supportsMetric(MetricType type) const override;
|
||||
bool getMetric(Power::MetricType type, Power::MetricData& data) override;
|
||||
|
||||
private:
|
||||
|
||||
bool readBatteryVoltageOnce(uint32_t& output) const;
|
||||
bool readBatteryVoltageSampled(uint32_t& output) const;
|
||||
};
|
||||
|
||||
std::shared_ptr<Power> unPhoneGetPower();
|
||||
Reference in New Issue
Block a user