Display rotation using sw_rotate


how configure lvlg for sw rotation?

What MCU/Processor/Board and compiler are you using?

nxp RT1176

What LVGL version are you using?


What do you want to achieve?

display rotation by 90°

What have you tried so far?

. disp_drv.rotated = LV_DISP_ROT_90;
disp_drv.sw_rotate = 1;

I’d like to rotate the screen by 90° using sw. Now my screen is 720x1280, so everything is configured with these values. Now the framebuffer for display driver should keep these settings, but I have to swap only the width/height in lvlgl settings right? As I understand lvgl creates a rotated framebuffer and the flush function has to do nothing.

Now my working configuration is:
full_refresh = 0
direct_mode = 1
2 buffers

is sw rotation compatible with these settings? Should I keep rotation into account in flush function, when I copy the updated framebuffer region into the other framebuffer (to keep the 2 fb in sync)?

Is there any example which demonstrates the configuration for sw rotation?

thank you,