mirror of
https://github.com/ByteWelder/Tactility.git
synced 2026-02-18 19:03:16 +00:00
- Implement `UiScale` in `hal::Configuration`: small screens with no touch can now opt for a more optimized experience (e.g. Cardputer, Waveshare 1.47, Waveshare 1.3", etc.) - Fix for Cardputer UART configuration and added I2C configuration - Fix for software keyboard bug in Gui - Removed deprecated fields from `hal::Configuration` - Updated the simulator devices to use the new HAL config - add `bool tt::hal::hasDevice(Device::Type)` - Cleanup of `AppList` app code - Improve `Gpio` app for small screen devices - Added various ESP32 GCC wrappers to wrap LVGL functions (with manipulations for small screen devices) - Moved `Launcher` assets to `assets/` subfolder - Optimized `Toolbar` for small screen devices - Stop showing `system/` partition in `FileBrowser` because it's read-only and not very useful. Created `config::SHOW_SYSTEM_PARTITION` to override this behaviour. - Hide apps when their required hardware isn't available (I2C, UART, PowerDevice) - Fix for `CYD-2432S032C` DPI setting
28 lines
900 B
C++
28 lines
900 B
C++
#pragma once
|
|
|
|
#include <ChargeFromAdcVoltage.h>
|
|
#include <Tactility/hal/power/PowerDevice.h>
|
|
|
|
using tt::hal::power::PowerDevice;
|
|
|
|
/**
|
|
* Uses Voltage measurements to estimate charge.
|
|
* Supports voltage and charge level metrics.
|
|
* Can be overridden to further extend supported metrics.
|
|
*/
|
|
class EstimatedPower final : public PowerDevice {
|
|
|
|
std::unique_ptr<ChargeFromAdcVoltage> chargeFromAdcVoltage;
|
|
|
|
public:
|
|
|
|
explicit EstimatedPower(ChargeFromAdcVoltage::Configuration configuration) :
|
|
chargeFromAdcVoltage(std::make_unique<ChargeFromAdcVoltage>(std::move(configuration))) {}
|
|
|
|
std::string getName() const override { return "ADC Power Measurement"; }
|
|
std::string getDescription() const override { return "Power measurement interface via ADC pin"; }
|
|
|
|
bool supportsMetric(MetricType type) const override;
|
|
bool getMetric(MetricType type, MetricData& data) override;
|
|
};
|