Closed jeroenvermeulen closed 3 years ago
Thanks for sharing this. Please, can you make a pull request with your change? Thanks.
@jeroenvermeulen
i made display width and height configurable. since i only have a 240*240 display i can't test.
you may try this version
@gemu2015 Your change is good, it indeed solves the part of configuring the size of the display, I no longer need to set
#define ST7789_TFTWIDTH 135
#define ST7789_TFTHEIGHT 240
inside Arduino_ST7789.h.
Thanks for making the size configurable.
Do you also have an idea how to make ST7789_240x240_XSTART
and ST7789_240x240_YSTART
(confusing names) configurable? For example using user_config_override.h
To make my 135*240 display work, I need to:
#define ST7789_240x240_XSTART 53
#define ST7789_240x240_YSTART 40
80
overrides of _ystart
and _xstart
in Arduino_ST7789.cppWith these + your changes from st7789.zip my 135*240 display works both in portrait and landscape. I use these settings:
BackLog DisplayRotate 0; DisplayWidth 135; DisplayHeight 240; DisplayFont 0; DisplayCols 22; DisplayRows 29;
BackLog DisplayRotate 0; DisplayWidth 135; DisplayHeight 240; DisplayFont 1; DisplayCols 19; DisplayRows 20;
BackLog DisplayRotate 1; DisplayWidth 240; DisplayHeight 135; DisplayFont 0; DisplayCols 40; DisplayRows 17;
BackLog DisplayRotate 1; DisplayWidth 240; DisplayHeight 135; DisplayFont 1; DisplayCols 34; DisplayRows 11;
@ascillato2 I could make a PR but since @gemu2015 is the expert in this area and he has already made the size configurable, I think it is best he makes PR for solving this issue (#10282) as well. I think the goal should be:
80
overridesI hope the 240*240 display works when you set XSTART and YSTART to 80
.
I am happy to help testing a PR or other code with my 135*240 display. I could order a 240*240 but it will take multiple weeks to get it from Mr Ali.
@jeroenvermeulen
ok, checked other st7789 drivers for the issue and they solved this by a #defines as far as i found there are mostly 2 versions with this controller available 240x240 and 240x135 while the 1. one has zero offsets the 2. one has offset 40 and 52 or 53 depending on rotation
so i will try to set the offsets depending on the resolution.
i will post the driver in my GitHub fork, and you should test the new versions and report back.
https://github.com/gemu2015/Sonoff-Tasmota
when both versions are tested i will make a pr on tasmota
please open an issue on my fork and we can communicate there until it works
@jeroenvermeulen
first try is online
We are working on it here: https://github.com/gemu2015/Sonoff-Tasmota/issues/28
PROBLEM DESCRIPTION
A 135*240 ST7789 TFT is not working correct, caused by hard-coded _xstart and _ystart in Arduino_ST7789.cpp
REQUESTED INFORMATION
esptool.py --chip esp32 --port /dev/tty.usbserial-01F93A32 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dout --flash_freq 40m --flash_size detect 0x1000 build_output/firmware/bootloader_dout_40m.bin 0x8000 build_output/firmware/partitions.bin 0xe000 build_output/firmware/boot_app0.bin 0x10000 build_output/firmware/tasmota32.bin
Backlog Template; Module; GPIO 255
:Backlog Rule1; Rule2; Rule3
:weblog
to 4 and then, when you experience your issue, provide the output of the Console log:define ST7789_TFTWIDTH 135
define ST7789_TFTHEIGHT 240
define ST7789_240x240_XSTART 53
define ST7789_240x240_YSTART 40
BackLog DisplayRotate 0; DisplayFont 1; DisplayCols 19; DisplayRows 20; DisplayMode 0 DisplayText [zl1c1]Hello, World!