Ken Van Hoeylandt 5b375c21bb
Implemented new driver projects (#210)
Moved drivers from the `Boards` projects to `Drivers` folder:
- BQ24295
- AW9523
- AXP2101

The I2C drivers are theoretically cross-platform, but for now they are only built for ESP32.
2025-02-08 21:08:23 +01:00

31 lines
843 B
C++

#pragma once
#include <Axp2101.h>
#include <Tactility/hal/Power.h>
#include <memory>
#include <utility>
using namespace tt::hal;
class CoreS3Power final : public Power {
std::shared_ptr<Axp2101> axpDevice;
public:
explicit CoreS3Power(std::shared_ptr<Axp2101> axp) : axpDevice(std::move(axp)) {}
~CoreS3Power() override = default;
std::string getName() const final { return "AXP2101 Power"; }
std::string getDescription() const final { return "Power management via I2C"; }
bool supportsMetric(MetricType type) const override;
bool getMetric(Power::MetricType type, Power::MetricData& data) override;
bool supportsChargeControl() const override { return true; }
bool isAllowedToCharge() const override;
void setAllowedToCharge(bool canCharge) override;
};
std::shared_ptr<Power> createPower();