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

📄 ft1505_lg20_initial_new.c

📁 1505 IC 的初始化代码
💻 C
字号:
void FT1505_LG20_Initial( void )
{
	RESET=0;
	delay_ms(5);
	RESET=1;
	delay_ms(10);  //waiting for releasing reset
	
	wr_reg(0xFF);
	wr_reg(0x00);
	wr_reg(0x00);
	wr_reg(0x00);


	send_host_reg_command(0x0000, 0x0000);
	send_host_reg_command(0x00b0, 0x0002);	//78Hz
	send_host_reg_command(0x00b0, 0x0002);	//78Hz
	send_host_reg_command(0x0010, 0x0000);
	send_host_reg_command(0x0011, 0x0000); 
	send_host_reg_command(0x0012, 0x0000);  
	send_host_reg_command(0x0000, 0x0001); delay_ms(20);        
	send_host_reg_command(0x0007, 0x0000); delay_ms(1);                
	send_host_reg_command(0x0012, 0x0000); delay_ms(1);
	send_host_reg_command(0x0070, 0xBf00);	
	send_host_reg_command(0x0008, 0x0405);	

/*************************** gamma setting ************************************/
	send_host_reg_command(0x0030, 0x0000);
	send_host_reg_command(0x0031, 0x0000);
	send_host_reg_command(0x0032, 0x0707);
	send_host_reg_command(0x0033, 0x0301);
	send_host_reg_command(0x0034, 0x0000);
	send_host_reg_command(0x0035, 0x0303);
	send_host_reg_command(0x0036, 0x0707);
	send_host_reg_command(0x0037, 0x0006);
	send_host_reg_command(0x0038, 0x191a);
	send_host_reg_command(0x0039, 0x1516);
/*************************** gamma setting ************************************/

	send_host_reg_command(0x0015, 0x0001);				
	send_host_reg_command(0x0010, 0x67b0);		
	send_host_reg_command(0x0011, 0x0247);	 delay_ms(10);   					
	send_host_reg_command(0x0012, 0x0107);	 delay_ms(20);        		
	send_host_reg_command(0x0013, 0x9d14);	 delay_ms(20);

    send_host_reg_command(0x0001, 0x0000);	
	send_host_reg_command(0x0002, 0x0700);	
	send_host_reg_command(0x0003, 0x4030);	
	
        	
	send_host_reg_command(0x0071, 0x0000);	
	
	send_host_reg_command(0x0090, 0x0100);		
	send_host_reg_command(0x0091, 0x0000);	
	send_host_reg_command(0x0092, 0x0203);		
	send_host_reg_command(0x0009, 0x0000);	

	send_host_reg_command(0x0080, 0x0000);	
	send_host_reg_command(0x0081, 0x0000);	
	send_host_reg_command(0x0082, 0x013f);	
	send_host_reg_command(0x0083, 0x0000);	
	send_host_reg_command(0x0084, 0x0000);	
	send_host_reg_command(0x0085, 0x013f);	
	
	send_host_reg_command(0x0050, 0x0000);	
	send_host_reg_command(0x0051, 0x00ef);	
	send_host_reg_command(0x0052, 0x0000);	
	send_host_reg_command(0x0053, 0x013f);	
	
	send_host_reg_command(0x0010, 0x77b0);	 delay_ms(10);
		        
	send_host_reg_command(0x0012, 0x1117);	 delay_ms(20);
	send_host_reg_command(0x0007, 0x0023);
	send_host_reg_command(0x0007, 0x3233);	

}


void ExitSleep( void )
{
      
	send_host_reg_command(0x0000, 0x0001);	
	send_host_reg_command(0x0010, 0x67b0);	
	send_host_reg_command(0x0011, 0x0247);	
	delay_ms(20);
	
	send_host_reg_command(0x0012, 0x0107);	
	delay_ms(20);

	send_host_reg_command(0x0010, 0x77b0);	
	delay_ms(20);


	send_host_reg_command(0x0012, 0x1117);	
	delay_ms(20);
	send_host_reg_command(0x0007, 0x0023);	
	delay_ms(20);
	send_host_reg_command(0x0007, 0x3233);	
}


void EntrySleep( void )
{
	//Enter display off
	send_host_reg_command(0x0007, 0x0001);	

	send_host_reg_command(0x0012, 0x0117);	
	delay_ms(120);
	
	send_host_reg_command(0x0007, 0x0000);
	
	//Power supply OFF
	send_host_reg_command(0x0010, 0x0680);	
	delay_ms(20);
	
	send_host_reg_command(0x0011, 0x0657);	

	send_host_reg_command(0x0011, 0x0067);	
	delay_ms(20);
	
	send_host_reg_command(0x0012, 0x0107);	
	delay_ms(120);
	
	send_host_reg_command(0x0010, 0x0600);	
	delay_ms(20);
	
	//Enter sleep mode 
	#ifdef ENTER_SLEEP
	{
	send_host_reg_command(0x0010, 0x0602);	
	delay_ms(20);
	}
	#endif
	
	//Enter Standby mode 
	#ifdef ENTER_STB
	{
	send_host_reg_command(0x0010, 0x0601);	
	delay_ms(20);
	}
	#endif
	
	//Enter Deep standby mode
	#ifdef ENTER_DSTB
	{
	send_host_reg_command(0x0010, 0x0604);	
	delay_ms(20);
	}
	#endif
}

⌨️ 快捷键说明

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