AnsweredAssumed Answered

STemWin LCD Rotation on STM32F429 Discovery

Question asked by on Jan 3, 2016
Latest reply on Jan 6, 2016 by
I'm trying to rotate the display on an STM32F429 Discovery board by 90 degrees clockwise.  When I tried to place objects such as text, hline, and vline, the coordinates weren't quite what I expected (in fact, most of the pixels were being placed off the screen).  I'm using the driver GUIDRV_LIN_OSY_16.  

Using this driver, it seems that because the x and y axis are swapped, then mirrored about the y axis, that my problems were being exacerbated.  So I took a step back and used GUIDRV_LIN_OS_16 which just swaps the x and y axis.  So the problem that I'm having is that the vlines are displayed correctly, but hlines place pixels on several different horizontal lines (as viewed in the new orientation).  It's as if the libraries don't know the correct number of pixels in a horizontal scan of the LCD to get to the next pixel in the rotated horizontal line.  I'm hoping that this is only because I have something configured incorrectly.

I left the dimensions of the screen the same as the original cube Discovery board project:
#define XSIZE_PHYS 240
#define YSIZE_PHYS 320

I thought that perhaps in LCD_LL_LayerInit where the layers are initialized that I should reverse the xsize and ysize when the window is configured, but this made the display completely jumbled.

I have a test case that I'll try to attach to illustrate my problem; it uses the following calls:
GUI_DispStringAt("Test Text", 5, 150);
GUI_DrawVLine(15,100, 200);
GUI_DrawHLine(100,15, 20);

The text isn't placed exactly where I thought it would be, but I'm pleased that text works so well.

I'm using v5.22 of STemWin.  I read that the version is up to 5.26 so I'm going to try to locate that now.

If anyone has any experience with this issue I would really appreciate any feedback.

Thank you.