Way to Rotate lvgl example?

Hi,

I have been working on a project involving an LCD screen using the LVGL sample as a base. However, it would be nice if I could rotate either the text itself or the screen by 90 degrees. I tried the lv_disp_set _rotation command found in lv_hal_disp.c but rather than rotating the screen it just broke the display. The same thing happens if I flip the width and height in the overlay. 1) is this error some how caused by the lv_disp library and 2) is there a fix for this? I am using the SH1107 OLED which is compatible with the ssd1306 drivers and I am using an unedited version of the lvgl example. Any help would be appreciated.

Thanks!

Parents Reply
  • I did try lv_set_rotation with all the possible rotation values. None of them gave a legible output.

    I tried setting driver->sw_rotate = LV_DISP_ROT_90 in the lv_disp_drv_init() function. Doesn't seem to accomplish anything. I have tried a few other things (like trying to change it in the lv_disp_drv_t typdef declaration) but I havn;t been able to get it to work. If you have an idea of how I could better use that then I would love to hear about it. I don't really care how slow it is. I just need to do it once during initialization. 

    Thanks,

    Rainier

Children
  • Hi Rainier

    I guess I should have read the entire thread properly, now I realize there is a known issue in LVGL regarding the SW rotate function. 

    Reading through the issues it doesn't seem this issue was ever fixed, but I see a patch is proposed here. Could you try this fix and see if you can get the rotate function to work? 

    RHOOD said:
    I don't really care how slow it is. I just need to do it once during initialization. 

    I expect software rotation will slow down every display update operation, not just initialization, but how big of an impact it will be I don't know. This would be resolution dependent, but since you are only using a 128x64 pixel display it would hopefully not be a very big impact. 

    Either way, it is something to be aware of if you are able to get the sw rotation feature working. 

    Best regards
    Torbjørn

  • Hi,

    Yeah, I tried to implement that fix a little while ago. Unfortunately both LVGL and Zephyr have updated since then so a lot of the files they reference don't exist anymore. lvgl.c and lvgl_display_mono are still around but I don't see Kconfig.graphical anywhere in my zephyr directories and I believe I confirmed that this file no longer exists on current version when doing research online.I have been looking to see if there is an equivalent Kconfig they just renamed to something else but so far I havn't found it. If you know of where I could find such an equivalent config that would be awesome.

    Thanks,

    Rainier

  • Hi Rainier

    Any chance you could open a new issue on this in the LVGL repo? 

    I can try to give it a go as well, but unfortunately I am quite busy at the moment and will not be able to prioritize this in the next couple of weeks. 

    Best regards
    Torbjørn

Related