Makerfabs / MaTouch-ESP32-S3-Rotary-IPS-Display-with-Touch-2.1-ST7701

32 stars 8 forks source link

No more compatible with GFX lib Version: 1.3.8, 1.3.7, 1.3.6, 1.3.5, 1.3.4, 1.3.3, 1.3.2. #1

Closed Uspizig closed 10 months ago

Uspizig commented 11 months ago

Compilation crashes on this one in the example with the GFX lib versions 1.3.8, 1.3.7, 1.3.6, 1.3.5, 1.3.4, 1.3.3, 1.3.2. Works on 1.3.1. Please make it availible as well on newer GFX lib versions

Arduino_ESP32RGBPanel bus = new Arduino_ESP32RGBPanel( 1 / CS /, 46 / SCK /, 0 / SDA /, 2 / DE /, 42 / VSYNC /, 3 / HSYNC /, 45 / PCLK /, 11 / R0 /, 15 / R1 /, 12 / R2 /, 16 / R3 /, 21 / R4 /, 39 / G0/P22 /, 7 / G1/P23 /, 47 / G2/P24 /, 8 / G3/P25 /, 48 / G4/P26 /, 9 / G5 /, 4 / B0 /, 41 / B1 /, 5 / B2 /, 40 / B3 /, 6 / B4 */ );

C:\Users\User\Downloads\MaTouch-ESP32-S3-Rotary-IPS-Display-with-Touch-2.1-ST7701-main\MaTouch-ESP32-S3-Rotary-IPS-Display-with-Touch-2.1-ST7701-main\example\fs_test\fs_test.ino:33:1: error: no matching function for call to 'Arduino_ESP32RGBPanel::Arduino_ESP32RGBPanel(int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int)' ); ^ In file included from c:\Users\User\Documents\Arduino\libraries\GFX_Library_for_Arduino\src/Arduino_GFX_Library.h:15, from C:\Users\User\Downloads\MaTouch-ESP32-S3-Rotary-IPS-Display-with-Touch-2.1-ST7701-main\MaTouch-ESP32-S3-Rotary-IPS-Display-with-Touch-2.1-ST7701-main\example\fs_test\fs_test.ino:1: c:\Users\User\Documents\Arduino\libraries\GFX_Library_for_Arduino\src/databus/Arduino_ESP32RGBPanel.h:59:3: note: candidate: 'Arduino_ESP32RGBPanel::Arduino_ESP32RGBPanel(int8_t, int8_t, int8_t, int8_t, int8_t, int8_t, int8_t, int8_t, int8_t, int8_t, int8_t, int8_t, int8_t, int8_t, int8_t, int8_t, int8_t, int8_t, int8_t, int8_t, uint16_t, uint16_t, uint16_t, uint16_t, uint16_t, uint16_t, uint16_t, uint16_t, uint16_t, int32_t, bool, uint16_t, uint16_t)' Arduino_ESP32RGBPanel( ^~~~~ c:\Users\User\Documents\Arduino\libraries\GFX_Library_for_Arduino\src/databus/Arduino_ESP32RGBPanel.h:59:3: note: candidate expects 33 arguments, 23 provided c:\Users\User\Documents\Arduino\libraries\GFX_Library_for_Arduino\src/databus/Arduino_ESP32RGBPanel.h:56:7: note: candidate: 'constexpr Arduino_ESP32RGBPanel::Arduino_ESP32RGBPanel(const Arduino_ESP32RGBPanel&)' class Arduino_ESP32RGBPanel ^~~~~ c:\Users\User\Documents\Arduino\libraries\GFX_Library_for_Arduino\src/databus/Arduino_ESP32RGBPanel.h:56:7: note: candidate expects 1 argument, 23 provided c:\Users\User\Documents\Arduino\libraries\GFX_Library_for_Arduino\src/databus/Arduino_ESP32RGBPanel.h:56:7: note: candidate: 'constexpr Arduino_ESP32RGBPanel::Arduino_ESP32RGBPanel(Arduino_ESP32RGBPanel&&)' c:\Users\User\Documents\Arduino\libraries\GFX_Library_for_Arduino\src/databus/Arduino_ESP32RGBPanel.h:56:7: note: candidate expects 1 argument, 23 provided C:\Users\User\Downloads\MaTouch-ESP32-S3-Rotary-IPS-Display-with-Touch-2.1-ST7701-main\MaTouch-ESP32-S3-Rotary-IPS-Display-with-Touch-2.1-ST7701-main\example\fs_test\fs_test.ino:36:1: error: 'Arduino_ST7701_RGBPanel' does not name a type; did you mean 'Arduino_ESP32RGBPanel'? Arduino_ST7701_RGBPanel gfx = new Arduino_ST7701_RGBPanel( ^~~~~~~ Arduino_ESP32RGBPanel C:\Users\User\Downloads\MaTouch-ESP32-S3-Rotary-IPS-Display-with-Touch-2.1-ST7701-main\MaTouch-ESP32-S3-Rotary-IPS-Display-with-Touch-2.1-ST7701-main\example\fs_test\fs_test.ino: In function 'int jpegDrawCallback(JPEGDRAW)': C:\Users\User\Downloads\MaTouch-ESP32-S3-Rotary-IPS-Display-with-Touch-2.1-ST7701-main\MaTouch-ESP32-S3-Rotary-IPS-Display-with-Touch-2.1-ST7701-main\example\fs_test\fs_test.ino:50:5: error: 'gfx' was not declared in this scope gfx->draw16bitBeRGBBitmap(pDraw->x, pDraw->y, pDraw->pPixels, pDraw->iWidth, pDraw->iHeight); ^~~ C:\Users\User\Downloads\MaTouch-ESP32-S3-Rotary-IPS-Display-with-Touch-2.1-ST7701-main\MaTouch-ESP32-S3-Rotary-IPS-Display-with-Touch-2.1-ST7701-main\example\fs_test\fs_test.ino: In function 'void setup()': C:\Users\User\Downloads\MaTouch-ESP32-S3-Rotary-IPS-Display-with-Touch-2.1-ST7701-main\MaTouch-ESP32-S3-Rotary-IPS-Display-with-Touch-2.1-ST7701-main\example\fs_test\fs_test.ino:60:5: error: 'gfx' was not declared in this scope gfx->begin(); ^~~

exit status 1

Compilation error: no matching function for call to 'Arduino_ESP32RGBPanel::Arduino_ESP32RGBPanel(int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int)'

only works with GFX lib 1.3.1

Uspizig commented 11 months ago

This might be a workaround. [Untested due to lack of Hardware] At least it compiles:

define I2C_SDA_PIN 17

define I2C_SCL_PIN 18

define DISPLAY_DC GFX_NOT_DEFINED

define DISPLAY_CS 1

define DISPLAY_SCK 46

define DISPLAY_MOSI 0

define DISPLAY_MISO GFX_NOT_DEFINED

define DISPLAY_DE 2

define DISPLAY_VSYNC 42

define DISPLAY_HSYNC 3

define DISPLAY_PCLK 45

define DISPLAY_R0 11

define DISPLAY_R1 15

define DISPLAY_R2 12

define DISPLAY_R3 16

define DISPLAY_R4 21

define DISPLAY_G0 39

define DISPLAY_G1 7

define DISPLAY_G2 47

define DISPLAY_G3 8

define DISPLAY_G4 48

define DISPLAY_G5 9

define DISPLAY_B0 4

define DISPLAY_B1 41

define DISPLAY_B2 5

define DISPLAY_B3 40

define DISPLAY_B4 6

define DISPLAY_HSYNC_POL 1

define DISPLAY_VSYNC_POL 1

define DISPLAY_HSYNC_FRONT_PORCH 10

define DISPLAY_VSYNC_FRONT_PORCH 10

define DISPLAY_HSYNC_BACK_PORCH 50

define DISPLAY_VSYNC_BACK_PORCH 20

define DISPLAY_HSYNC_PULSE_WIDTH 8

define DISPLAY_VSYNC_PULSE_WIDTH 8

Arduino_DataBus bus = new Arduino_SWSPI( DISPLAY_DC / DC /, DISPLAY_CS / CS /, DISPLAY_SCK / SCK /, DISPLAY_MOSI / MOSI /, DISPLAY_MISO / MISO */);

Arduino_ESP32RGBPanel *rgbpanel = new Arduino_ESP32RGBPanel( DISPLAY_DE, DISPLAY_VSYNC , DISPLAY_HSYNC, DISPLAY_PCLK, DISPLAY_R0, DISPLAY_R1, DISPLAY_R2, DISPLAY_R3, DISPLAY_R4, DISPLAY_G0, DISPLAY_G1, DISPLAY_G2, DISPLAY_G3, DISPLAY_G4, DISPLAY_G5, DISPLAY_B0, DISPLAY_B1, DISPLAY_B2, DISPLAY_B3, DISPLAY_B4, DISPLAY_HSYNC_POL, DISPLAY_HSYNC_FRONT_PORCH, DISPLAY_HSYNC_PULSE_WIDTH, DISPLAY_VSYNC_BACK_PORCH, DISPLAY_VSYNC_POL, DISPLAY_VSYNC_FRONT_PORCH, DISPLAY_VSYNC_PULSE_WIDTH, DISPLAY_VSYNC_BACK_PORCH);

Arduino_RGB_Display gfx = new Arduino_RGB_Display( 480 / width /, 480 / height /, rgbpanel, 0 / rotation /, true / auto_flush /, bus, GFX_NOT_DEFINED / RST */, st7701_type5_init_operations, sizeof(st7701_type5_init_operations));

//Arduino_ESP32RGBPanel bus = new Arduino_ESP32RGBPanel( // 1 / CS /, 46 / SCK /, 0 / SDA /, // 2 / DE /, 42 / VSYNC /, 3 / HSYNC /, 45 / PCLK /, // 11 / R0 /, 15 / R1 /, 12 / R2 /, 16 / R3 /, 21 / R4 /, // 39 / G0/P22 /, 7 / G1/P23 /, 47 / G2/P24 /, 8 / G3/P25 /, 48 / G4/P26 /, 9 / G5 /, // 4 / B0 /, 41 / B1 /, 5 / B2 /, 40 / B3 /, 6 / B4 */ //);

// Uncomment for 2.1" round display //Arduino_ST7701_RGBPanel gfx = new Arduino_ST7701_RGBPanel( // bus, GFX_NOT_DEFINED / RST /, 0 / rotation /, // false / IPS /, 480 / width /, 480 / height /, // st7701_type5_init_operations, sizeof(st7701_type5_init_operations), // true / BGR /, // 10 / hsync_front_porch /, 8 / hsync_pulse_width /, 50 / hsync_back_porch /, // 10 / vsync_front_porch /, 8 / vsync_pulse_width /, 20 / vsync_back_porch */);

wegunterjr commented 10 months ago

getting similar results. I am unable to compile any of the examples. Any suggestions?

Seems like a mismatch of library versions for other parts too?

I did get this:

error: call of overloaded 'requestFrom(uint16_t&, uint32_t&, bool)' is ambiguous Wire.requestFrom(addr, length, true); ^

Uspizig commented 10 months ago

did you check the above rework/fix and replaxced the part?

wegunterjr commented 10 months ago

Yes. I tried your suggestion above and there are a few other matouch products that have similar suggestions for the library difference. It seems to get past the gfx part once I do and then I get the overload errors.

Maybe I have Arduino settings wrong? I am also trying this in vscode which is my preference IDE.

wegunterjr commented 10 months ago

This was my mistake - my error was different because I was using a different version of Arduino IDE. The Wiki suggested 1.8 and I was using the latest - I was able to get the included examples working. I haven't progressed to this version of the driver yet, but I will try your suggestion above when I do.

Uspizig commented 10 months ago

I am using the latest Arduino IDE 2.2.1 ... works... I think your issue is different:

Could you try out the code below:

fs_test.txt

wegunterjr commented 10 months ago

I am not sure what my issue is - I am getting

WARNING: library Audio claims to run on sam architecture(s) and may be incompatible with your current board which runs on esp32 architecture(s).

error: 'Dacc' does not name a type Dacc *dac;

error: 'Arduino_ESP32RGBPanel' does not name a type; did you mean 'Arduino_ESP32SPI'? Arduino_ESP32RGBPanel *rgbpanel = new Arduino_ESP32RGBPanel(

I get that for any type. it is strange.

wegunterjr commented 10 months ago

I switched the project over to vscode and I got the same error you posted above using 1.3.8. I used your suggestion above and am able to compile and it runs on the HW.

DomhnallP commented 3 months ago

This might be a workaround. [Untested due to lack of Hardware] At least it compiles:

define I2C_SDA_PIN 17 #define I2C_SCL_PIN 18 #define DISPLAY_DC GFX_NOT_DEFINED #define DISPLAY_CS 1 #define DISPLAY_SCK 46 #define DISPLAY_MOSI 0 #define DISPLAY_MISO GFX_NOT_DEFINED

define DISPLAY_DE 2 #define DISPLAY_VSYNC 42 #define DISPLAY_HSYNC 3 #define DISPLAY_PCLK 45 #define DISPLAY_R0 11 #define DISPLAY_R1 15 #define DISPLAY_R2 12 #define DISPLAY_R3 16 #define DISPLAY_R4 21 #define DISPLAY_G0 39 #define DISPLAY_G1 7 #define DISPLAY_G2 47 #define DISPLAY_G3 8 #define DISPLAY_G4 48 #define DISPLAY_G5 9 #define DISPLAY_B0 4 #define DISPLAY_B1 41 #define DISPLAY_B2 5 #define DISPLAY_B3 40 #define DISPLAY_B4 6 #define DISPLAY_HSYNC_POL 1 #define DISPLAY_VSYNC_POL 1 #define DISPLAY_HSYNC_FRONT_PORCH 10 #define DISPLAY_VSYNC_FRONT_PORCH 10 #define DISPLAY_HSYNC_BACK_PORCH 50 #define DISPLAY_VSYNC_BACK_PORCH 20 #define DISPLAY_HSYNC_PULSE_WIDTH 8 #define DISPLAY_VSYNC_PULSE_WIDTH 8

Arduino_DataBus _bus = new Arduino_SWSPI( DISPLAYDC / DC _/, DISPLAYCS / CS _/, DISPLAYSCK / SCK _/, DISPLAYMOSI / MOSI _/, DISPLAYMISO / MISO */);

Arduino_ESP32RGBPanel *rgbpanel = new Arduino_ESP32RGBPanel( DISPLAY_DE, DISPLAY_VSYNC , DISPLAY_HSYNC, DISPLAY_PCLK, DISPLAY_R0, DISPLAY_R1, DISPLAY_R2, DISPLAY_R3, DISPLAY_R4, DISPLAY_G0, DISPLAY_G1, DISPLAY_G2, DISPLAY_G3, DISPLAY_G4, DISPLAY_G5, DISPLAY_B0, DISPLAY_B1, DISPLAY_B2, DISPLAY_B3, DISPLAY_B4, DISPLAY_HSYNC_POL, DISPLAY_HSYNC_FRONT_PORCH, DISPLAY_HSYNC_PULSE_WIDTH, DISPLAY_VSYNC_BACK_PORCH, DISPLAY_VSYNC_POL, DISPLAY_VSYNC_FRONT_PORCH, DISPLAY_VSYNC_PULSE_WIDTH, DISPLAY_VSYNC_BACK_PORCH);

Arduino_RGB_Display _gfx = new Arduino_RGBDisplay( 480 / width /, 480 / height /, rgbpanel, 0 / rotation /, true / autoflush /, bus, GFX_NOTDEFINED / RST */, st7701_type5_init_operations, sizeof(st7701_type5_init_operations));

//Arduino_ESP32RGBPanel _bus = new ArduinoESP32RGBPanel( // 1 / CS /, 46 / SCK /, 0 / SDA /, // 2 / DE /, 42 / VSYNC /, 3 / HSYNC /, 45 / PCLK /, // 11 / R0 /, 15 / R1 /, 12 / R2 /, 16 / R3 /, 21 / R4 /, // 39 / G0/P22 /, 7 / G1/P23 /, 47 / G2/P24 /, 8 / G3/P25 /, 48 / G4/P26 /, 9 / G5 /, // 4 / B0 /, 41 / B1 /, 5 / B2 /, 40 / B3 /, 6 / B4 */ //);

// Uncomment for 2.1" round display //Arduino_ST7701_RGBPanel _gfx = new Arduino_ST7701_RGBPanel( // bus, GFX_NOTDEFINED / RST /, 0 / rotation /, // false / IPS /, 480 / width /, 480 / height _/, // st7701_type5_init_operations, sizeof(st7701_type5_initoperations), // true / BGR /, // 10 / hsync_frontporch /, 8 /_ hsync_pulsewidth /, 50 /_ hsync_backporch /, // 10 /_ vsync_frontporch /, 8 /_ vsync_pulsewidth /, 20 /_ vsync_back_porch */);

For reference for anyone who stumbles across this in future, it works but you need to swap the Red and Blue pins around in the Arduino_ESP32RGBPanel initialization. additionally, you may need to use the Big Endian draw fucntions (e.g. draw16bitBeRGBBitmap instead of draw16bitRGBBitmap).

I'm using a combination of TFT_eSprite and this library to handle jitter and improve performance so there may be some funny business in the interfacing between those two that's specific to my setup but I had to: 1) Swap the R and B channels in Arduino_GFX. 2) Set TFT_eSprite swapBytes to true. 3) Use Big Endian draw functions to push the tft_eSprite buffer to the screen

doing this gave the the correct color rendering using Arduino_GFX v1.4.7

Hardware I used: MakerFabs MaTouch Rotary (ST7701s display driver): https://www.makerfabs.com/matouch-esp32-s3-rotary-ips-display-with-touch-2-1-st7701.html