replace touch driver; enable debugging

This commit is contained in:
Manuel
2025-10-30 13:39:49 +01:00
parent 11462ecedc
commit e06c3371b4
2 changed files with 16 additions and 13 deletions

View File

@@ -3,18 +3,19 @@
#ifdef T5_S3_EPAPER_PRO
#include "input/TouchScreenImpl1.h"
#include <TAMC_GT911.h>
#include <Wire.h>
#include <bb_captouch.h>
BBCapTouch bbct;
TAMC_GT911 tp = TAMC_GT911(GT911_PIN_SDA, GT911_PIN_SCL, GT911_PIN_INT, GT911_PIN_RST, EPD_WIDTH, EPD_HEIGHT);
bool readTouch(int16_t *x, int16_t *y)
{
TOUCHINFO ti;
if (!digitalRead(GT911_PIN_INT)) {
if (bbct.getSamples(&ti)) {
*x = ti.x[0];
*y = ti.y[0];
tp.read();
if (tp.isTouched) {
*x = tp.points[0].x;
*y = tp.points[0].y;
LOG_DEBUG("touched(%d/%d)", *x, *y);
return true;
}
}
@@ -24,9 +25,8 @@ bool readTouch(int16_t *x, int16_t *y)
// T5-S3-ePaper Pro specific (late-) init
void lateInitVariant()
{
static TwoWire wire(0);
bbct.init(GT911_PIN_SDA, GT911_PIN_SCL, GT911_PIN_RST, GT911_PIN_INT, 400000, &wire);
bbct.setOrientation(180, EPD_WIDTH, EPD_HEIGHT);
tp.setRotation(ROTATION_INVERTED); // portrait
tp.begin();
touchScreenImpl1 = new TouchScreenImpl1(EPD_WIDTH, EPD_HEIGHT, readTouch);
touchScreenImpl1->init();
}

View File

@@ -4,12 +4,14 @@ board = t5-epaper-s3
board_build.partition = default_16MB.csv
board_check = false
upload_protocol = esptool
build_flags =
build_type = debug
build_flags = -g -O0
${esp32_base.build_flags}
-I variants/esp32s3/t5s3_epaper
-D T5_S3_EPAPER_PRO
-D PRIVATE_HW
-D GPS_POWER_TOGGLE
; -D GPS_POWER_TOGGLE
build_src_filter =
${esp32s3_base.build_src_filter}
lib_deps =
@@ -18,8 +20,9 @@ lib_deps =
lewisxhe/SensorLib@0.3.1
https://github.com/mverch67/BQ27220/archive/07d92be846abd8a0258a50c23198dac0858b22ed.zip
https://github.com/mverch67/FastEPD/archive/07556b76706ae0f708fb7bf3f38f5ebc227ff2dd.zip
https://github.com/bitbank2/bb_captouch/archive/refs/tags/1.3.1.zip
;https://github.com/bitbank2/bb_captouch/archive/refs/tags/1.3.1.zip
;https://github.com/blackketter/GT911/archive/dcadd293d964f397bc8fb81f867d58f08531d729.zip
https://github.com/TAMCTec/gt911-arduino/archive/b3f175e65a799368be9c544e255204e1e74ad2ed.zip
[env:t5s3_epaper_inkhud]
extends = t5s3_epaper_base, inkhud