Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XPT2046 Touch screen control on other SPI bus #471

Open
paulvk2 opened this issue May 11, 2024 · 3 comments
Open

XPT2046 Touch screen control on other SPI bus #471

paulvk2 opened this issue May 11, 2024 · 3 comments

Comments

@paulvk2
Copy link

paulvk2 commented May 11, 2024

With the ESP32-2432S028 and other similar displays the touch control chip is on the second buss of the ESP32 but tcMenu has no options when the TFT and touch are on different bus.

@davetcc
Copy link
Collaborator

davetcc commented May 15, 2024

Need more information to understand what plugins you're using etc.

For example, the TFT-eSPI plugin uses the libraries internal interrogator, and therefore would be configured within that library. So does the BSP touch plugin.

The only other plugin is the ArduinoLibrary based plugin, I am assuming that. However, someone will need to determine how the plugin needs to change in order to pass in other than the default bus, is it in the variable definition, here in the plugin:

https://github.com/davetcc/tcMenu/blob/master/xmlPlugins/core-display/ArduinoTouchLibraryIntegration.xml#L58

@paulvk2
Copy link
Author

paulvk2 commented May 15, 2024

Using the XPT2046 and the example code that works with the library is
``
// Touchscreen pins
#define XPT2046_IRQ 36 // T_IRQ
#define XPT2046_MOSI 32 // T_DIN
#define XPT2046_MISO 39 // T_OUT
#define XPT2046_CLK 25 // T_CLK
#define XPT2046_CS 33 // T_CS

SPIClass touchscreenSPI = SPIClass(VSPI);
XPT2046_Touchscreen touchscreen(XPT2046_CS, XPT2046_IRQ);
``
So the option to fill in these details would be helpful
This is for the CYD display (ESP32-2432S028) which has the touch IC on the forth spi bus VSPI they are very inexpensive
and a number of sizes exist
Regards Paul and thank you for such a quick reply.

@paulvk2
Copy link
Author

paulvk2 commented May 17, 2024

If you add GFX_Library_for_Arduino for the ESP devices as selection it will simplify things as many displays are preconfigured for use .
In the PDQgraphicstest example are Arduino_GFX_databus.h , Arduino_GFX_dev_device.h , Arduino_GFX_display.h , Arduino_GFX_pins.h . Arduino_GFX_dev_device.h contains a large number of displays by uncommenting the used display the configuration is taken care of and in the TouchCalibration example touch.h just needs the GPIO numbers used
Regards Paul

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants