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!
That means that hardware has support for scrolling but only whole screen can be scrolled by LCD hardware, it might be that hardware enables setting a window and using operations on that window in which case you will have to add functionality for that. Anyways, you have to read documentation regarding which controller is on the LCD that you are using, see what that controller allows by hardware and extend LCD functions to enable you to do what you want with LCD controller hardware or do what you want in software in your LCD driver.
So why not post a link to wherever this file comes from?
You seem to be assuming that the filename uniquely identifies just one file in the whole world?
Unfortunately, that is not the case - anyone writing a file in any way connected to any "GLCD" with SPI and an LPC1700 might call it "GLCD_SPI_LPC1700.c"
And that's not accounting for the possibility that a file name might not even be appropriate to its contents...
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.
Thanks...I used to think that this drive is provided by keil and has an unique name...
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.