cancel
Showing results for 
Search instead for 
Did you mean: 

Rotate Bitmap on SPI

monta
Associate II
Posted on May 15, 2015 at 13:45

Hi there , I'm using this code to display a Bitmap (stored in an array) on a TFT.

int Cnt = 128 * 128;int i = 1;SetAddrWindow(0,0,128,128);while (Cnt--) { writeData16(mainscreen[i]); i++;}

However I get my image rotated , like in landscape mode, and I want to rotate it vertically? Anyone can help me to achieve this ?I'm using a 128*128 Module with SPI interface.Thank you !!!!!!!

2 REPLIES 2
matthew2
Associate II
Posted on May 16, 2015 at 11:36

Hi.

If your using SPI to write to your display then you probably have a display with a built in controller.

Adjusting the settings on the controller will allow you to rotate the display between landscape and portrait mode. 

Many 128x128 colour LCDs use a ILI9163 controller.  To set the orientation on this controller you need to modify the contents of register 0x36.  Have a look on page 122 of this data sheet

http://www.rockbox.org/wiki/pub/Main/SonyNWZE370/ILI9163.pdf

Typically you would use a sequence like this:

LCDWriteCmd(0x36);  //Address register 0x36

LCDWriteData(0x60);  //90° rotation

The methods would need to be changed to suite your library.

Hope this is of some help.

monta
Associate II
Posted on May 17, 2015 at 18:20

Thank you. That's exactly what I've done. Though I had to modifiy the data to 0x40. thumbs up