OK so here goes.
put the attached file into micropython/lib/lv_bindings/driver/esp32
edit micropython/lib/lv_bindings/mkrules.cmake
at the very bottom change
if(ESP_PLATFORM)
LIST(APPEND LV_SRC
${LV_BINDINGS_DIR}/driver/esp32/espidf.c
${LV_BINDINGS_DIR}/driver/esp32/modrtch.c
${LV_BINDINGS_DIR}/driver/esp32/sh2lib.c
${LV_ESPIDF}
)
endif(ESP_PLATFORM)
to
if(ESP_PLATFORM)
LIST(APPEND LV_SRC
${LV_BINDINGS_DIR}/driver/esp32/espidf.c
${LV_BINDINGS_DIR}/driver/esp32/modrtch.c
${LV_BINDINGS_DIR}/driver/esp32/sh2lib.c
${LV_BINDINGS_DIR}/driver/esp32/makerfabs.c
${LV_ESPIDF}
)
endif(ESP_PLATFORM)
then edit micropython/ports/esp32/main/CMakeLists.txt
in the middle of the file around line 106ish you will see
set(IDF_COMPONENTS
app_update
change that to
set(IDF_COMPONENTS
esp_lcd
app_update
compile it and load it onto your ESP
Python code
from makerfabs import makerfabs
display = makerfabs(
de=40, vsync=41, hsync=39, pclk=42,
d0=45, d1=48, d2=47, d3=21, d4=14, d5=5, d6=6, d7=7,
d8=15, d9=16, d10=4, d11=8, d12=3, d13=46, d14=9, d15=1,
width=800, height=480,
hsync_polarity=0, hsync_front_porch=8, hsync_pulse_width=4,
hsync_back_porch=8, vsync_polarity=0, vsync_front_porch=8,
vsync_pulse_width=4, vsync_back_porch=8, pclk_active_neg=1,
speed=16000000
)
You have to add the code for handling the back light for the display. simple GPIO and turn it on.
And that should do it. This is not going to do the touch. I am going to work on that in a little bit. That will be written in Python.
I am not sure if LVGL is going to play nice nice with using the buffer that is made by espidf. we will soon find out. I manually called the draw function in the flush instead of dropping the buffer into a queue to be written. This is because of using a shared buffer
makerfabs.c (16.2 KB)