Updated screenshots and .gitignore of HelloWorld (#291)
* T-Deck Pro work in progress * Add .gitignore to HelloWorld
This commit is contained in:
committed by
GitHub
parent
29e4350517
commit
6de0f442fb
@@ -0,0 +1,30 @@
|
||||
#pragma once
|
||||
|
||||
#include "Tactility/hal/power/PowerDevice.h"
|
||||
#include <esp_adc/adc_oneshot.h>
|
||||
#include <memory>
|
||||
|
||||
using tt::hal::power::PowerDevice;
|
||||
|
||||
class TdeckPower : public PowerDevice {
|
||||
|
||||
adc_oneshot_unit_handle_t adcHandle = nullptr;
|
||||
|
||||
public:
|
||||
|
||||
TdeckPower();
|
||||
~TdeckPower();
|
||||
|
||||
std::string getName() const final { return "ADC Power Measurement"; }
|
||||
std::string getDescription() const final { return "Power measurement interface via ADC pin"; }
|
||||
|
||||
bool supportsMetric(MetricType type) const override;
|
||||
bool getMetric(MetricType type, MetricData& data) override;
|
||||
|
||||
private:
|
||||
|
||||
bool readBatteryVoltageSampled(uint32_t& output);
|
||||
bool readBatteryVoltageOnce(uint32_t& output);
|
||||
};
|
||||
|
||||
std::shared_ptr<PowerDevice> tdeck_get_power();
|
||||
Reference in New Issue
Block a user