#pragma once #include #include #include #include #include constexpr auto THMI_S3_POWEREN_GPIO = GPIO_NUM_10; constexpr auto THMI_S3_POWERON_GPIO = GPIO_NUM_14; using tt::hal::power::PowerDevice; class Power 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 "T-hmi Power"; } std::string getDescription() const override { return "Power measurement via ADC"; } bool supportsMetric(MetricType type) const override; bool getMetric(MetricType type, MetricData& data) override; };