Content originally posted in LPCWare by Karl on Fri Sep 14 13:09:09 MST 2012
Hi Engin,
Assuming you are using the linear framebuffer driver, this is pretty easy to accomplish in emWin. The first parameter passed to GUI_DEVICE_CreateAndLink() determines the orientation. You have the option of mirroring an axis, or swapping X and Y. Look for that call in the LCD_X_Config() function in LCDConf.c.
<code>
/* Default orientation */
GUI_DEVICE_CreateAndLink(GUIDRV_Lin_16, GUICC_M565, 0, 0);
/* Mirror the X axis */
GUI_DEVICE_CreateAndLink(GUIDRV_Lin_OX_16, GUICC_M565, 0, 0);
</code>
All available options are listed in the emWin documentation (Display Driver chapter).
Depending on what display you have, there may be another option. If your display has a programmable driver on board, typically with an SPI interface, it is very likely that you can select a scan order there. Embedded Artists have a 3.5" display with an SSD1289 controller, which allows you to mirror each axis as required.
If your display supports it, this is the preferred place to mirror the output. Letting emWin do the job comes at the cost of extra CPU activity. It is better to use the default emWin driver, and let the display controller do the job in hardware.
Regards,
Karl