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
@@ -2,12 +2,8 @@
|
||||
|
||||
#include "Tactility/hal/touch/TouchDevice.h"
|
||||
#include "Tactility/hal/touch/TouchDriver.h"
|
||||
#include <Tactility/TactilityCore.h>
|
||||
#include "lvgl.h"
|
||||
#include <driver/gpio.h>
|
||||
#include <esp_err.h>
|
||||
#include <freertos/FreeRTOS.h>
|
||||
#include <freertos/task.h>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
@@ -61,12 +57,10 @@ public:
|
||||
};
|
||||
|
||||
private:
|
||||
static Xpt2046SoftSpi* instance;
|
||||
std::unique_ptr<Configuration> configuration;
|
||||
lv_indev_t* deviceHandle = nullptr;
|
||||
|
||||
int readSPI(uint8_t command);
|
||||
void cleanup();
|
||||
bool loadCalibration();
|
||||
void saveCalibration();
|
||||
static void touchReadCallback(lv_indev_t* indev, lv_indev_data_t* data);
|
||||
@@ -78,24 +72,20 @@ public:
|
||||
std::string getName() const final { return "Xpt2046SoftSpi"; }
|
||||
std::string getDescription() const final { return "Xpt2046 Soft SPI touch driver"; }
|
||||
|
||||
bool start() override; // zero-arg start
|
||||
bool start() override;
|
||||
bool stop() override;
|
||||
|
||||
bool supportsLvgl() const override;
|
||||
bool startLvgl(lv_display_t* display) override;
|
||||
bool stopLvgl() override;
|
||||
bool stop() override;
|
||||
bool supportsTouchDriver() override;
|
||||
|
||||
bool supportsTouchDriver() override { return true; }
|
||||
std::shared_ptr<tt::hal::touch::TouchDriver> getTouchDriver() override;
|
||||
lv_indev_t* getLvglIndev() override { return deviceHandle; }
|
||||
|
||||
// Original LVGL-specific start
|
||||
bool start(lv_display_t* display);
|
||||
|
||||
// XPT2046-specific methods
|
||||
Point getTouch();
|
||||
void calibrate();
|
||||
void setCalibration(int xMin, int yMin, int xMax, int yMax);
|
||||
bool isTouched();
|
||||
|
||||
// Static instance access
|
||||
static Xpt2046SoftSpi* getInstance() { return instance; }
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user