cancel
Showing results for 
Search instead for 
Did you mean: 

LTDC Rotation 180 degres

Hamady
Associate III

Hello i'm using touch GFX with STM32H7RS-DK And i need to evaluate for a future product if display rotation is possible.

I tried this implementation but drawCacheEnabled isn't reconize by software so i removed it and the widget is working but the screen flicker betwen 0 and 180° . Is there a more actual way of rotate a screen . 

    // Force redrawing entire screen
    virtual void draw(Rect& rect)
    {
        if (drawCacheEnabled)
        {
            // Invalidate entire screen instead of requested rect.
            Rect r(0, 0, HAL::DISPLAY_WIDTH, HAL::DISPLAY_HEIGHT);
            Application::draw(r);
        }
        else
        {
            // Use original rect if we are *actually* drawing and not just invalidating.
            Application::draw(rect);
        }
    }

 Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
LouisB
ST Employee

Hello @Hamady,

You are welcome, the project doesn't contain such a button, but it's implementation will mainly consist of a bypassing all the additional code (as rotations can be done in realtime). If the project answers your question, please mark it as best answer so other users can access it easily.

BR,

Louis BOUDO
ST Software Engineer | TouchGFX

View solution in original post

11 REPLIES 11
LouisB
ST Employee

Hello @Hamady,


We do not support 180 rotation, usually for a product, the whole screen itself is rotated. Also some screen support rotation by setting some bits.
It's possible to achieve rotation, by rotating a copy of the framebuffer that you then send to the screen. You can use the GPU to do that with better performances.

May I ask, how did you come up with this code, I dont see how you can have a rotation with just that ?

BR,

Louis BOUDO
ST Software Engineer | TouchGFX
Hamady
Associate III

Hello,

Thanks for the quick response 

I got the code from here : https://community.st.com/t5/stm32-mcus-touchgfx-and-gui/repost-change-lcd-orientation-in-180-degree/m-p/376534

Do you have a sampling code or a tuto to achieve this via GPU.

Thanks !

LouisB
ST Employee

Hello @Hamady,

This code is from an old version, that is why the "drawCacheEnabled" wasn't working.
I can guide you on how this can be achieved but,I need to know what are the specs for your custom board project (screen resolution, amount of ram, ...) ?

BR,

Louis BOUDO
ST Software Engineer | TouchGFX

Thanks @LouisB 

Screen :https://newhavendisplay.com/3-5-inch-ips-tft-without-touchscreen/

Interface RGB 24bit (No acces to rotation pin and command like GRAM screen i suppose )

Resolution 320x240
Ram 256MB (same as DK board).
Thanks for the help.

LouisB
ST Employee

And the chip will be the same as DK board ?

Louis BOUDO
ST Software Engineer | TouchGFX

exactly the same ! 

Hamady
Associate III

Hello,

@LouisB any news about the solution for the GPU2D

Thanks !

LouisB
ST Employee

Hello @Hamady,

We are working on a solution internally that uses GPU2D, I will get back to you when I have something.

BR,

Louis BOUDO
ST Software Engineer | TouchGFX
LouisB
ST Employee

Hello @Hamady,

Here's an example of 180 degrees rotation with GPU2D to summarize we use the NemaGFX to produce a rotated image that is updated, only in the requested areas (it doesn't invalidate the whole screen every frames). I provide a PowerPoint with some additional explanations.

Feel free to ask questions,

BR,

Louis BOUDO
ST Software Engineer | TouchGFX