Esp32 psram + ili9341 How to do? #106
Replies: 8 comments 7 replies
-
give this a try and see if it works. The frame buffers you don't have to mess about with, let the display driver take care of setting those up. import sys
import lvgl as lv
import lcd_bus
import ili9341
from machine import SPI, Pin
spi_bus = SPI.Bus(
host=1,
mosi=13,
miso=12,
sck=14
)
display_bus = lcd_bus.SPIBus(
spi_bus=spi_bus,
dc=5,
cs=15,
freq=40000000,
)
import lvgl as lv
display = ili9341.ILI9341(
data_bus=display_bus,
display_width=240,
display_height=320,
reset_pin=4,
# comment the next line if you still don't get something on the display
reset_state=ili9341.STATE_LOW,
backlight_pin=22,
color_space=lv.COLOR_FORMAT.RGB565,
# color_byte_order=ili9341.BYTE_ORDER_BGR,
rgb565_byte_swap=True
)
display.set_power(True)
display.init()
display.set_rotation(lv.DISPLAY_ROTATION._90)
# setting this to anything but 100 or 0 when you don't have the
# backlight state set to PWM isn't going to do anything
display.set_backlight(100)
display.invert_colors()
scrn = lv.screen_active()
scrn.set_style_bg_color(lv.color_hex(0xffb6c1), 0)
slider = lv.slider(scrn)
slider.set_size(300, 50)
slider.center()
label = lv.label(scrn)
label.set_text('HELLO WORLD!')
label.align(lv.ALIGN.CENTER, 0, -50)
import task_handler
th = task_handler.TaskHandler() |
Beta Was this translation helpful? Give feedback.
-
Just need do some extra by hand. Now tested with isp-idf 5.2.2 with mpy 1.24 preview + lvgl 9.1. Work LCD and Touch: ESP32 psram with and ILI9341 2.8” display and XPT2046. Also works asyncio task from push button on LCD. |
Beta Was this translation helpful? Give feedback.
-
It works and It works quite well and is actually really easy to get up and running if you don't try and do things like how they are done in the "official" lvgl micropython binding. This library's sole goal was to make things easier to do, making it easy to update LVGL and MicroPython versions, adding support for more displays and touch drivers and the last thing was to fix issues like not being able to have the touch and display on the same SPI bus. and not being able to use the SDCard reader if it is on the same bus as the touch or the display. All of those things have been fixed. |
Beta Was this translation helpful? Give feedback.
-
it's a very cool project that allows you to use lvgl. Very thanks about that. |
Beta Was this translation helpful? Give feedback.
-
nice! i hope i can run my setting soon with lvgl and micropython |
Beta Was this translation helpful? Give feedback.
-
how you get the code to your controller??
is here the whole lvgl binding similar to the micropython ? |
Beta Was this translation helpful? Give feedback.
-
@straga Could you provide the complete working example you have? I am working on an ESP32-S3 and trying to get this all setup myself. |
Beta Was this translation helpful? Give feedback.
-
some example.
|
Beta Was this translation helpful? Give feedback.
-
Display work tested with old version mpdisplay, but firmware from that repo without new SPI C driver use Micropython Native SPI all works.
If build firmware with New SPI driver and not use anymore mpdisplay.
Look like that. Not errors. But not render. Just Activate Dispaly and Horizontal Line.
Beta Was this translation helpful? Give feedback.
All reactions