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-09-04 05:13 AM
You can create this example yourself easily. It's so simple i deleted it.
It would probably be good for you to see it with a simple example, yeah. And sure, the non-rotated stuff you're seeing could be the hardfault
/Martin
2019-09-04 06:23 AM
I tried it but didn't get it working. It's the same as before. I get in a hardfault.
I've attached the STM32F746G-DISCO example. (Atollic Project)
I've done the following steps:
Maybe you can see what I've done wrong.
2019-09-05 12:01 AM
But you can get other examples running no problem?
/Martin
2019-09-05 12:05 AM
Yes, other examples are running like it should. I'm only getting trouble with the screeen mirroring.
Regards
Dejan
2019-09-05 01:05 AM
I'm having some issues with the mirror.hpp file from your project. I have no problems with the original Mirror.hpp i posted - Follow the instructions in the original post. I'll repost it here.
2019-09-05 01:07 AM
Actually, just scroll up and check the post that was edited January 2. It has the original Mirror.hpp and a guide for how to add it. I forgot to mention you need to add some code in FrontEndApplication.hpp to redraw the entire screen always (Lack of this should not cause a fault, though) and make some modifications to your touch controller.
/Martin
2019-09-05 01:38 AM
I've already seen the post from January. It was my fault, I had a wrong width in DISP_WIDTH. That's why i got the hardfault.
Now it mirrors the display correctly. When I press on the touchscreen to select a checkbox it changes the rotation to 0 degress. The other time I press on this checkbox it changes the rotation back to 180 degrees.
Do you have any idea why it's changing the rotation everytime the checkboxes are pressed?
Regards
Dejan
2019-09-05 02:37 AM
@Martin KJELDSEN
It's working now. I just had to refresh and rebuild the project in atollic.
Thank you very much for your support.
Regards Dejan
2019-09-05 04:09 AM
That's great, @Dejan Nedeljkovic,
No problem!
/Martin
2019-11-25 02:12 AM
Hi , Martin
Did you mean that now only some MCU which take GFXMMU module like STM32L4R9 can support 180 degree rotation display ?