//*************************************************************** // //***** Focus LCDs ***** //***** LCDs Made Simple ***** //***** www.FocusLCDs.com ***** // //*************************************************************** // // /*************************************************/ void initi(void) { res=1; delay(1); res=0; delay(10); res=1; delay(120); //***************************************************************//LCD SETING write_command(0x36); write_data(0x00); //-------------------------------ST7789S Frame rate setting----------------------------------// write_command(0xb2); write_data(0x0c); write_data(0x0c); write_data(0x00); write_data(0x33); write_data(0x33); write_command(0xb7); write_data(0x35); //---------------------------------ST7789S Power setting--------------------------------------// write_command(0xbb); write_data(0X35);//vcom flick write_command(0xc2); write_data(0x01); write_command(0xc3);//gvdd write_data(0x10); //µ÷Éîdz12 write_command(0xc4); write_data(0x20); write_command(0xc6); write_data(0x0f); write_command(0xd0); write_data(0xa4); write_data(0xa2); //--------------------------------ST7789S gamma setting---------------------------------------// write_command(0xe0); write_data(0xD0); write_data(0x00); write_data(0x02); write_data(0x07); write_data(0x0A); write_data(0x28); write_data(0x32); write_data(0x44); write_data(0x42); write_data(0x06); write_data(0x0E); write_data(0x12); write_data(0x14); write_data(0x17); write_command(0xe1); write_data(0xD0); write_data(0x00); write_data(0x02); write_data(0x07); write_data(0x0A); write_data(0x28); write_data(0x31); write_data(0x54); write_data(0x47); write_data(0x0E); write_data(0x1C); write_data(0x17); write_data(0x1B); write_data(0x1E); write_command(0x3a); write_data(0x66); write_command(0x2A); //Frame rate control write_data(0x00); write_data(0x00); write_data(0x00); write_data(0xEF); write_command(0x2B); //Display function control write_data(0x00); write_data(0x00); write_data(0x01); write_data(0x3F); //********************** write_command(0x11); delay(120); //Delay 120ms write_command(0x29); //display on delay(25); write_command(0x2c); } //********************************************************************************************* void EnterSleep (void) { write_command(0x28); delay(20); write_command(0x10); } //********************************************************* void ExitSleep (void) { write_command(0x11); delay(120); write_command(0x29); }