2022-02-06 10:35 PM
I want to rotate 90 degree the screen. How do it?
Rotate the screen 90 degrees?
Solved! Go to Solution.
2022-02-10 11:31 PM
You dont need for touch register setup (maybe controller IC have one but simpler way is)
edit in target file TouchGFX\target\STM32TouchController.cpp
bool STM32TouchController::sampleTouch(int32_t& x, int32_t& y)
{
/**
* By default sampleTouch returns false,
* return true if a touch has been detected, otherwise false.
*
* Coordinates are passed to the caller by reference by x and y.
*
* This function is called by the TouchGFX framework.
* By default sampleTouch is called every tick, this can be adjusted by HAL::setTouchSampleRate(int8_t);
*
*/
if(i2cRXbuff[0]==0) return false;
x=i2cRXbuff[2];
y=i2cRXbuff[4];
return true;
}
This is only example code and for change flip simply rewrite two lines x=XMAX-x; ...
2022-02-07 12:39 AM
Hi,
Within TouchGFX Designer you can set the display orientation to either Landscape or Portrait mode, so a 90degree rotation. To do so, go to the Config tab in the bottom left of TouchGFX Designer and go to the Display section.
Otherwise you can do this as you said within STM32CubeMX where you set the display to 480*800.
/Romain
2022-02-07 02:10 AM
I rotated 90 degree. But Letters rotated 180 degrees. How can I it solve this problem.
2022-02-07 02:28 AM
What option did you use to rotate 90 degrees in the end ? That issue is unusual I never faced it. Could you try to delete that TextArea widget and create another one to see if you still face it ? Did you by any chance added some user code before where you would change the text rotation :grinning_face_with_sweat:?
2022-02-07 02:56 AM
What option did you use to rotate 90 degrees in the end ?
TouchGFX->Config->Display->Display Orientation
Could you try to delete that TextArea widget and create another one to see if you still face it ?
I rebuilt. But the same situation continues.
Did you by any chance added some user code before where you would change the text rotation?
No, I didnt. I just created a simple interface with TouchGFX. I didn't even get to the code part.
2022-02-07 06:06 AM
TouchGFX rotate 90 change communication width and heigth , other rotations you need create mechanicaly rotate LCD or by LCD setup config registers. Try search and change MADCTL
2022-02-07 06:17 AM
What MCU are you using ? And what version of TouchGFX ? I was not able to replicate that issue on my side.
/Romain
2022-02-07 06:19 AM
Wait now that i look at your picture again I can see that the button is also rotated in the same way, are you sure it isn't just properly rotated but your display is inverted/upside-down :grinning_face_with_sweat:?
/Romain
2022-02-07 10:15 PM
MCU: STM32H7B3IIT6
TouchGFX Version: 4.18.1
2022-02-07 10:20 PM
The screen is as follows.