arch(driver): new driver architecture with new color format support

This commit is contained in:
Gabor Kiss-Vamosi
2023-02-20 20:50:58 +01:00
parent df789ed3c7
commit 124f9b0f9f
425 changed files with 25232 additions and 24168 deletions

View File

@@ -13,7 +13,7 @@ def get_icon(filename,xres,yres):
icon_dsc = lv.img_dsc_t(
{
"header": {"always_zero": 0, "w": xres, "h": yres, "cf": lv.img.CF.TRUE_COLOR_ALPHA},
"header": {"always_zero": 0, "w": xres, "h": yres, "cf": lv.COLOR_FORMAT.NATIVE_ALPHA},
"data": icon_data,
"data_size": len(icon_data),
}

View File

@@ -50,7 +50,7 @@ static void event_cb(lv_event_t * e)
void lv_example_bar_6(void)
{
lv_obj_t * bar = lv_bar_create(lv_scr_act());
lv_obj_add_event_cb(bar, event_cb, LV_EVENT_DRAW_PART_END, NULL);
lv_obj_add_event(bar, event_cb, LV_EVENT_DRAW_PART_END, NULL);
lv_obj_set_size(bar, 200, 20);
lv_obj_center(bar);

View File

@@ -6,7 +6,7 @@ def event_cb(e):
if dsc.part != lv.PART.INDICATOR:
return
obj= e.get_target()
obj= e.get_target_obj()
label_dsc = lv.draw_label_dsc_t()
label_dsc.init()
@@ -38,7 +38,7 @@ def event_cb(e):
#
bar = lv.bar(lv.scr_act())
bar.add_event_cb(event_cb, lv.EVENT.DRAW_PART_END, None)
bar.add_event(event_cb, lv.EVENT.DRAW_PART_END, None)
bar.set_size(200, 20)
bar.center()

View File

@@ -1,6 +1,13 @@
#!/opt/bin/lv_micropython -i
import lvgl as lv
import display_driver
default_group = lv.group_create()
default_group.set_default()
lv.sdl_window_create(480, 320)
sdl_indev = lv.sdl_mouse_create()
sdl_indev.set_group(default_group)
def set_value(bar, v):
bar.set_value(v, lv.ANIM.OFF)
@@ -9,7 +16,7 @@ def event_cb(e):
if dsc.part != lv.PART.INDICATOR:
return
obj= e.get_target()
obj= e.get_target_obj()
label_dsc = lv.draw_label_dsc_t()
label_dsc.init()
@@ -41,7 +48,7 @@ def event_cb(e):
#
bar = lv.bar(lv.scr_act())
bar.add_event_cb(event_cb, lv.EVENT.DRAW_PART_END, None)
bar.add_event(event_cb, lv.EVENT.DRAW_PART_END, None)
bar.set_size(200, 20)
bar.center()