Ejemplo n.º 1
0
void LCD_dischar0811(unsigned char __flash * dis_datas, unsigned char x, unsigned char y,unsigned char Reverse_flag)
{
	unsigned char i,j;
	j=0;
	for (j=0;j<11;j++)
	{
		LCD_wr_command(0x70+(y+j)/16);  //set row MSB address
		LCD_wr_command(0x60+(y+j)%16);  //set row LSB address
		LCD_wr_command(0x12+(x+5)/16);  //set column MSB address  //    12
		LCD_wr_command(0x00+(x+5)%16);   //set column LSB address  //37  05
        
		LCD_disdatatrans(*(dis_datas+j));	
		for(i=0;i<4;i++)
		{
		    if(Reverse_flag == 1)
				    LCD_wr_data(~Lcd_dis_data[i]);
		    else
			LCD_wr_data(Lcd_dis_data[i]);            
		}

		if(Reverse_flag)
			LCD_wr_data(255);
		else
			LCD_wr_data(0);
	}
}
Ejemplo n.º 2
0
//ÏÔʾ1¸ö×Ö·ûÐÂ×ø±ê±í·¶Î§0~159  y×ø±ê·¶Î§0~159
unsigned char LCD_dischar(unsigned char c, unsigned char x, unsigned char y, unsigned char Reverse_flag)
{
	unsigned char i,j,k;
	j=0;
	FONT_CHARINFO a=FontTrebuchetMS16_CharInfo[c-0x20];
	for (j=0;j<16;j++)
	{
		LCD_wr_command(0x70+(y+j)/16);  //set row MSB address
		LCD_wr_command(0x60+(y+j)%16);  //set row LSB address
		
		LCD_wr_command(0x12+(x/3+5)/16);  //set column MSB address  //    12
		LCD_wr_command(0x00+(x/3+5)%16);   //set column LSB address  //37  05

		k=datatrans(ASC[c-0x20]+j*a.bytes,a.bytes,a.distance,x);	

		for(i=0;i<k;i++)
		{
		    if(Reverse_flag == 1)
			LCD_wr_data(~Lcd_dis_data[i]);
		    else
			LCD_wr_data(Lcd_dis_data[i]);
		}
		LCD_wr_data(0);
	}
	return (FontTrebuchetMS16_CharInfo[c-0x20].distance+1);
}
Ejemplo n.º 3
0
void LCD_display_single_line(unsigned char y)
{
	unsigned char i;
	LCD_wr_command(0x70+(y/16));  //set row MSB address
	LCD_wr_command(0x60+(y%16));  //set row LSB address
	LCD_wr_command(0x12);  //set column MSB address  //    12
	LCD_wr_command(0x05);  //set column LSB address  //37  05
	for(i=0;i<80;i++)
	{
			LCD_wr_data(0xff);
	}
	LCD_wr_data(0x00);
}
Ejemplo n.º 4
0
void LCD_wr_string(char d_line, char *lcd_str) {
	LCD_wr_cmd(d_line);
	
	while(*lcd_str != '\0') {
		LCD_wr_data(*lcd_str);
		lcd_str++;
	}
}
Ejemplo n.º 5
0
void LCD_dischar88 (unsigned char *dis_datas, unsigned char x, unsigned char y)
{
unsigned char j,i;
j=0;
for (j=0;j<8;j++)
{
	LCD_wr_command(0x70+((y+j)/16));  //set row MSB address
	LCD_wr_command(0x60+((y+j)%16));  //set row LSB address
	LCD_wr_command(0x12+((x+5)/16));  //set column MSB address  //    12
	LCD_wr_command((0x05+x)%16);  //set column LSB address  //37  05
	LCD_disdatatrans(*(dis_datas+j));	
	{
	for(i=0;i<4;i++)
	LCD_wr_data(Lcd_dis_data[i]);
	}
	LCD_wr_data(0);
}
}
Ejemplo n.º 6
0
void LCD_Clr()
{
	unsigned char i,j;
	LCD_RAM_ADDRESS();
	for(i=0;i<160;i++)
	{
		for(j=0;j<82;j++)
			LCD_wr_data(0x00);
	}
}
Ejemplo n.º 7
0
/**************************************************************
*    name: 		LCD_dischar1616
*    function: 	display a 16*16 leble
*	 input:		16*16 lebel display, x and y coordinates
*	 return:	none
*
***************************************************************/
void LCD_dischar1616(unsigned char __flash * dis_datas, unsigned char x, unsigned char y)
{
    unsigned char i,j,k;
    j=0;
    for (j=0;j<16;j++)
    {
        LCD_wr_command(0x70+(y+j)/16);  //set row MSB address
        LCD_wr_command(0x60+(y+j)%16);  //set row LSB address
        LCD_wr_command(0x12+(x+5)/16);  //set column MSB address  //    12
        LCD_wr_command(0x00+(x+5)%16);  //set column LSB address  //37  05
        for(k=0;k<2;k++)
        {
            LCD_disdatatrans(*(dis_datas+k+2*j));	
            {
                for(i=0;i<4;i++)
                LCD_wr_data(Lcd_dis_data[i]);
            }
        }
        LCD_wr_data(0);
    }
}
Ejemplo n.º 8
0
void LCD_display_datas(unsigned char datas)    //R-G-B=4-4-4
{
	unsigned int i,j;
	
	LCD_RAM_ADDRESS();
	
	for(i=0;i<160;i++)
	{
    for(j=0;j<81;j++)
      LCD_wr_data(datas);
	}
 }
Ejemplo n.º 9
0
void WRITE16X16(unsigned char low,unsigned char high,unsigned char datas)
{ unsigned char i,j;
  LCD_RAM_ADDRESS();
  for (i=0;i<high;i++)
	{
	 for(j=0;j<81;j++)
	 LCD_wr_data(0x00);
	}
  for (i=0;i<16;i++)
        {
	 for(j=0;j<low;j++)
	 LCD_wr_data(0x00);
	 for(j=0;j<8;j++)
	 LCD_wr_data(datas);
	 for(j=0;j<81-8-low;j++)
	 LCD_wr_data(0x00);
	}
  for (i=0;i<160-16-high;i++)
        {
	 for(j=0;j<81;j++)
	 LCD_wr_data(0x00);
	}
}
Ejemplo n.º 10
0
///////////////////////////////////////////////////////////////////////////////////////////////////////
//ÏÔʾ1¸ö×Ö·û´®£¬x×ø±ê·¶Î§0~159  y×ø±ê·¶Î§0~159
void LCD_disstr_V3(unsigned char *str, unsigned char x, unsigned char y, unsigned char Reverse_flag)
{
	unsigned char i=0,j=0,k=0,c=0,number=0,flag=0,width=0;
	unsigned char data1,data2,move=0;
	unsigned int data16=0;
	while(*(str+number)!='\0')
		{
		number++;
		}
	for(i=0;i<16;i++)
	{
		LCD_wr_command(0x70+(y+i)/16);  //set row MSB address
		LCD_wr_command(0x60+(y+i)%16);  //set row LSB address
		
		LCD_wr_command(0x12+(x/3+5)/16);  //set column MSB address  //    12
		LCD_wr_command(0x00+(x/3+5)%16);   //set column LSB address  //37  05
		flag=0;
		move=0;
		for(j=0;j<number;j++)
		{	
			c=*(str+j);
			
			width=FontTrebuchetMS16_CharInfo[c-0x20].distance;
			
			if(FontTrebuchetMS16_CharInfo[c-0x20].bytes==2)
			{	data1=ASC[c-0x20][i*2];
				data2=ASC[c-0x20][i*2+1];
			}
			else
			{
				data1=ASC[c-0x20][i];
				data2=0;
			}
			data16=data1*256+data2;
			
			if (j==0)
				move=x%3;
			else
				move=0;
			if(GetBit(flag,0))
				move++;
			width+=move;
			data16=data16>>move;
			if(GetBit(flag,1))
				data16|=8000;
			flag=0;

			for(k=0;k<(width-width%2)/2;k++)
			{	
				if ((data16&0x8000)==0)
				{
					Lcd_dis_data[0]=0;
				}
				else
				{
					Lcd_dis_data[0]=0xF0;
				}
				data16= data16<<1;
				if ((data16&0x8000)!=0)
				{
					Lcd_dis_data[0]|=0x0F;
				}
				data16= data16<<1;
				if(Reverse_flag)
					LCD_wr_data(~Lcd_dis_data[0]);
				else
					LCD_wr_data(Lcd_dis_data[0]);
			}
			if((width%2)==1)
			{
				if((data16&0x8000)!=0)
					flag=3;
				else
					flag=1;
			}
		}
		if(Reverse_flag)
		LCD_wr_data(0xFF);
		else
				LCD_wr_data(0);

	}
}