Replies: 30 comments 82 replies
-
it doesn't matter if I use the one internally in LVGL or if you use the one built into the ESP-IDF it's still doing the exact same thingn and copying the buffer data pixel by pixel. There is no way around having to do that with an RGB display. an 800 x 480 display connected to the ESP32 is pushing the limits of available resources on the ESP32. If you need to rotate the display as well the update is going to be horribly slow and there is nothing I can do about that. My suggestion is to use a 16 lane I8080 display. that will have GRAM and also hardware rotation so it will perform a lot better and use less memory as well. |
Beta Was this translation helpful? Give feedback.
-
thanks for the clarification. It's good to know what type of board would be best, even if you can't always find the winning combo for a given project. Have you ever tested the difference ? Interestingly, I manage to get back to decent performance by doing lots of little things :
your repo is really cool ! |
Beta Was this translation helpful? Give feedback.
-
You're heading in the right direction. |
Beta Was this translation helpful? Give feedback.
-
Hi Kevin, File "", line 66, in which is very curious |
Beta Was this translation helpful? Give feedback.
-
Sorry, it's because it's the same code as before, it worked before the rgb driver changes. This is it :
|
Beta Was this translation helpful? Give feedback.
-
Ok, no error for buffer size now, but sorry i've only black screen with new rgb driver. |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
About the soft reboot : I use Thonny, it make soft reboot before the script execution. I disconnect the cable before launching. |
Beta Was this translation helpful? Give feedback.
-
I found solution for debuging, simply add this line to the head of your c scripts : probably because I need --usb-otg Result:
|
Beta Was this translation helpful? Give feedback.
-
this may have nothing to do with it, but the pixels at the bottom of the screen remind me of something I had when I used the wrong buffer without lvgl with your driver. |
Beta Was this translation helpful? Give feedback.
-
no, forget it, in fact the screen displays and clears at the end : IMG_0939.MOV |
Beta Was this translation helpful? Give feedback.
-
I've got to go, but I've made a little video of the result, which is promising. IMG_0940.MOV |
Beta Was this translation helpful? Give feedback.
-
the rotation works!!! IMG_0941.MOV |
Beta Was this translation helpful? Give feedback.
-
WOooOoOooOo!!! It is fixed!! for Horizontal at least. Still have to test the other rotations. At least we have a start with the rotation being zero. Making some headway with this. YEAH!!!! |
Beta Was this translation helpful? Give feedback.
-
I can't wait to test it, I'm compiling lol |
Beta Was this translation helpful? Give feedback.
-
just now Rotation Works (same thing) IMG_0951b.mov |
Beta Was this translation helpful? Give feedback.
-
It's for a different display so you will need to adjust the pins and what have you... from micropython import const # NOQA
from i2c import I2C
import gt911
import lcd_bus
import task_handler
import lvgl as lv # NOQA
import rgb_display
_WIDTH = const(800)
_HEIGHT = const(480)
_BUFFER_SIZE = const(76800)
_CTP_SCL = const(9)
_CTP_SDA = const(8)
_CTP_IRQ = const(4)
_SD_MOSI = const(11)
_SD_SCK = const(12)
_SD_MISO = const(13)
_LCD_FREQ = const(13000000)
_HSYNC_PULSE_WIDTH = const(10)
_HSYNC_BACK_PORCH = const(10)
_HSYNC_FRONT_PORCH = const(10)
_VSYNC_PULSE_WIDTH = const(10)
_VSYNC_BACK_PORCH = const(10)
_VSYNC_FRONT_PORCH = const(20)
_PCLK = const(7)
_HSYNC = const(46)
_VSYNC = const(3)
_DE = const(5)
_DISP = None
_BCKL = None
_DRST = None
I2C_BUS = I2C.Bus(
host=1,
scl=_CTP_SCL,
sda=_CTP_SDA,
freq=400000,
use_locks=False
)
TOUCH_DEVICE = I2C.Device(
I2C_BUS,
dev_id=gt911.I2C_ADDR,
reg_bits=gt911.BITS
)
_DATA15 = const(10) # B7
_DATA14 = const(17) # B6
_DATA13 = const(18) # B5
_DATA12 = const(38) # B4
_DATA11 = const(14) # B3
_DATA10 = const(21) # G7
_DATA9 = const(47) # G6
_DATA8 = const(48) # G5
_DATA7 = const(45) # G4
_DATA6 = const(0) # G3
_DATA5 = const(39) # G2
_DATA4 = const(40) # R7
_DATA3 = const(41) # R6
_DATA2 = const(42) # R5
_DATA1 = const(2) # R4
_DATA0 = const(1) # R3
bus = lcd_bus.RGBBus(
hsync=_HSYNC,
vsync=_VSYNC,
de=_DE,
pclk=_PCLK,
data0=_DATA0,
data1=_DATA1,
data2=_DATA2,
data3=_DATA3,
data4=_DATA4,
data5=_DATA5,
data6=_DATA6,
data7=_DATA7,
data8=_DATA8,
data9=_DATA9,
data10=_DATA10,
data11=_DATA11,
data12=_DATA12,
data13=_DATA13,
data14=_DATA14,
data15=_DATA15,
freq=_LCD_FREQ,
hsync_front_porch=_HSYNC_FRONT_PORCH,
hsync_back_porch=_HSYNC_BACK_PORCH,
hsync_pulse_width=_HSYNC_PULSE_WIDTH,
vsync_front_porch=_VSYNC_FRONT_PORCH,
vsync_back_porch=_VSYNC_BACK_PORCH,
vsync_pulse_width=_VSYNC_PULSE_WIDTH,
)
buf1 = bus.allocate_framebuffer(_BUFFER_SIZE, lcd_bus.MEMORY_SPIRAM)
buf2 = bus.allocate_framebuffer(_BUFFER_SIZE, lcd_bus.MEMORY_SPIRAM)
display = rgb_display.RGBDisplay(
data_bus=bus,
display_width=_WIDTH,
display_height=_HEIGHT,
frame_buffer1=buf1,
frame_buffer2=buf2,
color_space=lv.COLOR_FORMAT.RGB565,
rgb565_byte_swap=True
)
display.set_power(True)
display.init()
display.set_backlight(100)
indev = gt911.GT911(TOUCH_DEVICE)
if indev.hw_size != (_WIDTH, _HEIGHT):
fw_config = indev.firmware_config
fw_config.width = _WIDTH
fw_config.height = _HEIGHT
fw_config.save()
del fw_config
# display.set_rotation(lv.DISPLAY_ROTATION._90) # NOQA
scrn = lv.screen_active()
scrn.set_style_bg_color(lv.color_hex(0x000000), 0)
slider = lv.slider(scrn)
slider.set_size(200, 50)
slider.center()
th = task_handler.TaskHandler()
value = 0
inc = 1
def th_callback(*_):
global value
global inc
value += inc
slider.set_value(value, 0)
if value in (0, 100):
inc = -inc
return True
th.add_event_cb(th_callback, task_handler.TASK_HANDLER_STARTED) |
Beta Was this translation helpful? Give feedback.
-
OK so here is an update. Fixed 90° rotation |
Beta Was this translation helpful? Give feedback.
-
Hi guys, sorry for entering your discussion but I've been exploring similar issues with rgb_display and rotation for a couple of days. @favnec5 the history is in issue #196. Rotation appears to work, but funnily, if I set it to 90 then I get portrait and mirrored (first pic), with 270 it is okay. But I get these strange horizontal lines which I would attribute to some buffer handling issue on this particular device (Elecrow 5" HMI display). If I set the frame buffers to 1/10 native, then I get 10 stripes. If I set 1/16, it's 16 stripes. I'm now struggling with getting the GT911 to rotate in a similar fashion. When I do _ROTATION = lv.DISPLAY_ROTATION._270 then the active area is scaled down landscape in the upper part of the display area. I found that the coordinate transformation code in
I assume that self:_width and _height are the values determined by the touch driver itself, right? But it still is wrong. When I choose _270 for display and touch, the touch active area is rotated by +90° relative to the rotated display, scaled down by about 50% and shifted to the top right. No idea so far what happens here. The coord transformation as such is trivial but there seem to be influences I don't find yet. Lastly (for now - got to leave for a couple of hours) I don't understand why the display content is only displayed after the first tap. Until then, only the textarea cursor area is displayed. |
Beta Was this translation helpful? Give feedback.
-
I test last repo, whoouuu it's much more stable ! IMG_0953b.mov |
Beta Was this translation helpful? Give feedback.
-
Yep. The black lines are gone. Display content is immediately shown after boot. 90 / 180 / 270 works as far as orientation, except the pixel calc that Thomas mentioned. The pixel calc gets messed up at _0 as well BTW as soon as I enter text. The character shown is a single "G". Trying to tackle the touch rotation now. |
Beta Was this translation helpful? Give feedback.
-
I forgot to add ... _90 brings up the lines again. |
Beta Was this translation helpful? Give feedback.
-
touch rotation _0 appears to work with display _90 now. (y) |
Beta Was this translation helpful? Give feedback.
-
IMG_0953.mp4This is mp4 Xvid, do you see it ? |
Beta Was this translation helpful? Give feedback.
-
I'd still like to thank you very much, as there's not much left, and the result is impressive in terms of stability. uint16_t copy_bytes_per_line = (x_end - x_start + 1) * (uint16_t)bytes_per_pixel; fixed the problem |
Beta Was this translation helpful? Give feedback.
-
This is the best for me at this time :
ROTATION_0 OK !! very cool !!! |
Beta Was this translation helpful? Give feedback.
-
Based on the last version (where _90, _180, and _270 still have problems but _0 looks good and without lines) I played a bit with the textarea in _0. In the picture you can see little dots below the characters, and these artifacts as I would call them are where the black lines used to be. The dots in the first line are normal dots to demonstrate the difference. |
Beta Was this translation helpful? Give feedback.
-
so, sorry if that didn't make sense. Let me summarize my tests:
There's still _180 that won't work for the time being. everything is staggered. |
Beta Was this translation helpful? Give feedback.
-
one last thing, I've just tested the scrolling animation in _90 mode and I can confirm that it works much better than the first full-screen rgb driver :-) |
Beta Was this translation helpful? Give feedback.
-
Hi Kevin,
For an other projet, i have a little problem.
This is like in this issue #115
But with pure RGB pannel.
I need to rotate a 4.3" 800x480 RGB screen to 480x800 (90°).
Rgb driver work fine in default 800x480 mode.
I can rotated with lvgl style but... it is very very slow :-(
display.set_rotation(lv.DISPLAY_ROTATION._90) not work (noise on screen)
Are you sure it's not possible to use esp_lcd_panel_swap_xy() / esp_lcd_panel_mirror() into the RGBBus driver to rotate the LCD screen ?
Or maybe you have an idea, for example by inverting x and y in the flush or something else?
regards
Beta Was this translation helpful? Give feedback.
All reactions