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

📄 s6b33bf.c

📁 S6B33Bf CSTN LCD 初始化 LCD大小128X160
💻 C
字号:
void Init()
{
//-----------------------------------------------------------------------------------//
//-----------------------------Initial Code Start------------------------------------//
//-----------------------------------------------------------------------------------//
//Driver IC:Samsung S6B33B9
//Initialize 65k color LCD;

/*------standby_off -------------- */
	WriteData(WRCOMM,0x2C);
	Delay(20);

/*------set OTP mode off---------*/
	WriteData(WRCOMM,0xEA);
	Delay(10);
	
/*------set internal osc on---------*/
	WriteData(WRCOMM,0x02);
	WriteData(WRCOMM,0x01);
	Delay(10);
	
/*------booster1 on---------------*/
	WriteData(WRCOMM,0x20);
	WriteData(WRCOMM,0x0A);
	Delay(10);   
         
/*------booster1 on---------------*/
	WriteData(WRCOMM,0x26);
	WriteData(WRCOMM,0x01);
        Delay(10);    

/*------booster1 on and amp on---------*/
	WriteData(WRCOMM,0x26);
	WriteData(WRCOMM,0x09);
	 Delay(10);  

/*------booster2 on-------------*/
	WriteData(WRCOMM,0x26);
	WriteData(WRCOMM,0x0b);
	Delay(10);         

/*------booster3 on-------------*/
	WriteData(WRCOMM,0x26);
	WriteData(WRCOMM,0x0f);
	Delay(10);

/*------temp compsation ratio -0.05%------*/
	WriteData(WRCOMM,0x28);
	WriteData(WRCOMM,0x01);
	
/*------ram skip area set no skip------*/
	WriteData(WRCOMM,0x45);
	WriteData(WRCOMM,0x00);

/*------normal display---------*/
	WriteData(WRCOMM,0x53);
	WriteData(WRCOMM,0x00);

/*------set sdir=0,duty=1/162 swap=0-----*/
	WriteData(WRCOMM,0x10);
	WriteData(WRCOMM,0x21);		//RGB//0x23

/*------set clock fpck=fose/32(Normal)/fpck=fose/16(partial1)-------*/
	WriteData(WRCOMM,0x24);
	WriteData(WRCOMM,0x11);

/*------GSM=00:65K color,DSG=0,SGF=0,SGP=01,SGM=0-----*/
	WriteData(WRCOMM,0x30);
	WriteData(WRCOMM,0x02);//09

/*------row vector type=Diagonal ,INC=111-----*/
	WriteData(WRCOMM,0x32);
	WriteData(WRCOMM,0x0E);//0e

/*------entry mode set : x addr increce, read modify write off--*/
	WriteData(WRCOMM,0x40);
	WriteData(WRCOMM,0x00);

/*------y address set from 00 to 127--------*/
	WriteData(WRCOMM,0x43);
	WriteData(WRCOMM,0x00);
	WriteData(WRCOMM,0x7F);		

/*------x address set from 00 to 159--------*/
	WriteData(WRCOMM,0x42);
	WriteData(WRCOMM,0x00);
	WriteData(WRCOMM,0x9F);		

/*------frame set FIM=ON,FIP=1FRAME,N-BLOCK=9-----*/
	WriteData(WRCOMM,0x34);
	WriteData(WRCOMM,0x89);//cd

/*------contrast1 set v1 to 3.757v  max=4v----0x2A,CTRL1*/
	WriteData(WRCOMM,0x2a);
	WriteData(WRCOMM,0xBB);		/*partial display mode 0*/
	
/*------contrast2 set v1 to 3.757v  max=4v--------*/
	WriteData(WRCOMM,0x2b);
	WriteData(WRCOMM,0x20);		/*partial display mode 1*/
	Delay(10);

/*------bias set to 1/5 --------*/
	WriteData(WRCOMM,0x22);
	WriteData(WRCOMM,0x11);

/*------partial display mode off-------*/
	WriteData(WRCOMM,0x55);
	WriteData(WRCOMM,0x00);
	
/*------Low frequency set off-------*/
	WriteData(WRCOMM,0x36);
	WriteData(WRCOMM,0x00);
	
/*-------Scrol lstart line Set-------*/
	WriteData(WRCOMM,0x5A);
	WriteData(WRCOMM,0x00);


/*------display on set--------*/
	Delay(20);
	WriteData(WRCOMM,0x51);	


//-----------------------------------------------------------------------------------//
//-----------------------------Initial Code End--------------------------------------//
//-----------------------------------------------------------------------------------//
}




void SETWINDOWS(unsigned char StartX,unsigned char EndX,unsigned int StartY,unsigned int EndY)
{
/*
Sub Name  : SETWINDOWS StartX:X_Add_S;EndX:X_Add_E;StartY:Y_Add_S;EndY:Y_Add_E;
Function  : SET Display Windows
            8-bit parallel interface with 8080-series 
Input     : None
            
OutPut    : None
*/   

		  WriteData(WRCOMM,0x43);		  
		  WriteData(WRCOMM,StartX);		 
		  WriteData(WRCOMM,EndX);		
		        
      WriteData(WRCOMM,0x42);      
		  WriteData(WRCOMM,StartY);	  		
		  WriteData(WRCOMM,EndY);			
}

⌨️ 快捷键说明

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