#define fbWidth 160#define fbHeight 200
u16 frameBuffer[fbWidth*fbHeight];// 160*200*16bit
here are the functions that I used to write to the FB then copy to the LCD.
void LCD_ClearFB(){
LCD_SetCursor(0,0);
u16 pixel;for( pixel =0; pixel< fbHeight*fbWidth; pixel++){
frameBuffer[pixel]=0x0;
}
}
void LCD_Flip()// copy the Framebuffer to the LCD Gram{
LCD_WriteRegister(0x0050,0);// Horizontal GRAM Start Address
LCD_WriteRegister(0x0051, fbWidth);// Horizontal GRAM End Address
LCD_WriteRegister(0x0052,0);// Vertical GRAM Start Address
LCD_WriteRegister(0x0053, fbHeight);// Vertical GRAM Start Address
LCD_WriteRegister(32,0);
LCD_WriteRegister(33,0);
LCD_WriteIndex(34);
u16 pixel;for( pixel =0; pixel< fbHeight*fbWidth; pixel++){
u16 color = frameBuffer[pixel];
LCD_WriteData(color);}
}