What do you want to achieve?
I’m using a ESP32-S3 with round 2.1" Display and with external encoder. It is similar to the MaTouch 2.1" round display. Only difference is, that I’m using a 16bit RGB Display insteat of 18Bit.The encoder is in the lower left corner and the display is installed 90°, I have to turn the image of the display 90°. Normally it can be done in the GFX for Arduino during setup
What have you tried so far?
Normally it can be done in the GFX for Arduino during setup. I set rotation to 1. Nothing happens. I tried 2 and then the displa turns 180°. But it jitters. you see it in the picture below. For reference see the working picture (orientation see the knob). Orientation 3 is orientation 0.
Itried to turn it in Squareline Studio with the orientation during setup. But this doesn*t work at all. What is this rotation selection good for?
Then I tied to turn it in LVGL with lv_display_set_rotation( disp,LV_DISPLAY_ROTATION_90);
also not working.
Screenshot or video
Others
ESP32-S3 with 16bit 565RGB /SPI databus. Config as the Matouch. Rotary Encoder. No Touch panel
Hi, SquareLine Studio rotation is not a hardware screen rotation. It mainly rotates the coordinate system visually in the editor so you can design in that angle, and it sets the intended LVGL rotation direction (logical rotation).
What to do (concrete tips):
- Test without LVGL first: draw a simple color bar/text using only Arduino_GFX and call
gfx->setRotation(1) after begin().
- If 90° still doesn’t work → your panel driver doesn’t implement 90° (only 0/180), so you must fix rotation in the panel driver (MADCTL / address mapping).
- Check your LVGL flush callback: ensure you are drawing via the same rotated GFX object (e.g.
gfx->draw16bitRGBBitmap(...)). If you write pixels directly to SPI, GFX rotation is bypassed.
- Try panel-side rotation: implement/enable the display controller rotation (MADCTL) for 90° in your driver, not only in LVGL.
- If you want LVGL to rotate: enable LVGL software rotation (version-dependent) and then call
lv_display_set_rotation(disp, LV_DISPLAY_ROTATION_90); (may require larger/fullscreen draw buffer).
- Fix the 180° jitter: make sure
lv_disp_flush_ready() is called only after the SPI/DMA transfer is finished (wait for DMA / endWrite). Jitter often means the next flush starts while the previous transfer is still running.
- Verify width/height swap: when using 90° rotation, update the reported
hor_res/ver_res (or LVGL display resolution) accordingly, otherwise areas get clipped or shifted.
If you share your display init code + your flush_cb, I can point to the exact line that needs changing.