ssd0323.c

来自「这个是用来控制以ssd0323为主控芯片的显示屏的程序。在这个程序是以串行接口控」· C语言 代码 · 共 444 行 · 第 1/3 页

C
444
字号
}
void power_off(void)
{
 command_out1(0xAE);  //display off
 delayms(10);
 command_out1(0xAD);  //DC/DC CONVERTER DISABLE
 command_out2(0x02);
 delayms(10);
}
void LCD_init(void)
{
 //power_off();
	command_out1(0xB3);//SET DISPLAY CLOCK/OSCILLATOR FREPUENCY
	command_out2(0xf1);//02
	delayms(5);

	command_out1(0xAD);//SET DC/DC CONVERTER
	command_out2(0x02);
	delayms(5);

	command_out1(0x81);//SET CONTRAST CONTROL REGISTER
	command_out2(10);
	delayms(5);

	command_out1(0x86);//SET CURRENT RANGE//86
	delayms(5);

	command_out1(0xBE);//SET VCOMH VOLTAGE
	command_out2(0x11);//11//0d
	delayms(5);

	command_out1(0xBC);//SET PRECHARGE VOLTAGE 
	command_out2(0xff);//ff
	delayms(5);

// ===============================   control bright
	command_out1(0xA8);//SET MULTIPLEX RATIO
	command_out2(0x4f);
	delayms(5);

	command_out1(0xB1);//SET PHASE LENGTH
 	command_out2(0x53);
 	delayms(5);


 	command_out1(0xB2);//SET ROW PERIOD
 	command_out2(0x25);//25
 	delayms(5);
//=======================================

 	command_out2(0xA4);//SET DISPLAY MODE
 	delayms(5);

 	command_out1(0xA1);//SET DISPLAY START LINE
 	command_out2(0x00);
 	delayms(5);

 	command_out1(0xA0);//SET RE-MAP
 	command_out2(0x00);//50
 	delayms(5);

 
	command_out1(0x15);//SET COLUMN ADDRESS
 	command_out2(0x00);
 	command_out2(39);
 	delayms(5);

 	command_out1(0x75);//SET ROW ADDRESS
 	command_out2(0x00);//10
 	command_out2(47);
 	delayms(5);


 	command_out1(0xA2);//SET DISPLAY OFFSET
 	command_out2(28);//00
 	delayms(10);

 	command_out1(0xAF);//SET DISPLAY ON/OFF

}


void clr(void)
{
int i;
for(i=0; i<1920; i++)
    data_out_char(0x00);
}
void all_on(void)
{
	unsigned char row, col;
	
	for(row=0 ; row<MAX_row ; row++)
		for(col=0 ; col<MAX_col ; col++)
		 	data_out_char(0xff);
}
        

void WriteNull()
{
int i;
   for(i=0; i<8; i++ )
   {   
        
       SCLK=0;
       delayms(5);
       SCLK=1;
      
   }

 }



void main(void)
{
	unsigned char step;
	int i;
	
	unsigned char mask;

	system_init();
	LCD_init();
ss:
for(i=0;i<1920;i++){

   data_out_char(pic[i]);
	}
delay(200);

for(i=0;i<1920;i++){
    data_out_char(pic2[i]);
}
delay(200);

for(i=0;i<1920;i++){
data_out_char(pic3[i]);
}
delay(200);

goto ss;

	

	
}

⌨️ 快捷键说明

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