Cardputer adv and more (#395)
- Fixed TCA8418 driver - Updated T-Lora Pager for TCA driver fixes - Fixed issues with T-Lora keyboard driver - Implemented Cardputer Adv - Cleanup of Cardputer (regular) - Fix sdkconfig for E32R28T and E32R32P - Disable Wi-Fi on boot (was accidentally pushed before)
This commit is contained in:
committed by
GitHub
parent
647678ff82
commit
efd3c6041c
@@ -0,0 +1,29 @@
|
||||
#pragma once
|
||||
|
||||
#include <Tactility/hal/power/PowerDevice.h>
|
||||
#include <ChargeFromVoltage.h>
|
||||
#include <esp_adc_cal.h>
|
||||
#include <string>
|
||||
|
||||
using tt::hal::power::PowerDevice;
|
||||
|
||||
class CardputerPower final : public PowerDevice {
|
||||
|
||||
ChargeFromVoltage chargeFromAdcVoltage = ChargeFromVoltage(3.3f, 4.2f);
|
||||
bool initialized = false;
|
||||
esp_adc_cal_characteristics_t adcCharacteristics;
|
||||
bool calibrated = false;
|
||||
|
||||
bool adcInitCalibration();
|
||||
uint32_t adcReadValue() const;
|
||||
|
||||
bool ensureInitialized();
|
||||
|
||||
public:
|
||||
|
||||
std::string getName() const override { return "Cardputer Power"; }
|
||||
std::string getDescription() const override { return "Power measurement via ADC"; }
|
||||
|
||||
bool supportsMetric(MetricType type) const override;
|
||||
bool getMetric(MetricType type, MetricData& data) override;
|
||||
};
|
||||
Reference in New Issue
Block a user