Hello,
I am trying the integration with lvgl using the flush_cb function as shown in the example in the file ili9XXX.py but I can’t get it to work.
The basic driver I am using is https://github.com/mcauser/micropython-waveshare-epaper/blob/master/epaper1in54.py and this actually with the micropython framebuf module works fine, below the code
e = epaper1in54.EPD(spi, cs, dc, rst, busy)
e.init()
e.clear_frame_memory(0xff)
e.display_frame()
w = 200
h = 200
x = 0
y = 0
buf = bytearray(200 * 200 // 8)
fb = framebuf.FrameBuffer(buf, 200, 200, framebuf.MONO_HLSB)
black = 0
white = 1
fb.fill(white)
fb.text('Hello World',30,0,black)
fb.pixel(30, 10, black)
fb.hline(30, 30, 10, black)
fb.vline(30, 50, 10, black)
fb.line(30, 70, 40, 80, black)
fb.rect(30, 90, 10, 10, black)
fb.fill_rect(30, 110, 10, 10, black)
for row in range(0,25):
fb.text(str(row),0,row*8,black)
fb.text('Line 25',60,188,black)
e.set_frame_memory(buf, x, y, w, h)
e.display_frame()
and the rusult is this:
the code test i have user for lvgl is:
lv.init()
# st.lvstm32()
e = display.EPD(spi, cs, dc, rst, busy)
e._e.clear_frame_memory(0xff)
e._e.display_frame()
scr = lv.obj()
btn = lv.btn(scr)
btn.align(scr, lv.ALIGN.IN_TOP_MID, 0, 10)
label = lv.label(btn)
label.set_text('Hello World!')
lv.scr_load(scr)
while True:
lv.tick_inc(1)
lv.task_handler()
the flush_cb i have used is this:
def flush(self, disp_drv, area, color_p):
# epaper1in54
data_view = color_p.__dereference__(area.get_size())
self._e.set_frame_memory(data_view, area.x1, area.y1, area.x2, area.y2)
if disp_drv.flush_is_last():
# epaper1in54
self._e.display_frame()
disp_drv.flush_ready()
the result is this:
what am I doing wrong?
Thanks and regards,
D.