Skip to main content
monta
Associate III
May 15, 2015
Question

Rotate Bitmap on SPI

  • May 15, 2015
  • 2 replies
  • 737 views
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 !!!!!!!

    This topic has been closed for replies.

    2 replies

    matthew2
    Associate
    May 16, 2015
    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
    montaAuthor
    Associate III
    May 17, 2015
    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