Add calibration methods and app (#520)

This commit is contained in:
NellowTCS
2026-04-13 12:58:27 -06:00
committed by GitHub
parent 4dd2762b79
commit 10ba4f58e2
11 changed files with 724 additions and 380 deletions
@@ -81,8 +81,7 @@ private:
std::shared_ptr<tt::hal::touch::TouchDriver> touchDriver;
int readSPI(uint8_t command);
bool loadCalibration();
void saveCalibration();
bool readRawPoint(uint16_t& x, uint16_t& y);
static void touchReadCallback(lv_indev_t* indev, lv_indev_data_t* data);
public:
@@ -100,12 +99,11 @@ public:
bool stopLvgl() override;
bool supportsTouchDriver() override { return true; }
bool supportsCalibration() const override { return true; }
std::shared_ptr<tt::hal::touch::TouchDriver> getTouchDriver() override;
lv_indev_t* getLvglIndev() override { return lvglDevice; }
// XPT2046-specific methods
bool getTouchPoint(Point& point);
void calibrate();
void setCalibration(int xMin, int yMin, int xMax, int yMax);
bool isTouched();
};