HASwitchPlate / openHASP

HomeAutomation Switchplate based on lvgl for ESP32
https://www.openhasp.com
MIT License
695 stars 179 forks source link

Support for JC4827W543C (successor of Sunton 4827S043C) #713

Closed ohlolol closed 4 months ago

ohlolol commented 5 months ago

Hi Folks,

i just got my new Display and been trying to compile HASP for it. Sadly im not skilled enough to get it done :(

This is the display: https://de.aliexpress.com/item/1005006729657546.html?spm=a2g0o.order_list.order_list_main.29.cb6b5c5fo8np3a&gatewayAdapt=glo2deu

it share's the SKU of the Sunton 4827S043C but uses a different ( and i think rly new) driver chip: image

here is the display IO: image

here is the initialsation of the display from the demo sketch Arduino_DataBus bus = new Arduino_ESP32QSPI( 45 / cs /, 47 / sck /, 21 / d0 /, 48 / d1 /, 40 / d2 /, 39 / d3 */);

im able to compile my firmware via platform.io so would be nice if some one can create me a custom_device in the template_override :D

regards

Ohlolol

fvanroie commented 5 months ago

This is a different device, so needs a different config. I don't own this device, so any help will be appreciated.

ohlolol commented 5 months ago

Hey, what can i provide to support? i got the lvgl Widgets demo finally running including working touch driver. The screen itself uses arduino_GFX Library and the touch is using touchLib with GT911 driver.

This part init's the screen:

#define GFX_BL 1
Arduino_DataBus *bus = new Arduino_ESP32QSPI(
    45 /* cs */, 47 /* sck */, 21 /* d0 */, 48 /* d1 */, 40 /* d2 */, 39 /* d3 */);
Arduino_GFX *g = new Arduino_NV3041A(bus, GFX_NOT_DEFINED /* RST */,  2 /* rotation */, true /* IPS */);
Arduino_GFX *gfx = new Arduino_Canvas(480 /* width */, 272 /* height */, g);

and this is from the touch init:

`#define TOUCH_MODULES_GT911 // GT911 / CST_SELF / CST_MUTUAL / ZTW622 / L58 / FT3267 / FT5x06
 #define TOUCH_MODULE_ADDR GT911_SLAVE_ADDRESS1 // CTS328_SLAVE_ADDRESS / L58_SLAVE_ADDRESS / CTS826_SLAVE_ADDRESS / CTS820_SLAVE_ADDRESS / CTS816S_SLAVE_ADDRESS / FT3267_SLAVE_ADDRESS / FT5x06_ADDR / GT911_SLAVE_ADDRESS1 / GT911_SLAVE_ADDRESS2 / ZTW622_SLAVE1_ADDRESS / ZTW622_SLAVE2_ADDRESS
 #define TOUCH_SCL 4
 #define TOUCH_SDA 8
 #define TOUCH_RES 38
 #define TOUCH_INT 3

#elif defined(TOUCH_MODULE_ADDR) // TouchLib
#include <Wire.h>
#include <TouchLib.h>
TouchLib touch(Wire, TOUCH_SDA, TOUCH_SCL, TOUCH_MODULE_ADDR);
`

i attach the working skech. let me know how i can support you :)

regards LvglWidgets.zip

saeugetier commented 4 months ago

There is some information in a GitHub repository: https://github.com/profi-max/JC4827W543_4.3inch_ESP32S3_board

The display driver is an NV3041A-compatible 4-bit display driver. This driver is currently not available in TFT_eSPI. Adaftruit_GFX is required, which is also available in openHASP.

I have found a request to support the NV3041A in TFT_eSPI. I supplied additional information to the TFT_eSPI maintainer: https://github.com/Bodmer/TFT_eSPI/discussions/2579#discussioncomment-9410134

Maybe TFT_eSPI will get support for the N3041A in the future, so openHASP can support this display through TFT-eSPI.

By the way, I ordered the JC4827W543 because it seems to have better LiPo battery support. The Sunton displays don't have low-quiescent linear power regulators. So putting the ESP32-S3 into deep sleep mode will still drain the battery very quickly. Hopefully, with the Guition JC4827W543, a low-power display can be realized which can keep running from a battery for some weeks (dependent on how frequently it will be used).

saeugetier commented 4 months ago

Support of Adafruit_GFX doesn't seem to be up to date. Is adafruit_gfx still supported?

saeugetier commented 4 months ago

Adafruit_GFX is not usable for the ESP32. So TFT-eSPI is a must.

fvanroie commented 4 months ago

I believe it is "GFX Library for Arduino" instead of Adafruit GFX.