Implement device management (#199)
- Added `tt::hal::Device` and functions (de)register devices and search for them. - Refactored apps: `Power` and `Display` settings apps now use the device API to find devices. - Implemented the new API for all existing drivers for all devices, including the simulator. - Updated HAL Configuration to return `std::shared_ptr` instead of raw pointers. - Added test project for headless tests and implemented tests for the new code.
This commit is contained in:
committed by
GitHub
parent
c87200a80d
commit
cff0605b0a
@@ -205,10 +205,10 @@ void YellowDisplay::setGammaCurve(uint8_t index) {
|
||||
}
|
||||
}
|
||||
|
||||
tt::hal::Touch* _Nullable YellowDisplay::createTouch() {
|
||||
return static_cast<tt::hal::Touch*>(new YellowTouch());
|
||||
std::shared_ptr<tt::hal::Touch> _Nullable YellowDisplay::createTouch() {
|
||||
return std::make_shared<YellowTouch>();
|
||||
}
|
||||
|
||||
tt::hal::Display* createDisplay() {
|
||||
return static_cast<tt::hal::Display*>(new YellowDisplay());
|
||||
std::shared_ptr<tt::hal::Display> createDisplay() {
|
||||
return std::make_shared<YellowDisplay>();
|
||||
}
|
||||
|
||||
@@ -16,11 +16,14 @@ private:
|
||||
|
||||
public:
|
||||
|
||||
std::string getName() const final { return "ILI9341"; }
|
||||
std::string getDescription() const final { return "SPI display"; }
|
||||
|
||||
bool start() override;
|
||||
|
||||
bool stop() override;
|
||||
|
||||
tt::hal::Touch* _Nullable createTouch() override;
|
||||
std::shared_ptr<tt::hal::Touch> _Nullable createTouch() override;
|
||||
|
||||
void setBacklightDuty(uint8_t backlightDuty) override;
|
||||
bool supportsBacklightDuty() const override { return true; }
|
||||
@@ -31,4 +34,4 @@ public:
|
||||
lv_display_t* _Nullable getLvglDisplay() const override { return displayHandle; }
|
||||
};
|
||||
|
||||
tt::hal::Display* createDisplay();
|
||||
std::shared_ptr<tt::hal::Display> createDisplay();
|
||||
|
||||
@@ -5,12 +5,20 @@
|
||||
#include <esp_lcd_touch.h>
|
||||
|
||||
class YellowTouch : public tt::hal::Touch {
|
||||
|
||||
private:
|
||||
|
||||
esp_lcd_panel_io_handle_t ioHandle = nullptr;
|
||||
esp_lcd_touch_handle_t touchHandle = nullptr;
|
||||
lv_indev_t* _Nullable deviceHandle = nullptr;
|
||||
|
||||
void cleanup();
|
||||
|
||||
public:
|
||||
|
||||
std::string getName() const final { return "CST816S"; }
|
||||
std::string getDescription() const final { return "I2C touch driver"; }
|
||||
|
||||
bool start(lv_display_t* display) override;
|
||||
bool stop() override;
|
||||
lv_indev_t* _Nullable getLvglIndev() override { return deviceHandle; }
|
||||
|
||||
@@ -191,8 +191,8 @@ void TdeckDisplay::setPowerOn(bool turnOn) {
|
||||
}
|
||||
}
|
||||
|
||||
tt::hal::Touch* _Nullable TdeckDisplay::createTouch() {
|
||||
return static_cast<tt::hal::Touch*>(new TdeckTouch());
|
||||
std::shared_ptr<tt::hal::Touch> _Nullable TdeckDisplay::createTouch() {
|
||||
return std::make_shared<TdeckTouch>();
|
||||
}
|
||||
|
||||
void TdeckDisplay::setBacklightDuty(uint8_t backlightDuty) {
|
||||
@@ -233,6 +233,6 @@ void TdeckDisplay::setGammaCurve(uint8_t index) {
|
||||
}
|
||||
}
|
||||
|
||||
tt::hal::Display* createDisplay() {
|
||||
return static_cast<tt::hal::Display*>(new TdeckDisplay());
|
||||
std::shared_ptr<tt::hal::Display> createDisplay() {
|
||||
return std::make_shared<TdeckDisplay>();
|
||||
}
|
||||
|
||||
@@ -17,6 +17,9 @@ private:
|
||||
|
||||
public:
|
||||
|
||||
std::string getName() const final { return "ST7780"; }
|
||||
std::string getDescription() const final { return "SPI display"; }
|
||||
|
||||
bool start() override;
|
||||
|
||||
bool stop() override;
|
||||
@@ -25,7 +28,7 @@ public:
|
||||
bool isPoweredOn() const override { return poweredOn; };
|
||||
bool supportsPowerControl() const override { return true; }
|
||||
|
||||
tt::hal::Touch* _Nullable createTouch() override;
|
||||
std::shared_ptr<tt::hal::Touch> _Nullable createTouch() override;
|
||||
|
||||
void setBacklightDuty(uint8_t backlightDuty) override;
|
||||
bool supportsBacklightDuty() const override { return true; }
|
||||
@@ -40,4 +43,4 @@ private:
|
||||
static bool startBacklight();
|
||||
};
|
||||
|
||||
tt::hal::Display* createDisplay();
|
||||
std::shared_ptr<tt::hal::Display> createDisplay();
|
||||
|
||||
@@ -62,6 +62,6 @@ bool TdeckKeyboard::isAttached() const {
|
||||
return tt::hal::i2c::masterHasDeviceAtAddress(TDECK_KEYBOARD_I2C_BUS_HANDLE, TDECK_KEYBOARD_SLAVE_ADDRESS, 100);
|
||||
}
|
||||
|
||||
tt::hal::Keyboard* createKeyboard() {
|
||||
return dynamic_cast<tt::hal::Keyboard*>(new TdeckKeyboard());
|
||||
std::shared_ptr<tt::hal::Keyboard> createKeyboard() {
|
||||
return std::make_shared<TdeckKeyboard>();
|
||||
}
|
||||
|
||||
@@ -6,13 +6,20 @@
|
||||
#include <esp_lcd_touch.h>
|
||||
|
||||
class TdeckKeyboard : public tt::hal::Keyboard {
|
||||
|
||||
private:
|
||||
|
||||
lv_indev_t* _Nullable deviceHandle = nullptr;
|
||||
|
||||
public:
|
||||
|
||||
std::string getName() const final { return "T-Deck Keyboard"; }
|
||||
std::string getDescription() const final { return "I2C keyboard"; }
|
||||
|
||||
bool start(lv_display_t* display) override;
|
||||
bool stop() override;
|
||||
bool isAttached() const override;
|
||||
lv_indev_t* _Nullable getLvglIndev() override { return deviceHandle; }
|
||||
};
|
||||
|
||||
tt::hal::Keyboard* createKeyboard();
|
||||
std::shared_ptr<tt::hal::Keyboard> createKeyboard();
|
||||
|
||||
@@ -15,6 +15,9 @@ public:
|
||||
TdeckPower();
|
||||
~TdeckPower();
|
||||
|
||||
std::string getName() const final { return "ADC Power Measurement"; }
|
||||
std::string getDescription() const final { return "Power measurement interface via ADC pin"; }
|
||||
|
||||
bool supportsMetric(MetricType type) const override;
|
||||
bool getMetric(Power::MetricType type, Power::MetricData& data) override;
|
||||
|
||||
|
||||
@@ -6,12 +6,19 @@
|
||||
#include <esp_lcd_touch.h>
|
||||
|
||||
class TdeckTouch : public tt::hal::Touch {
|
||||
|
||||
private:
|
||||
|
||||
std::string getName() const final { return "GT911"; }
|
||||
std::string getDescription() const final { return "I2C Touch Driver"; }
|
||||
|
||||
esp_lcd_panel_io_handle_t _Nullable ioHandle = nullptr;
|
||||
esp_lcd_touch_handle_t _Nullable touchHandle = nullptr;
|
||||
lv_indev_t* _Nullable deviceHandle = nullptr;
|
||||
void cleanup();
|
||||
|
||||
public:
|
||||
|
||||
bool start(lv_display_t* display) override;
|
||||
bool stop() override;
|
||||
lv_indev_t* _Nullable getLvglIndev() override { return deviceHandle; }
|
||||
|
||||
@@ -153,10 +153,10 @@ void Core2Display::setGammaCurve(uint8_t index) {
|
||||
}
|
||||
}
|
||||
|
||||
tt::hal::Touch* _Nullable Core2Display::createTouch() {
|
||||
return static_cast<tt::hal::Touch*>(new Core2Touch());
|
||||
std::shared_ptr<tt::hal::Touch> _Nullable Core2Display::createTouch() {
|
||||
return std::make_shared<Core2Touch>();
|
||||
}
|
||||
|
||||
tt::hal::Display* createDisplay() {
|
||||
return static_cast<tt::hal::Display*>(new Core2Display());
|
||||
std::shared_ptr<tt::hal::Display> createDisplay() {
|
||||
return std::make_shared<Core2Display>();
|
||||
}
|
||||
|
||||
@@ -17,11 +17,14 @@ private:
|
||||
|
||||
public:
|
||||
|
||||
std::string getName() const final { return "ILI9342C"; }
|
||||
std::string getDescription() const final { return "Display (ILI9342C with an ILI9341 driver)"; }
|
||||
|
||||
bool start() override;
|
||||
|
||||
bool stop() override;
|
||||
|
||||
tt::hal::Touch* _Nullable createTouch() override;
|
||||
std::shared_ptr<tt::hal::Touch> _Nullable createTouch() override;
|
||||
|
||||
bool supportsBacklightDuty() const override { return false; }
|
||||
|
||||
@@ -31,4 +34,4 @@ public:
|
||||
lv_display_t* _Nullable getLvglDisplay() const override { return displayHandle; }
|
||||
};
|
||||
|
||||
tt::hal::Display* createDisplay();
|
||||
std::shared_ptr<tt::hal::Display> createDisplay();
|
||||
|
||||
@@ -12,6 +12,9 @@ public:
|
||||
Core2Power() = default;
|
||||
~Core2Power() override = default;
|
||||
|
||||
std::string getName() const final { return "AXP192 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;
|
||||
|
||||
|
||||
@@ -23,6 +23,9 @@ public:
|
||||
|
||||
Core2Touch();
|
||||
|
||||
std::string getName() const final { return "FT6336U"; }
|
||||
std::string getDescription() const final { return "I2C touch driver"; }
|
||||
|
||||
bool start(lv_display_t* display) override;
|
||||
bool stop() override;
|
||||
|
||||
|
||||
@@ -4,12 +4,15 @@
|
||||
|
||||
#define AW9523_ADDRESS 0x58
|
||||
|
||||
class Aw9523 : I2cDevice {
|
||||
class Aw9523 : public tt::hal::i2c::I2cDevice {
|
||||
|
||||
public:
|
||||
|
||||
explicit Aw9523(i2c_port_t port) : I2cDevice(port, AW9523_ADDRESS) {}
|
||||
|
||||
std::string getName() const final { return "AW9523"; }
|
||||
std::string getDescription() const final { return "GPIO expander with LED driver and I2C interface."; }
|
||||
|
||||
bool readP0(uint8_t& output) const;
|
||||
bool readP1(uint8_t& output) const;
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* - https://github.com/m5stack/M5Unified/blob/master/src/utility/AXP2101_Class.cpp
|
||||
* - http://file.whycan.com/files/members/6736/AXP2101_Datasheet_V1.0_en_3832.pdf
|
||||
*/
|
||||
class Axp2101 : I2cDevice {
|
||||
class Axp2101 final : public tt::hal::i2c::I2cDevice {
|
||||
|
||||
public:
|
||||
|
||||
@@ -21,6 +21,9 @@ public:
|
||||
|
||||
explicit Axp2101(i2c_port_t port) : I2cDevice(port, AXP2101_ADDRESS) {}
|
||||
|
||||
std::string getName() const final { return "AXP2101"; }
|
||||
std::string getDescription() const final { return "Power management with I2C interface."; }
|
||||
|
||||
bool setRegisters(uint8_t* bytePairs, size_t bytePairsSize) const;
|
||||
|
||||
bool getBatteryVoltage(float& vbatMillis) const;
|
||||
|
||||
@@ -181,10 +181,10 @@ void CoreS3Display::setBacklightDuty(uint8_t backlightDuty) {
|
||||
}
|
||||
}
|
||||
|
||||
tt::hal::Touch* _Nullable CoreS3Display::createTouch() {
|
||||
return static_cast<tt::hal::Touch*>(new CoreS3Touch());
|
||||
std::shared_ptr<tt::hal::Touch> _Nullable CoreS3Display::createTouch() {
|
||||
return std::make_shared<CoreS3Touch>();
|
||||
}
|
||||
|
||||
tt::hal::Display* createDisplay() {
|
||||
return static_cast<tt::hal::Display*>(new CoreS3Display());
|
||||
std::shared_ptr<tt::hal::Display> createDisplay() {
|
||||
return std::make_shared<CoreS3Display>();
|
||||
}
|
||||
|
||||
@@ -16,11 +16,14 @@ private:
|
||||
|
||||
public:
|
||||
|
||||
std::string getName() const final { return "ILI9342C"; }
|
||||
std::string getDescription() const final { return "Display (ILI9342C with an ILI9341 driver)"; }
|
||||
|
||||
bool start() override;
|
||||
|
||||
bool stop() override;
|
||||
|
||||
tt::hal::Touch* _Nullable createTouch() override;
|
||||
std::shared_ptr<tt::hal::Touch> _Nullable createTouch() override;
|
||||
|
||||
void setBacklightDuty(uint8_t backlightDuty) override;
|
||||
bool supportsBacklightDuty() const override { return true; }
|
||||
@@ -31,4 +34,4 @@ public:
|
||||
lv_display_t* _Nullable getLvglDisplay() const override { return displayHandle; }
|
||||
};
|
||||
|
||||
tt::hal::Display* createDisplay();
|
||||
std::shared_ptr<tt::hal::Display> createDisplay();
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#include "CoreS3Power.h"
|
||||
#include <Tactility/TactilityCore.h>
|
||||
|
||||
#define TAG "core2_power"
|
||||
|
||||
|
||||
@@ -16,6 +16,9 @@ public:
|
||||
CoreS3Power() = default;
|
||||
~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;
|
||||
|
||||
|
||||
@@ -5,12 +5,20 @@
|
||||
#include <esp_lcd_touch.h>
|
||||
|
||||
class CoreS3Touch : public tt::hal::Touch {
|
||||
|
||||
private:
|
||||
|
||||
esp_lcd_panel_io_handle_t ioHandle = nullptr;
|
||||
esp_lcd_touch_handle_t touchHandle = nullptr;
|
||||
lv_indev_t* _Nullable deviceHandle = nullptr;
|
||||
|
||||
void cleanup();
|
||||
|
||||
public:
|
||||
|
||||
std::string getName() const final { return "FT6336U"; }
|
||||
std::string getDescription() const final { return "I2C touch driver"; }
|
||||
|
||||
bool start(lv_display_t* display) override;
|
||||
bool stop() override;
|
||||
lv_indev_t* _Nullable getLvglIndev() override { return deviceHandle; }
|
||||
|
||||
@@ -2,23 +2,28 @@
|
||||
|
||||
#include "SdlTouch.h"
|
||||
#include <Tactility/hal/Display.h>
|
||||
#include <memory>
|
||||
|
||||
extern lv_disp_t* displayHandle;
|
||||
|
||||
class SdlDisplay : public tt::hal::Display {
|
||||
class SdlDisplay final : public tt::hal::Display {
|
||||
public:
|
||||
|
||||
std::string getName() const final { return "SDL Display"; }
|
||||
std::string getDescription() const final { return ""; }
|
||||
|
||||
bool start() override {
|
||||
return displayHandle != nullptr;
|
||||
}
|
||||
|
||||
bool stop() override { tt_crash("Not supported"); }
|
||||
|
||||
tt::hal::Touch* _Nullable createTouch() override { return dynamic_cast<tt::hal::Touch*>(new SdlTouch()); }
|
||||
std::shared_ptr<tt::hal::Touch> _Nullable createTouch() override { return std::make_shared<SdlTouch>(); }
|
||||
|
||||
lv_display_t* _Nullable getLvglDisplay() const override { return displayHandle; }
|
||||
};
|
||||
|
||||
tt::hal::Display* createDisplay() {
|
||||
return static_cast<tt::hal::Display*>(new SdlDisplay());
|
||||
std::shared_ptr<tt::hal::Display> createDisplay() {
|
||||
return std::make_shared<SdlDisplay>();
|
||||
}
|
||||
|
||||
|
||||
@@ -3,11 +3,15 @@
|
||||
#include <Tactility/hal/Keyboard.h>
|
||||
#include <Tactility/TactilityCore.h>
|
||||
|
||||
class SdlKeyboard : public tt::hal::Keyboard {
|
||||
class SdlKeyboard final : public tt::hal::Keyboard {
|
||||
private:
|
||||
lv_indev_t* _Nullable handle = nullptr;
|
||||
|
||||
public:
|
||||
|
||||
std::string getName() const final { return "SDL Keyboard"; }
|
||||
std::string getDescription() const final { return "SDL keyboard device"; }
|
||||
|
||||
bool start(lv_display_t* display) override {
|
||||
handle = lv_sdl_keyboard_create();
|
||||
return handle != nullptr;
|
||||
@@ -20,6 +24,6 @@ public:
|
||||
lv_indev_t* _Nullable getLvglIndev() override { return handle; }
|
||||
};
|
||||
|
||||
tt::hal::Keyboard* createKeyboard() {
|
||||
return static_cast<tt::hal::Keyboard*>(new SdlKeyboard());
|
||||
std::shared_ptr<tt::hal::Keyboard> createKeyboard() {
|
||||
return std::make_shared<SdlKeyboard>();
|
||||
}
|
||||
|
||||
@@ -3,11 +3,15 @@
|
||||
#include <Tactility/hal/Touch.h>
|
||||
#include <Tactility/TactilityCore.h>
|
||||
|
||||
class SdlTouch : public tt::hal::Touch {
|
||||
class SdlTouch final : public tt::hal::Touch {
|
||||
private:
|
||||
lv_indev_t* _Nullable handle = nullptr;
|
||||
|
||||
public:
|
||||
|
||||
std::string getName() const final { return "SDL Pointer"; }
|
||||
std::string getDescription() const final { return "SDL mouse/touch pointer device"; }
|
||||
|
||||
bool start(lv_display_t* display) override {
|
||||
handle = lv_sdl_mouse_create();
|
||||
return handle != nullptr;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
using namespace tt::hal;
|
||||
|
||||
class SimulatorPower : public Power {
|
||||
class SimulatorPower final : public Power {
|
||||
|
||||
bool allowedToCharge = false;
|
||||
|
||||
@@ -14,6 +14,9 @@ public:
|
||||
SimulatorPower() = default;
|
||||
~SimulatorPower() override = default;
|
||||
|
||||
std::string getName() const final { return "Power Mock"; }
|
||||
std::string getDescription() const final { return ""; }
|
||||
|
||||
bool supportsMetric(MetricType type) const override;
|
||||
bool getMetric(Power::MetricType type, Power::MetricData& data) override;
|
||||
|
||||
|
||||
@@ -4,16 +4,24 @@
|
||||
|
||||
using namespace tt::hal;
|
||||
|
||||
class SimulatorSdCard : public SdCard {
|
||||
class SimulatorSdCard final : public SdCard {
|
||||
|
||||
private:
|
||||
|
||||
State state;
|
||||
|
||||
public:
|
||||
|
||||
SimulatorSdCard() : SdCard(MountBehaviour::AtBoot), state(State::Unmounted) {}
|
||||
|
||||
std::string getName() const final { return "Mock SD Card"; }
|
||||
std::string getDescription() const final { return ""; }
|
||||
|
||||
bool mount(const char* mountPath) override {
|
||||
state = State::Mounted;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool unmount() override {
|
||||
state = State::Unmounted;
|
||||
return true;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
#define BQ24295_ADDRESS 0x6BU
|
||||
|
||||
class Bq24295 : I2cDevice {
|
||||
class Bq24295 final : public tt::hal::i2c::I2cDevice {
|
||||
|
||||
private:
|
||||
|
||||
@@ -12,6 +12,10 @@ private:
|
||||
|
||||
public:
|
||||
|
||||
std::string getName() const final { return "BQ24295"; }
|
||||
|
||||
std::string getDescription() const final { return "I2C-controlled single cell USB charger"; }
|
||||
|
||||
enum class WatchDogTimer {
|
||||
Disabled = 0b000000,
|
||||
Enabled40s = 0b010000,
|
||||
|
||||
@@ -30,8 +30,8 @@ bool UnPhoneDisplay::start() {
|
||||
lv_display_set_color_format(displayHandle, LV_COLOR_FORMAT_NATIVE);
|
||||
|
||||
// TODO malloc to use SPIRAM
|
||||
static auto* buffer1 = (uint8_t*)heap_caps_malloc(BUFFER_SIZE, MALLOC_CAP_SPIRAM);
|
||||
static auto* buffer2 = (uint8_t*)heap_caps_malloc(BUFFER_SIZE, MALLOC_CAP_SPIRAM);
|
||||
buffer1 = (uint8_t*)heap_caps_malloc(BUFFER_SIZE, MALLOC_CAP_SPIRAM);
|
||||
buffer2 = (uint8_t*)heap_caps_malloc(BUFFER_SIZE, MALLOC_CAP_SPIRAM);
|
||||
assert(buffer1 != nullptr);
|
||||
assert(buffer2 != nullptr);
|
||||
|
||||
@@ -61,13 +61,18 @@ bool UnPhoneDisplay::stop() {
|
||||
lv_display_delete(displayHandle);
|
||||
displayHandle = nullptr;
|
||||
|
||||
heap_caps_free(buffer1);
|
||||
heap_caps_free(buffer2);
|
||||
buffer1 = nullptr;
|
||||
buffer2 = nullptr;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
tt::hal::Touch* _Nullable UnPhoneDisplay::createTouch() {
|
||||
return static_cast<tt::hal::Touch*>(new UnPhoneTouch());
|
||||
std::shared_ptr<tt::hal::Touch> _Nullable UnPhoneDisplay::createTouch() {
|
||||
return std::make_shared<UnPhoneTouch>();
|
||||
}
|
||||
|
||||
tt::hal::Display* createDisplay() {
|
||||
return static_cast<tt::hal::Display*>(new UnPhoneDisplay());
|
||||
std::shared_ptr<tt::hal::Display> createDisplay() {
|
||||
return std::make_shared<UnPhoneDisplay>();
|
||||
}
|
||||
|
||||
@@ -11,16 +11,21 @@ class UnPhoneDisplay : public tt::hal::Display {
|
||||
private:
|
||||
|
||||
lv_display_t* displayHandle = nullptr;
|
||||
uint8_t* buffer1 = nullptr;
|
||||
uint8_t* buffer2 = nullptr;
|
||||
|
||||
public:
|
||||
|
||||
std::string getName() const final { return "HX8357"; }
|
||||
std::string getDescription() const final { return "SPI display"; }
|
||||
|
||||
bool start() override;
|
||||
|
||||
bool stop() override;
|
||||
|
||||
tt::hal::Touch* _Nullable createTouch() override;
|
||||
std::shared_ptr<tt::hal::Touch> _Nullable createTouch() override;
|
||||
|
||||
lv_display_t* _Nullable getLvglDisplay() const override { return displayHandle; }
|
||||
};
|
||||
|
||||
tt::hal::Display* createDisplay();
|
||||
std::shared_ptr<tt::hal::Display> createDisplay();
|
||||
|
||||
@@ -12,6 +12,9 @@ public:
|
||||
UnPhonePower() = default;
|
||||
~UnPhonePower() = default;
|
||||
|
||||
std::string getName() const final { return "XPT2046 Power Measurement"; }
|
||||
std::string getDescription() const final { return "Power interface via XPT2046 voltage measurement"; }
|
||||
|
||||
bool supportsMetric(MetricType type) const override;
|
||||
bool getMetric(Power::MetricType type, Power::MetricData& data) override;
|
||||
|
||||
|
||||
@@ -18,6 +18,9 @@ private:
|
||||
|
||||
public:
|
||||
|
||||
std::string getName() const final { return "XPT2046"; }
|
||||
std::string getDescription() const final { return "I2C touch driver"; }
|
||||
|
||||
bool start(lv_display_t* display) override;
|
||||
bool stop() override;
|
||||
lv_indev_t* _Nullable getLvglIndev() override { return deviceHandle; }
|
||||
|
||||
Reference in New Issue
Block a user