esp-iot-solution icon indicating copy to clipboard operation
esp-iot-solution copied to clipboard

Add support for 4 wire resistive touchscreen without controller (AEGHB-363)

Open dvosully opened this issue 3 years ago • 5 comments

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.

dvosully avatar Dec 18 '21 14:12 dvosully

CLA assistant check
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.

CLAassistant avatar Dec 18 '21 14:12 CLAassistant

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.

alic-maker avatar Dec 18 '21 15:12 alic-maker

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.

dvosully avatar Dec 18 '21 16:12 dvosully

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 avatar Dec 08 '22 04:12 dvosully

@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!

espzav avatar Sep 05 '23 08:09 espzav