2018-11-27 01:44 AM
QUESTION - TouchGFX Community repost - Eyal goltzman - July 2016
Hello,
Following Yossi question from today and Martin reference to Soren answer in https://touchgfx.zendesk.com/hc/en-us/community/posts/206708899--orientation-180-degree
We are using LCD without SPI interface, only parallel RGB interface through the LCD-TFT Controller peripheral, so controlling the LCD as describe in your answer to the above link is not an option.
Since our customers have a mechanical issue with the display orientation (the flat cable position) we are trying to address it with SW solution.
As I see it, there is an option to rotate the frame buffer just before calling swapFrameBuffers, what do you think? It could be done? performance issues? Can we do it ourselves? How?
Thanks,
Eyal
ANSWER - TouchGFX Community repost - Soren Pingel Dalsgaard - July 2016
Hi Eyal,
How unfortunate! You could do the rotation manually, but the performance penalty will be very significant, to the extent that only very simple UIs can be realized.
This is due to two things:
I think the right place to do such a rotation would be by overriding HAL::endFrame. Something like this:
void MyHAL::endFrame()
{
dma.flush(); //wait for all dma operations to have completed
rotateFb(getClientFrameBuffer()); //apply rotation on the fb
HAL::endFrame(); //call base impl when rotation is done.}
Apart from this you would need also to invert the coordinates in your touch controller driver.
You can give it a shot, but I am not too optimistic to be honest. Hopefully you could convince your customer to switch to another display that can either be mounted normally or supports scan direction swap.
Solved! Go to Solution.
2019-11-25 02:19 AM
Yes. In most cases displays can be configured to do this, and if not, then you can use the GFXMMU - It's not supported in TouchGFX (yet). Mostly because it's not been relevant.
/Martin
2019-11-25 02:29 AM
hi , Martin
We have a L4R9 disco board. Can you give us more guidence or an example code projec for 180 degree rotation display?
2021-07-06 04:49 AM
Hello, @Martin KJELDSEN ,I have no idea on how to rotation the screen 180 degree yet since there is no way to do it by operate the STM32 registers, and SPI interface is not available on the display. I want to know if will it support in the future version?
2021-07-06 04:56 AM
Hi,
180degree rotation is handled by TouchGFX, but I guess you are looking for another rotation ? It is in our plan to support all possible rotation but not in the near future at all...
/Romain
2021-11-16 06:01 AM
Hi @Martin KJELDSEN ,
I have successfully added the 180 degree rotation to my screen. But what I really want to do is to rotate my screen over 90 degrees.
How would I do that?
Damiën
2021-11-30 06:52 AM
Hi @Romain DIELEMAN Can you please elaborate where to find 180-degree rotation in TouchGFX?
2023-06-28 09:39 AM
In regards to display surface rotation, I have read an article using DMA2D to perform a positive 90 degree rotation. Essentially this algorithm would perform a 2D Source to Destination Blit of a rectangle with a biased 'skip count' for each stride copy by the length of a line -1. This would copy a "line of pixels" into a "column of pixels". Which would be a 90 degree rotation. To rotate a display 180 degrees you would need to perform this operation twice, and you may need a second buffer. Unfortunately I can not recall the article I read, nor do I have the source code for this algorithm