yoprogramo / QRcodeDisplay

ESP Generate QRCode for several displays - Base Repo
18 stars 8 forks source link

[proposal] TFT_eSPI support #1

Closed oxyii closed 2 years ago

oxyii commented 2 years ago

TFT_eSPI is much faster than Adafruit. It will be nice if support it too. Your QRcode_ST7735 modified for TFT_eSPI is here. Tested on my TTGO TS v1.0 1,44'' 128x128 ST7735.

You can publish it if you'd like or just close this issue

yoprogramo commented 2 years ago

Good proposal,

I'll test with my hardware and then I'll decide what to do.

Thank you

yoprogramo commented 2 years ago

Hello again, I'm trying to make work my ESP32 + 128x128 ST7735 hardware with TFT_eSPI but my screen are displaced. Maybe I'm not adjusting the user_setup properly. Can you tell me what is the setup you have tested...?

oxyii commented 2 years ago

This is my config for TFT_eSPI https://github.com/Xinyuan-LilyGO/LilyGo_Txx/blob/master/User_Setups/T10_V14.h

oxyii commented 2 years ago

Only one include must be in User_Setup_Select.h. So you can create your own .h file (based on my, for example) and include it instead of <User_Setup.h>. Must work i think

yoprogramo commented 2 years ago

I have tested using platformio and defining the configuration in platformio.ini file. In my case:

[env:esp32-espi] platform = espressif32 board = esp32dev framework = arduino build_flags = -DUSER_SETUP_LOADED -DST7735_DRIVER -DST7735_GREENTAB3 -DTFT_WIDTH=128 -DTFT_HEIGHT=128 -DTFT_MISO=26 -DTFT_MOSI=23 -DTFT_SCLK=18 -DTFT_CS=5 -DTFT_DC=26 lib_deps = yoprogramo/QRcodeDisplay @ ^1.0.0 yoprogramo/QRcode_eSPI @ ^1.0.0 bodmer/TFT_eSPI monitor_speed = 115200 upload_speed = 115200 upload_port = /dev/ttyUSB*

So, it works, let publish the classes in https://github.com/yoprogramo/QRcode_eSPI. Feel free to add/remove whatever you consider.

oxyii commented 2 years ago

qrcode.create time approximately on my hardware:

I think we can override qrcode.create something like this:

// define `create` in .h

void QRcode_eSPI::create(String message) {
  display->startWrite();
  QRcodeDisplay::create(message);
  display->endWrite();
}

Sorry i don't create PR... it is not very convenient for me now

oxyii commented 2 years ago

I'm not sure about checking SUPPORT_TRANSACTIONS definition

oxyii commented 2 years ago

TFT_eSPI checks this definition... but i see nothing performance changes if SUPPORT_TRANSACTIONS defined or not in my config for TFT_eSPI. Looks like it is safe to implement my proposal

yoprogramo commented 2 years ago

OK,

Let me include the modification and test it..

yoprogramo commented 2 years ago

Done, QRcode_eSPI 1.0.1 already have your modifications.

oxyii commented 2 years ago

@yoprogramo Great job! Thank you very much! I'll use it right now )