You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a similar problem, but I use an internet module w5500 and an LCD tft with ILI9488 driver
which is as follows.
When I initialize the LCD
and then the internet module or vice versa
my LCD touch stops working and the touch no longer works,
and my code is as follows.
my user setup is :
`
#define USER_SETUP_INFO "User_Setup"
// #define ILI9486_DRIVER
#define ILI9488_DRIVER // WARNING: Do not connect ILI9488 display SDO to MISO if other devices share the SPI bus (TFT SDO does NOT tristate when CS is high)
#define SUPPORT_TRANSACTIONS
#define LOAD_GLCD // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH
#define LOAD_FONT2 // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters
#define LOAD_FONT4 // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters
#define LOAD_FONT6 // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm
#define LOAD_FONT7 // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:-.
#define LOAD_FONT8 // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-.
//#define LOAD_FONT8N // Font 8. Alternative to Font 8 above, slightly narrower, so 3 digits fit a 160 pixel TFT
#define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts
// Comment out the #define below to stop the SPIFFS filing system and smooth font code being loaded
// this will save ~20kbytes of FLASH
#define SMOOTH_FONT
#define SPI_FREQUENCY 40000000
// #define SPI_FREQUENCY 55000000 // STM32 SPI1 only (SPI2 maximum is 27MHz)
// #define SPI_FREQUENCY 80000000
// Optional reduced SPI frequency for reading TFT
#define SPI_READ_FREQUENCY 20000000
// The XPT2046 requires a lower SPI clock rate of 2.5MHz so we define that here:
#define SPI_TOUCH_FREQUENCY 600000
`
and my code is this :
I have a similar problem, but I use an internet module w5500 and an LCD tft with ILI9488 driver
which is as follows.
When I initialize the LCD
and then the internet module or vice versa
my LCD touch stops working and the touch no longer works,
and my code is as follows.
my user setup is :
`
#define USER_SETUP_INFO "User_Setup"
// #define ILI9486_DRIVER
#define ILI9488_DRIVER // WARNING: Do not connect ILI9488 display SDO to MISO if other devices share the SPI bus (TFT SDO does NOT tristate when CS is high)
#define SUPPORT_TRANSACTIONS
// --------------------------------------------------------------------- esp32 Wroom DA Module
// #define TFT_SPI_PORT HSPI
#define USE_HSPI_PORT
#define TFT_MISO 12 // SPI MISO (connect to display and touch if shared)
#define TFT_MOSI 13 // SPI MOSI (connect to display and touch if shared)
#define TFT_SCLK 14 // SPI Clock
// TFT display specific
#define TFT_CS 15 // Chip Select for TFT display (ILI9488)
// #define TFT_MISO 19 // SPI MISO (connect to display and touch if shared)
// #define TFT_MOSI 23 // SPI MOSI (connect to display and touch if shared)
// #define TFT_SCLK 18 // SPI Clock
// // TFT display specific
// #define TFT_CS 5 // Chip Select for TFT display (ILI9488)
#define TFT_DC 26 // Data/Command for TFT display
#define TFT_RST 25 // Reset for TFT display
#define TFT_BL 34 // Backlight control (if used)
// // Touch controller specific (e.g., XPT2046)
#define TOUCH_CS 33 // Chip Select for touch controller
// #define TOUCH_PEN 4 // PEN/IRQ pin for detecting touch events
#define TFT_WIDTH 320
#define TFT_HEIGHT 480
#define LOAD_GLCD // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH
#define LOAD_FONT2 // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters
#define LOAD_FONT4 // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters
#define LOAD_FONT6 // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm
#define LOAD_FONT7 // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:-.
#define LOAD_FONT8 // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-.
//#define LOAD_FONT8N // Font 8. Alternative to Font 8 above, slightly narrower, so 3 digits fit a 160 pixel TFT
#define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts
// Comment out the #define below to stop the SPIFFS filing system and smooth font code being loaded
// this will save ~20kbytes of FLASH
#define SMOOTH_FONT
#define SPI_FREQUENCY 40000000
// #define SPI_FREQUENCY 55000000 // STM32 SPI1 only (SPI2 maximum is 27MHz)
// #define SPI_FREQUENCY 80000000
// Optional reduced SPI frequency for reading TFT
#define SPI_READ_FREQUENCY 20000000
// The XPT2046 requires a lower SPI clock rate of 2.5MHz so we define that here:
#define SPI_TOUCH_FREQUENCY 600000
`
and my code is this :
#include <TFT_eSPI.h>
#include <lvgl.h>
#include "ui.h"
#include <Ethernet.h>
#include <EthernetUdp.h>
#include <SPI.h>
#define HSPI_SCK 18
#define HSPI_MISO 19
#define HSPI_MOSI 23
#define HSPI_CS_ETHERNET 5
#define CrowPanel_35
int imgToggleInterval = 1500;
#if defined(CrowPanel_35)
static const uint16_t screenWidth = 480;
static const uint16_t screenHeight = 320;
uint16_t calData[5] = { 353, 3568, 269, 3491, 7 }; /touch caldata/
#endif
TFT_eSPI lcd = TFT_eSPI(); /* TFT entity */
static lv_disp_draw_buf_t draw_buf;
static lv_color_t buf1[screenWidth * screenHeight / 13];
void my_disp_flush(lv_disp_drv_t *disp, const lv_area_t *area, lv_color_t *color_p) {
uint32_t w = (area->x2 - area->x1 + 1);
uint32_t h = (area->y2 - area->y1 + 1);
lcd.startWrite();
lcd.setAddrWindow(area->x1, area->y1, w, h);
lcd.pushColors((uint16_t *)&color_p->full, w * h, true);
lcd.endWrite();
lv_disp_flush_ready(disp);
}
uint16_t touchX, touchY;
void my_touchpad_read(lv_indev_drv_t *indev_driver, lv_indev_data_t *data) {
bool touched = lcd.getTouch(&touchX, &touchY, 600);
if (!touched) {
data->state = LV_INDEV_STATE_REL;
} else {
data->state = LV_INDEV_STATE_PR;
touchX = 480 - touchX;
data->point.x = touchX;
// data->point.y = touchY;
// Serial.println(touchX);
}
}
void LCDinit() {
lcd.begin();
lcd.setRotation(1);
lcd.fillScreen(TFT_BLACK);
lcd.setTouch(calData);
// delay(100);
// Initialize Ethernet (HSPI)
lv_init();
lv_disp_draw_buf_init(&draw_buf, buf1, NULL, screenWidth * screenHeight / 13);
static lv_disp_drv_t disp_drv;
lv_disp_drv_init(&disp_drv);
disp_drv.hor_res = screenWidth;
disp_drv.ver_res = screenHeight;
disp_drv.flush_cb = my_disp_flush;
disp_drv.draw_buf = &draw_buf;
lv_disp_drv_register(&disp_drv);
static lv_indev_drv_t indev_drv;
lv_indev_drv_init(&indev_drv);
indev_drv.type = LV_INDEV_TYPE_POINTER;
indev_drv.read_cb = my_touchpad_read;
lv_indev_drv_register(&indev_drv);
lcd.fillScreen(TFT_BLACK);
ui_init();
updateDisplay(); // Perform display operations
SPI.begin(VSPI_SCK, VSPI_MISO, VSPI_MOSI, VSPI_CS_ETHERNET);
// Ethernet.init(HSPI_CS_ETHERNET);
// Serial.println("Setup display done ");
}
void setup() {
Serial.begin(115200);
LCDinit();
}
void loop() {
lv_task_handler();
delay(5);
}
this is my TFT_eSPI_ESP32.h
#ifdef USE_HSPI_PORT
#ifdef CONFIG_IDF_TARGET_ESP32
#define SPI_PORT HSPI //HSPI is port 2 on ESP32
#else
#define SPI_PORT 3 //HSPI is port 3 on ESP32 S2
#endif
#elif defined(USE_FSPI_PORT)
#define SPI_PORT 2 //FSPI(ESP32 S2)
#else
#ifdef CONFIG_IDF_TARGET_ESP32
#define SPI_PORT VSPI
#elif CONFIG_IDF_TARGET_ESP32S2
#define SPI_PORT 2 //FSPI(ESP32 S2)
#elif CONFIG_IDF_TARGET_ESP32S3
// #define SPI_PORT FSPI // original line replaced by next line : <<<<<<<<<<<<< replaced by
#define SPI_PORT 2 // <<<<<<<<<<<<<<<<<<<<
#endif
#endif
#ifdef RPI_DISPLAY_TYPE
#define CMD_BITS (16-1)
#else
#define CMD_BITS (8-1)
#endif
The text was updated successfully, but these errors were encountered: