* preliminary io pin definitions * Update product link * Move to new variant structure and refactor inkHUD - Display does not work and SX1262 init fails on HT752-02 * update variant definitions * add EPD driver * fix lora, add v1/v2 variant targets * adapt pins for v1/v2 * alt button * add compile guards * use lilygo epd47 lib * workaround for INT ERR_NOT_FOUND * USE_EPD (e-ink parallel display) * use FastEPD driver * create screen * EInkParallelDisplay definition * setup screen * dispaly() implementation * enable touchscreen * rotate touch screen * refactor display buffer processing * provide local copy of TwoWire instance as the touch driver calls end() * use larger fonts * replace touch driver; enable debugging * replace touch driver; enable debugging * consider bitsremain == 0 * tryfix crash * fix button * update touch driver * set lora_cs pin * update touch driver and lib reference * add locks * limit Ghosting similar to EInkDynamicDisplay * workaround for FastEPD partial update bug (artifacts) * display() code cleanup * fix a few platformio definitions * more EPD display cleanup * set rotation * use FastEPD arduino I2C by default * touch rotation * update screen for EPD * increase swipe distance for larger screen * EPD UIRenderer * trunk fmt * further #ifdef USE_EPD * disable rotation which messes up w/h; more cleanup * switch off ghosting algo * releease build; V1 buttons * swap V1 buttons * rearrange USE_EINK/EPD macros, use large font * cleanup (revert modified files) * more cleanup * revert * revert file * revert file Removed redundant line continuation in preprocessor directives. * Temporary gate off PSRam calculations until we can fix them * move variant.cpp and update commit references * revert wrong merge * add earlyInitVariant() * initialize all port 0 pins (0-7) as outputs / HIGH --------- Co-authored-by: Thomas Göttgens <tgoettgens@gmail.com> Co-authored-by: Jason P <applewiz@mac.com> Co-authored-by: Jonathan Bennett <jbennett@incomsystems.biz> Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
47 lines
1.1 KiB
C++
47 lines
1.1 KiB
C++
#include "configuration.h"
|
|
|
|
#ifdef T5_S3_EPAPER_PRO
|
|
|
|
#include "TouchDrvGT911.hpp"
|
|
#include "Wire.h"
|
|
#include "input/TouchScreenImpl1.h"
|
|
|
|
TouchDrvGT911 touch;
|
|
|
|
bool readTouch(int16_t *x, int16_t *y)
|
|
{
|
|
if (!digitalRead(GT911_PIN_INT)) {
|
|
int16_t raw_x;
|
|
int16_t raw_y;
|
|
if (touch.getPoint(&raw_x, &raw_y)) {
|
|
// rotate 90° for landscape
|
|
*x = raw_y;
|
|
*y = EPD_WIDTH - 1 - raw_x;
|
|
LOG_DEBUG("touched(%d/%d)", *x, *y);
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
void earlyInitVariant()
|
|
{
|
|
pinMode(LORA_CS, OUTPUT);
|
|
digitalWrite(LORA_CS, HIGH);
|
|
pinMode(SDCARD_CS, OUTPUT);
|
|
digitalWrite(SDCARD_CS, HIGH);
|
|
pinMode(BOARD_BL_EN, OUTPUT);
|
|
}
|
|
|
|
// T5-S3-ePaper Pro specific (late-) init
|
|
void lateInitVariant(void)
|
|
{
|
|
touch.setPins(GT911_PIN_RST, GT911_PIN_INT);
|
|
if (touch.begin(Wire, GT911_SLAVE_ADDRESS_L, GT911_PIN_SDA, GT911_PIN_SCL)) {
|
|
touchScreenImpl1 = new TouchScreenImpl1(EPD_WIDTH, EPD_HEIGHT, readTouch);
|
|
touchScreenImpl1->init();
|
|
} else {
|
|
LOG_ERROR("Failed to find touch controller!");
|
|
}
|
|
}
|
|
#endif |