Merge develop into main (#316)
- Updated all boards to use `hal::Configuration.createDevices` - Updated all boards to use new directory structure and file naming convention - Refactored `Xpt2046SoftSpi` driver. - Created `Axp2101Power` device in `Drivers/AXP2101` - Removed global static instances from some drivers (instances that kept a reference to the Device*) - Improved `SystemInfoApp` UI: better memory labels, hide external memory bar when there's no PSRAM - Fix for HAL: register touch devices after displays are registered - Fix for Boot splash hanging on WiFi init: unlock file lock after using it
This commit is contained in:
committed by
GitHub
parent
1deaf4c426
commit
1627b9fa85
@@ -0,0 +1,28 @@
|
||||
#pragma once
|
||||
|
||||
#include "Tactility/hal/power/PowerDevice.h"
|
||||
#include <Axp2101.h>
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
|
||||
using tt::hal::power::PowerDevice;
|
||||
|
||||
class Axp2101Power final : public PowerDevice {
|
||||
|
||||
std::shared_ptr<Axp2101> axpDevice;
|
||||
|
||||
public:
|
||||
|
||||
explicit Axp2101Power(std::shared_ptr<Axp2101> axp) : axpDevice(std::move(axp)) {}
|
||||
~Axp2101Power() override = default;
|
||||
|
||||
std::string getName() const override { return "AXP2101 Power"; }
|
||||
std::string getDescription() const override { return "Power management via AXP2101 over I2C"; }
|
||||
|
||||
bool supportsMetric(MetricType type) const override;
|
||||
bool getMetric(MetricType type, MetricData& data) override;
|
||||
|
||||
bool supportsChargeControl() const override { return true; }
|
||||
bool isAllowedToCharge() const override;
|
||||
void setAllowedToCharge(bool canCharge) override;
|
||||
};
|
||||
Reference in New Issue
Block a user