rzeldent / platformio-espressif32-sunton

Board definitions for the Sunton Smart display boards (CYD Cheap Yellow Display). These definitions contain not only contain the CPU information but also the connections and devices present on the board.
https://github.com/rzeldent/esp32-smartdisplay
97 stars 28 forks source link

[ESP32-2432S024C] uses CST820 instead of CST816 and the INT GPIO is different #51

Open regystro opened 7 months ago

regystro commented 7 months ago

Hi. I recently bought an ESP32-2432S024C, and can confirm that there are some changes regarding board definition: https://github.com/rzeldent/platformio-espressif32-sunton/blob/main/esp32-2432S024C.json

  1. The touch sensor is a CST820 instead of "'-D TOUCH_CST816S_I2C'"
  2. The Interrupt GPIO is 22 instead of "'-D CST816S_TOUCH_CONFIG_INT_GPIO_NUM=21'"

I tested it with https://esphome.io/components/touchscreen/cst816.html and works as expected.

rzeldent commented 7 months ago

Hi Regystro,

Thanks for going into the depths of the smartdisplay library!

It is very well possible the sensor is a CST820. The library CST816S is upwards compatible so supports this touch screen chip. Making a new library for the same functionality is not worth the effort so will stick with this module.

The INT GPIO is not used; it is polled by LVGL. So this is not much of an issue but the definitions should be correct! I checked the schematic: image And it seems to be 21. Where did you find this information or did you measure/followed the tracks it on your board?

Kind regards,

Rene

P.S. Made a note about the driver in the documentation

regystro commented 7 months ago

Hi Rene.

Regarding the INT GPIO, I have the same schematics and even the sample code uses GPIO21. Anyway, trying to get it to work with ESPHome -which can use interrupts and also polling- I found that disabling polling, only GPIO22 detects interrupts. It was a matter of trial an error. GPIO22 shows touch in the logs, while GPIO21 doesn't.

It could be a mismatch in ESPHome's GPIO assignation though :)

Regards.

rzeldent commented 6 months ago

It is very well possible this this the case and they a really good find...

How can I reproduce this? Is there a little demo app to check for the INT

regystro commented 6 months ago

I digged deeper and found that even setting an interrupt pin in ESPHome, which as per the documentation should stop using the polling method (= update_interval: never), with CST820 it's not working.

Long story short: I thought I was using interrupts while the code was using polling. I filled an issue to see if ESPHome developers can fix it: https://github.com/esphome/issues/issues/5708

rzeldent commented 6 months ago

Okay, thanks for looking into this issue... So might be correct after all...