//*************************************************************** // //***** Focus LCDs ***** //***** LCDs Made Simple ***** //***** www.FocusLCDs.com ***** // //*************************************************************** // // //**************************// NOTE:VCI=3.3V,IOVCC=1.8V, Display resolution:480*800 params->dsi.vertical_sync_active=4 params->dsi.vertical_backporch=20 params->dsi.vertical_frontporch=10 params->dsi.horizontal_sync_active=4 params->dsi.horizontal_backporch=35 params->dsi.horizontal_frontporch=20 params->dsi.PLL_CLOCK=(336)MBPS params->RGB_CLOCK=(27)MHZ Frame Rate=60HZ //************************************** //--------------------initial code-----------------------------------------// void LCD_Init(void) { RST=1; delay(1) //MS RST=0; delay(10);//MS RST=1; delay(120)//MS //*******************************/ write_command(0x11); //OUT SLEEP delay(120); /*-------------------------------Bank0 Setting--------------------------------*/ /*--------------------------Display Control setting---------------------------*/ write_command(0xFF); write_data(0x77); write_data(0x01); write_data(0x00); write_data(0x00); write_data(0x10); write_command(0xC0); //480*800 write_data(0x63); write_data(0x00); write_command(0xC1); write_data(0x11); write_data(0x02); write_command(0xC2); //Inversion selection write_data(0x37); //31 2-DOT 37-Column write_data(0x08); write_command(0xCC); write_data(0x18); //**********GAMMA SET***************// write_command(0xB0); write_data(0x40); write_data(0xC9); write_data(0x91); write_data(0x0D); write_data(0x12); write_data(0x07); write_data(0x02); write_data(0x09); write_data(0x09); write_data(0x1F); write_data(0x04); write_data(0x50); write_data(0x0F); write_data(0xE4); write_data(0x29); write_data(0xDF); write_command(0xB1); write_data(0x40); write_data(0xCB); write_data(0xD0); write_data(0x11); write_data(0x92); write_data(0x07); write_data(0x00); write_data(0x08); write_data(0x07); write_data(0x1C); write_data(0x06); write_data(0x53); write_data(0x12); write_data(0x63); write_data(0xEB); write_data(0xDF); /*-----------------------------End Gamma Setting------------------------------*/ /*------------------------End Display Control setting-------------------------*/ /*-----------------------------Bank0 Setting End-----------------------------*/ /*-------------------------------Bank1 Setting--------------------------------*/ /*--------------------- Power Control Registers Initial ----------------------*/ write_command(0xFF); write_data(0x77); write_data(0x01); write_data(0x00); write_data(0x00); write_data(0x11); write_command(0xB0); write_data(0x65); /*--------------------------------Vcom Setting--------------------------------*/ write_command(0xB1); write_data(0x6A);//65+++ /*------------------------------End Vcom Setting------------------------------*/ write_command(0xB2);//VGH write_data(0x87); write_command(0xB3); write_data(0x80); write_command(0xB5); //VGL write_data(0x49); write_command(0xB7); write_data(0x85); write_command(0xB8); //avdd write_data(0x20); write_command(0xB9); //Power Control 2 write_data(0x10); write_command(0xC1); write_data(0x78); write_command(0xC2); write_data(0x78); write_command(0xD0); write_data(0x88); delay(100); /*--------------------End Power Control Registers Initial --------------------*/ //********GIP SET********************/// write_command(0xE0); write_data(0x00); write_data(0x00); write_data(0x02); write_command(0xE1); write_data(0x08); write_data(0x00); write_data(0x0A); write_data(0x00); write_data(0x07); write_data(0x00); write_data(0x09); write_data(0x00); write_data(0x00); write_data(0x33); write_data(0x33); write_command(0xE2); write_data(0x00); write_data(0x00); write_data(0x00); write_data(0x00); write_data(0x00); write_data(0x00); write_data(0x00); write_data(0x00); write_data(0x00); write_data(0x00); write_data(0x00); write_data(0x00); write_data(0x00); write_command(0xE3); write_data(0x00); write_data(0x00); write_data(0x33); write_data(0x33); write_command(0xE4); write_data(0x44); write_data(0x44); write_command(0xE5); write_data(0x0E); write_data(0x60); write_data(0xA0); write_data(0xA0); write_data(0x10); write_data(0x60); write_data(0xA0); write_data(0xA0); write_data(0x0A); write_data(0x60); write_data(0xA0); write_data(0xA0); write_data(0x0C); write_data(0x60); write_data(0xA0); write_data(0xA0); write_command(0xE6); write_data(0x00); write_data(0x00); write_data(0x33); write_data(0x33); write_command(0xE7); write_data(0x44); write_data(0x44); write_command(0xE8); write_data(0x0D); write_data(0x60); write_data(0xA0); write_data(0xA0); write_data(0x0F); write_data(0x60); write_data(0xA0); write_data(0xA0); write_data(0x09); write_data(0x60); write_data(0xA0); write_data(0xA0); write_data(0x0B); write_data(0x60); write_data(0xA0); write_data(0xA0); write_command(0xEB); write_data(0x02); write_data(0x01); write_data(0xE4); write_data(0xE4); write_data(0x44); write_data(0x00); write_data(0x40); write_command(0xEC); write_data(0x02); write_data(0x01); write_command(0xED); write_data(0xAB); write_data(0x89); write_data(0x76); write_data(0x54); write_data(0x01); write_data(0xFF); write_data(0xFF); write_data(0xFF); write_data(0xFF); write_data(0xFF); write_data(0xFF); write_data(0x10); write_data(0x45); write_data(0x67); write_data(0x98); write_data(0xBA); write_command(0xFF); write_data(0x77); write_data(0x01); write_data(0x00); write_data(0x00); write_data(0x00); //write_command(0x35);//TE ON write_command(0x36); write_data(0x00);//10-180 write_command(0x3A); write_data(0x70); write_command(0x29); //DISP ON delay(25); Łę //******************************************* void EnterSleep (void) { write_command(0x28); delay(10); write_command(0x10); } //********************************************************* void ExitSleep (void) { write_command(0x11); delay(120); write_command(0x29); }