cancel
Showing results for 
Search instead for 
Did you mean: 

Implementing dynamic screen rotation (landscape and portrait mode) with L4R9I_DISCOVERY

KHeye.1
Associate III

Hi,

I am trying to implement a product that needs to swap between landscape and portrait mode of the same screen dynamically during run time.

I am using TouchGFX designer 4.16.0 with the TouchGFXWatch UI template to do some basic tests. When I run the target in landscape mode it works as expected. If I change it to portrait mode, as shown below, and run it on the L4R9I_DISCOVERY I get unexpected results as shown below (which is the same result I get from my code base).

0693W00000BboVgQAJ.png0693W00000Bboa7QAB.jpg 

From my understanding and from other forum posts

- How do i configure Landscape orientation for STM32F429I-DISC1 (native portrait) ?

- Issues with Portrait Orientation on STM32F746G-Discovery Kit

- STM32F746G-Disco Bd, doesn't display correctly in portrait mode

I should only need to rotate the images in TouchGFX Designer which the Display orientation radio buttons do.

The change log for TouchGFX 4.7.0 mentions a "display_orientation_example" that I have not been able to find. Is there any documentation or example that could help provide information on dynamically changing between portrait and landscape modes during run time?

Cheers,

Kevin

1 ACCEPTED SOLUTION

Accepted Solutions

On round display and maybe your code is used MMU for memory round and here maybe need you more changes in target code too , i recommend here dont waste time, you set only one orientatioín and in code rearange objects XY and angle...

View solution in original post

7 REPLIES 7
MM..1
Chief III

For TouchGFX it is hard job, or for you, because angled design need some thinks twice. But simpler is when your LCD support change orientation by HW regs and very simple is when width=heigth.

When not then all images you need in two version one 0 and second 90. usw

KHeye.1
Associate III

@MM..1​ Thanks for your reply.

The display I am using does not support 90 degree rotation (I cannot change the display), so the two options I have found are to either use TouchGFX's portrait and landscape mode or to create two screens (one at 0 degrees and one at 90). Preferably, if TouchGFX is able to do this it would be significantly better than having to maintain two identical screens with a 90 degree offset.

You can use one screen and rearange all object on rotation event , images need swap 0 with 90 then you need both ID, but some objects maybe dont have angle support.

@MM..1​ Thanks that is a good idea.

You make it sound like swapping between landscape and portrait modes is a bad idea but the TouchGFX code base does seem to support some of it (get and setDisplayOrientation). Am I trying to use the TouchGFX code base for something it does not support?

Maybe better is explain LCD vs LTDC or SPI is hw orientation. When display have only one then portrait and landscape is for designer to create proper one conversion for one orientation and for see it on design PC horizontaly.

TouchGFX dont have support for manage both orientation in one design, but your idea is good ...

Make some test create screen in normal work orientation on your display with only text and box . Then try setDisplayOrientation

I see thank you.

When I run setDisplayOrientation, during run time, in my code base and in the example code bases it results in the heavily offset display as shown in the second image I posted.

On round display and maybe your code is used MMU for memory round and here maybe need you more changes in target code too , i recommend here dont waste time, you set only one orientatioín and in code rearange objects XY and angle...