⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 nt3916别人的代码.txt

📁 Init lcd** 函数名称: init_lcd ** 功能描述: 输出显示数据,并行
💻 TXT
字号:

/*===========================================================================
** 函数名称: init_lcd
** 功能描述: 输出显示数据,并行,软件模拟8080
** 功能描述: 对LCD进行初始化
** 功能描述: 显示图片数据8bit
============================================================================*/
void init_lcd(void)
  { 

  	Delay(2);					  //delay 2 ms
  	
    LCD_write_c(0x0001);		 //software reset    
    Delay(60);				 	//delay 60 ms

    LCD_write_c(0x0028);		 //display off

    LCD_write_c(0x0038);		 //idl mode off  

    LCD_write_c(0x0011);		 //sleep out&booster on; 
    Delay(20);				 	//delay 20 ms
      		 		         
    LCD_write_c(0x0013);    	//normal display
    Delay(1);

    LCD_write_c(0x0020);		//inversion display off(normal display)
    Delay(1); 

    LCD_write_c(0x0026);    	//gamma curve select
    LCD_write_p(0x0001);    	// 
    Delay(1);


//power on

    LCD_write_c(0x00c0);    	//power control 1
    LCD_write_p(0x0005);    	//set vrh4-0 
    LCD_write_p(0x0005);    	//set vc2-0 
    Delay(1);

    LCD_write_c(0x00c1);    	//power control 2
    LCD_write_p(0x0007);    	//set BT2-0
    Delay(1);
 
    LCD_write_c(0x00c2);    	//power control 3(normal mode)
    LCD_write_p(0x0005);    	//set apa2-0
    LCD_write_p(0x0000);    	//set dca2-0
    Delay(1);
 
    LCD_write_c(0x00c3);    	//power control 4(idl mode)
    LCD_write_p(0x0004);    	//set apb2-0
    LCD_write_p(0x0007);    	//set dcb2-0  
    Delay(1);

    LCD_write_c(0x00c4);    	//power control 5(partial mode)
    LCD_write_p(0x0003);    	//sset apc2-0
    LCD_write_p(0x0007);    	//set dcc2-0
    Delay(1);
 
    LCD_write_c(0x00c5);    	//vcom control,Regulate the flicker
    LCD_write_p(0x003a);    	//set vcomh
    LCD_write_p(0x0038);    	//set vcoml ,
    Delay(1);



	Delay(20);
//end power on



    LCD_write_c(0x00b1);    	//frame rate control
    LCD_write_p(0x000e);    	//set diva5-0
    LCD_write_p(0x0012);    	//set vpa5-0
    Delay(1);

    LCD_write_c(0x00b4);    	//display inversion control
    LCD_write_p(0x0000);    	// frame/line inversion
    Delay(1);


    LCD_write_c(0x00b6);    	//display function setting
    LCD_write_p(0x0000);    	// set SDT,PT,EQ
    LCD_write_p(0x0000);    	//
    Delay(1); 

    LCD_write_c(0x00b7);    	//source  output direction control
    LCD_write_p(0x0000);    	//s1->s628
    Delay(1);

    LCD_write_c(0x00b8);    	//gate driver output direction control
    LCD_write_p(0x0000);    	// g1->g220
    Delay(1);


    LCD_write_c(0x0036);    	//memory data access control
    LCD_write_p(0x0000);    	//set MY,MX,MV,ML,RGB,MH 
    Delay(1);

    LCD_write_c(0x003a);    	//interface pixel format
    LCD_write_p(0x0055);    	// 
    Delay(1);

    LCD_write_c(0x002a);    	//column address set
    LCD_write_p(0x0000);    	//X start address
    LCD_write_p(0x0000);    	//
    LCD_write_p(0x0000);    	//X end address
    LCD_write_p(0x00af);    	//
    Delay(1);

    LCD_write_c(0x002b);    	//row address set
    LCD_write_p(0x0000);    	//y start address
    LCD_write_p(0x0000);    	//
    LCD_write_p(0x0000);    	//y end address
    LCD_write_p(0x00db);    	//
    Delay(1);

    LCD_write_c(0x0029);    	//display on
    Delay(60);

    LCD_write_c(0x002c);    	//memory write
    Delay(1);



} 	

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -