esp-iot-solution
esp-iot-solution copied to clipboard
Add support for 4 wire resistive touchscreen without controller (AEGHB-363)
Adds support for 4-wire resistive touchscreens connected directly to the microcontroller (ie. without using an SPI or I2c touchscreen controller chip). Uses 2x ADC pins and 2x GPIO pins.
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.
Thank you for your contribution. That's good. Do you have some descriptions about how to connect the hardware and use it? That will facilitate other developers to use or test the driver.
I'll add a minimal example in a few days.
The short version is connect Y+ and X- of the touchscreen to (digital output capable) ADC pins, and Y- and X+ to digital output pins.
Enable the RES4W driver in the menuconfig, then initialise in exactly the same manner as the existing touchscreen drivers, populating the configuration structure with the gpio pin numbers the touchscreen is connected to.
After that it's no different to the other existing touchscreen drivers. Calibrate and use.
I have updated the PR to be based off the current master, and improved the behaviour around sample averaging/filtering.
I have also added a test case to touch_test.c
The "Touch RES4W test" should work if you connect a resistive touch panel directly to the ESP32 and connect Y+ to GPIO32, Y- to GPIO26, X+ to GPIO25 and X- to GPIO33. Use the same ILI9341 display as the other test cases use with the same configuration.
@dvosully Thank you for your work. We have component esp_lcd_touch
here https://github.com/espressif/esp-bsp/tree/master/components/lcd_touch/esp_lcd_touch and it will be nice to add into it. Or maybe only use this component and make new touch driver esp_lcd_touch_adc
like another LCD touch drivers here: https://github.com/espressif/esp-bsp/tree/master/components/lcd_touch
And I think, that it should be inside BSP repository too, there are all LCD and touch drivers.
Thank you very much!