2025-07-08 1:51 PM
We have a 480W 800H TFT display that TouchGFXDesigner can nicely display in landscape mode instead of portrait.
The trouble is that the device UI is now upside down. TouchGFXDesigner doesn't seem to accept other display rotations such as 180 and 270. Correct?
The designer does allow for the text to be rotated 180 which would look correct on our display. But that has other consequences.
Has anyone else had this issue?
2025-07-10 8:19 AM
Hello @ARM_and ,
We do not support that feature directly in TouchGFX because the display should have that functionality already (to flip the display at least).
So with just 0 and 90 degree plus the display's driver, you can get to 180 or 270.
Regards,
2025-07-11 11:34 AM
Thank you @GaetanGodart. I see that there are other posts about this as well: https://community.st.com/t5/stm32-mcus-touchgfx-and-gui/dsi-display-is-mirrored/td-p/733566
Regards,
-A
2025-07-15 5:29 AM
There is a custom widget on forum,https://community.st.com/s/question/0D50X0000A1lVxs/repost-change-lcd-orientation-in-180-degree
I tried it in my project,It is working,but cost very long time,about 10ms(my screen is 320*240,rgb565,160Mhz cpu),So I changed it a bit.Now it uses 5ms turn screen upside down.here is my changed part.but your screen is 800*480,the time maybe expand several times.
// 16 Bit implementation
virtual void draw(const touchgfx::Rect& invalidatedArea) const
{
uint16_t *framebuffer = touchgfx::HAL::getInstance()->lockFrameBuffer();
const uint32_t total_pixels = 320 * 240;
uint32_t *buffer_32 = (uint32_t *)framebuffer; // 转换为32位指针
const uint32_t nblocks = total_pixels / 2; // 32位块的数量
uint32_t *start = buffer_32;
uint32_t *end = buffer_32 + nblocks - 1;
uint32_t a;
while (start < end) {
// 读取两个32位块(各包含2个像素)
a = *start;
// 交换每个块内的两个像素(高16位和低16位互换)
*start = ((*end) >> 16) | ((*end) << 16);
*end = (a >> 16) | (a << 16);
start++;
end--;
}
touchgfx::HAL::getInstance()->unlockFrameBuffer();
}