This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

GLCD_SPI_LPC1700.c: GLCD_ScrollVertical()

Hi All, Can anyone who are quite familiar with GLCD_SPI_LPC1700.c help me out? There is a vertically scroll screen function provided in that file. But that will scroll the whole screen. What i want is to scroll a certain size of window based on my design. But the code is really hard to understand. All the ops is directly to the reg without any comment. Here is just the code of the function. I don't know how to upload the attachment. The whole GLCD_SPI_LPC1700 contains 929 lines in all.

void GLCD_ScrollVertical (unsigned int dy) {
#if (LANDSCAPE == 0)
  static unsigned int y = 0;

  y = y + dy;
  while (y >= HEIGHT)//HEIGHT=320
    y -= HEIGHT;

  if (Himax) {
    wr_reg(0x01, 0x08);
    wr_reg(0x14, y>>8);                 /* VSP MSB                            */
    wr_reg(0x15, y&0xFF);               /* VSP LSB                            */
  }
  else {
    wr_reg(0x6A, y);
    wr_reg(0x61, 3);
  }
#endif
}

Anyone any advice TT? Thanks all!

Parents
  • Almost all LCD controllers have support for adjusting an offset to the start of the displayed image memory. This allows vertical scroll with almost zero hw support inside the LCD controller. If they allow support for scan lines wider than the display width, then they can also manage horisontal scroll by having a back-end bitmap wider than what is visible and just adjust the start address.

    Scrolling a window? Then the controller must either have a magic translation engine that can take all accesses to the image memory and translate the address when accessing, so it could have x,y addresses within a specific rectangle to translate into a different address. This is very complicated. Or the controller must support bit-blit operations where it performs a rectangle copy from one location in image RAM to another location (while then having the application draw new information for the area that got "scrolled in". Small display controllers normally don't have such bit-blit functionality - it took quite some time before PC hardware got such support.

    As you must realize, it is not trivial for the hardware to scroll just a subset of the visible surface.

Reply
  • Almost all LCD controllers have support for adjusting an offset to the start of the displayed image memory. This allows vertical scroll with almost zero hw support inside the LCD controller. If they allow support for scan lines wider than the display width, then they can also manage horisontal scroll by having a back-end bitmap wider than what is visible and just adjust the start address.

    Scrolling a window? Then the controller must either have a magic translation engine that can take all accesses to the image memory and translate the address when accessing, so it could have x,y addresses within a specific rectangle to translate into a different address. This is very complicated. Or the controller must support bit-blit operations where it performs a rectangle copy from one location in image RAM to another location (while then having the application draw new information for the area that got "scrolled in". Small display controllers normally don't have such bit-blit functionality - it took quite some time before PC hardware got such support.

    As you must realize, it is not trivial for the hardware to scroll just a subset of the visible surface.

Children
  • Thanks for the details! I'm still a student and never handle LCD control before...

    Seems the idea is not as easy as i thought before. I gonna take a look at the LCD support document first and...Well, i'm not sure if i can understand the whole stuff at the end based on my experience...- -!

    Anyway, it's better than knowing nothing at all.