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

📄 ft1505c_cmo2d4_gamma1.8.c

📁 TFT的驱动代码,搭配CMO的玻璃,用于手机或MP4,
💻 C
字号:
void FT1505C_CMO2D4_Vx (void)
{
	 RESET=0;
	delay_ms(5);
	RESET=1;
	delay_ms(10);  //waiting for releasing reset
	
	wr_reg(0x00);	
	wr_reg(0x00);	
	wr_reg(0x00);	
	wr_reg(0x00);	
	
	
	send_host_reg_command(0x002b, 0x0003);	//osc=477K, framerate=90Hz  //00 is 358KHz
	send_host_reg_command(0x0000, 0x0001);	//00[0]=OSC_EN
	delay_ms(50);        
	send_host_reg_command(0x0007, 0x0000);//07[13:12]=PTDE[1:0]; 07[8]=BASEE; 07[5:3]=GON,DTE,CL; 07[1:0]=D[1:0]
	delay_ms(50);                
	send_host_reg_command(0x0012, 0x0000);//12[8:7]=VCMR,VCIRE;  12[4]=PON; 12[3:0]=VRH[3:0]
	delay_ms(50);
	send_host_reg_command(0x0060, 0xa700);//60[15]=GS; 60[13:8]=NL[5:0]; 60[5:0]=SCN[5:0]
	send_host_reg_command(0x0008, 0x0405);//08[11:8]=FP[3:0]; 08[3:0]=BP[3:0]	
/*************************** gamma setting ************************************/
send_host_reg_command(0x0030, 0x0204);
send_host_reg_command(0x0031, 0x0007);
send_host_reg_command(0x0032, 0x0100);
send_host_reg_command(0x0035, 0x0506);
send_host_reg_command(0x0036, 0x080e);
send_host_reg_command(0x0037, 0x0405);
send_host_reg_command(0x0038, 0x0002);
send_host_reg_command(0x0039, 0x0607);
send_host_reg_command(0x003c, 0x0700);
send_host_reg_command(0x003d, 0x0005);
 /***************************************************************************/
    send_host_reg_command(0x0010, 0x02c0);//10[15:13]=GAP[2:0]; 10[12]=SAP; 10[11:0]=GAPSEL; 10[10:8]=BT[2:0]; 10[7]=APE; 10[6:4]=AP[2:0]; 10[2:0]=DSTB,SLP,STB;  		
	send_host_reg_command(0x0011, 0x0247);//11[10:8]=DC1[2:0]; 11[6:4]=DC0[2:0]; 11[2:0]=VC[2:0];
	delay_ms(30); 
	send_host_reg_command(0x0012, 0x0119);
	delay_ms(30);
	send_host_reg_command(0x0013, 0x1900);//13[12:8]=VDV[5:0] 0x1d00  0x1900

	send_host_reg_command(0x0029, 0x0015);//29[5:0] =Vcm[5:0] 0x001b  0x0009
	delay_ms(30);  
    send_host_reg_command(0x0001, 0x0100);//01[10]=SM; 01[8]=SS	
	send_host_reg_command(0x0002, 0x0700);//02[9]=B/C; 02[8]=EOR; 02[5:0]=NM[5:0]	
	send_host_reg_command(0x0003, 0x1030);//03[15:14]=TRI,DFM; 03[12]=BGR; 03[9]=HWM; 03[5:4]=I/D[1:0]; 03[3]=AM	
	
	send_host_reg_command(0x0061, 0x0001);//61[2]=NDL; 61[1]=VLE; 61[0]=REV	

	send_host_reg_command(0x0090, 0x001c);//90[9:8]=DIVI[1:0]; 90[4:0]=RTNI[4:0]		
	send_host_reg_command(0x0092, 0x0000);//92[10:8]=NOI[2:0]		
	send_host_reg_command(0x0080, 0x0000);//80[8:0]=PTDP0[8:0]	
	send_host_reg_command(0x0081, 0x0000);//81[8:0]=PTSA0[8:0]	
	send_host_reg_command(0x0082, 0x013f);//82[8:0]=PTEA0[8:0]	
	send_host_reg_command(0x0083, 0x0000);//83[8:0]=PTDP1[8:0]	
	send_host_reg_command(0x0084, 0x0000);//84[8:0]=PTSA1[8:0]	
	send_host_reg_command(0x0085, 0x013f);//85[8:0]=PTEA1[8:0]	
	send_host_reg_command(0x0050, 0x0000);//50[7:0]=HSA[7:0]	
	send_host_reg_command(0x0051, 0x00ef);//51[7:0]=HEA[7:0]	
	send_host_reg_command(0x0052, 0x0000);//52[8:0]=VSA[8:0]	
    send_host_reg_command(0x0053, 0x013f);//53[8:0]=VEA[8:0]	
       
    send_host_reg_command(0x0091, 0x0300);
    send_host_reg_command(0x0098, 0x0303);//98[15:0]=0202
	//display on
	send_host_reg_command(0x0010, 0x12C0);
 	// middle is x3xx ,don't more than 7		
	delay_ms(20);
	send_host_reg_command(0x0007, 0x0133);//07[13:12]=PTDE[1:0]; 07[8]=BASEE; 07[5:3]=GON,DTE,CL; 07[1:0]=D[1:0]

}

⌨️ 快捷键说明

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