Multiple Displays - How to set active display


I’m trying to use 2 identical displays with different content in my project.

According to this part of the documentation I should be able to select the active display with the command lv_disp_set_default(disp)

But I can’t figure out what I should put into the place of disp for the function call.

At this section of the documentation your supposed to create display instances? lv_disp_t * disp = lv_disp_create(hor_res, ver_res)

I found a single discussion about the initialisation here. I’m using the second methode and thought this might be the problem. But infact it seems that this function call lv_disp_create() is not implemented in LVGL at all. I have scanned all files for this code but no result would come up.

So how is this supposed to work?

Ok, here is the solution.

lv_disp_t * disp1 = lv_disp_drv_register(&disp_drv1);
lv_disp_t * disp2 = lv_disp_drv_register(&disp_drv2);