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

📄 5110.i

📁 诺基亚5110 LCD资料
💻 I
📖 第 1 页 / 共 2 页
字号:
    { 0x00, 0x04, 0x3F, 0x44, 0x40, 0x20 },   // t	 84
    { 0x00, 0x3C, 0x40, 0x40, 0x20, 0x7C },   // u	 85
    { 0x00, 0x1C, 0x20, 0x40, 0x20, 0x1C },   // v	 86
    { 0x00, 0x3C, 0x40, 0x30, 0x40, 0x3C },   // w	 87
    { 0x00, 0x44, 0x28, 0x10, 0x28, 0x44 },   // x	 88
    { 0x00, 0x1C, 0xA0, 0xA0, 0xA0, 0x7C },   // y	 89
    { 0x00, 0x44, 0x64, 0x54, 0x4C, 0x44 },   // z	 90
    { 0x14, 0x14, 0x14, 0x14, 0x14, 0x14 }    // horiz lines 91
};	
 flash unsigned char  chineseTab[5][32] = {
{0x00,0xFE,0x22,0x22,0xFE,0x00,0x40,0x48,0xC8,0x09,0xFA,0xE4,0x40,0x20,0x10,0x00,0x80,0x7F,0x02,0x82,0xFF,0x20,0x10,0x0C,0x43,0x80,0x7F,0x00,0x07,0x18,0x20,0x00},/*"脉",0*/

{0x10,0x10,0x10,0xFF,0x10,0x90,0x04,0xF4,0x54,0x54,0xFF,0x54,0x55,0xF6,0x04,0x00,0x04,0x44,0x82,0x7F,0x01,0x00,0x08,0x0B,0x19,0x69,0x0B,0x89,0xFD,0x0B,0x08,0x00},/*"搏",1*/

{0x10,0x60,0x02,0x8C,0x00,0xFE,0x02,0xF2,0x02,0xFE,0x00,0xF8,0x00,0xFF,0x00,0x00,0x04,0x04,0x7E,0x01,0x80,0x47,0x30,0x0F,0x10,0x27,0x00,0x47,0x80,0x7F,0x00,0x00},/*"测",2*/

{0x20,0x20,0x20,0xBE,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xBE,0x20,0x20,0x20,0x00,0x00,0x80,0x80,0xAF,0xAA,0xAA,0xAA,0xFF,0xAA,0xAA,0xAA,0xAF,0x80,0x80,0x00,0x00},/*"量",3*/

{0x00,0x80,0x60,0xF8,0x07,0x00,0x1C,0xE0,0x01,0x06,0x00,0xE0,0x1E,0x00,0x00,0x00,0x01,0x00,0x00,0xFF,0x00,0x80,0x40,0x20,0x13,0x0C,0x13,0x20,0x40,0x80,0x80,0x00}/*"仪",4*/

};

flash unsigned char bmpTab[] =
{
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xC0,0xE0,0xF0,0xF8,0xB8,0xB8,0xF8,
0xF0,0xE0,0x80,0x80,0x80,0x80,0x00,0xE0,0xF0,0x98,0x08,0x08,0xB8,0xB0,0x80,0x80,
0x80,0x00,0xF8,0xF8,0xF8,0xC0,0x00,0xF8,0xF8,0x00,0x80,0x80,0x00,0x00,0xE0,0xF8,
0xF8,0xF8,0x00,0x80,0x80,0x80,0x00,0xF8,0xF8,0x80,0xC0,0xF0,0x38,0x88,0x80,0x80,
0x00,0xF8,0xF8,0x08,0x08,0x08,0x08,0x00,0x80,0x00,0x00,0x00,0x80,0xC0,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x07,0x0F,0x1F,0x3F,
0x7F,0x77,0x77,0x7F,0x3F,0x1F,0x07,0x07,0x07,0x07,0x17,0x76,0x65,0x45,0x43,0x7E,
0x3E,0x01,0x0F,0x0F,0x07,0x78,0x7F,0x07,0x03,0x1F,0x7C,0x7F,0x07,0x08,0x0F,0x67,
0x78,0x1F,0x07,0x04,0x07,0x7F,0x7C,0x03,0x0F,0x07,0x78,0x7F,0x07,0x03,0x0F,0x7F,
0x70,0x0F,0x0F,0x07,0x78,0x7F,0x47,0x41,0x41,0x41,0x01,0x00,0x0F,0x07,0x03,0x03
};
//#define   SEI   SREG|=0x80
void Initial5110(void);
void Clean(void);      
void PrintChar(unsigned char c);
void SetAddress(unsigned char x, unsigned char y);
void WriteByte(unsigned char datas, unsigned char command);
void PrintString(unsigned char x,unsigned char y,char *pString);
void PrintChinese(unsigned char x, unsigned char y);
void PrintBmp(unsigned char x, unsigned char y);
void Delayms(unsigned int ms);                 

void Delayms(unsigned int ms)                 
{
   unsigned char  i;
   while (ms--)
   {
   		for (i=0; i<125; i++);
   }
  
}

/*初始化函数*/
void Initial5110(void)
{
	DDRC = 0XFF;
	PORTC = 0XFF;
    DDRB = 0XFF;
	PORTB = 0XFF;
	DDRD = 0XFF;
	PORTD = 0XFF;
	
	
	PORTC.4 = 0;			 // 低电平,LCD复位
    Delayms(20);
    PORTC.4 = 1;			  // 关闭LCD
    PORTC.5		 = 0;				  
   /*Delayms(TIME);
	CE = 1;		        // 使能LCD     */
		   	
    Delayms(20);
	WriteByte(0x21, 0);	// 扩展命令
    WriteByte(0xc8, 0);	// 设置偏置电压
    WriteByte(0x06, 0);	// 温度校正
    WriteByte(0x13, 0);	// 1:48    
    
    
    WriteByte(0x20, 0);	// 使用基本命令
    Clean();	        // 清屏
    WriteByte(0x0c, 0);	// 设定显示模式,正常显示
    PORTC.5		 = 0;				 // 关闭LCD
}

/*清屏函数*/
void Clean(void)
{
	unsigned int i;
    WriteByte(0x0c, 0);			
    WriteByte(0x80, 0);			
	for (i=0; i<504; i++)
	{
		 WriteByte(0, 1);
	}  			
}


/*写字节函数*/
void WriteByte(unsigned char datas, unsigned char command)
{
	unsigned char i;
    PORTC.5		 = 0;
    if (command == 0)
    {
     	PORTC .3	 = 0;
	}
    else
    {
    	 PORTC .3	 = 1;
	}
	for(i=0;i<8;i++)
	{
		if (datas&0x80)
		{
			PORTC.2 = 1;
		}
		else		
		{
		 	PORTC.2 = 0;
		}			
		PORTC.1		 = 0;
		datas = datas << 1;
		PORTC.1		 = 1;
	}
  	PORTC.5		 = 1;
}

/*设置坐标函数*/
void SetAddress(unsigned char x, unsigned char y)
{
    WriteByte(0x40 | y, 0);		
    WriteByte(0x80 | x, 0);          	
}

/*输出字符函数*/ 
void PrintChar(unsigned char character)
{
	unsigned char line; 
	character -= 32;
	for (line=0; line<6; line++)
	{
		WriteByte(characterTab[character][line], 1);
	}
    
} 

/*输出字符串函数*/
void PrintString(unsigned char x, unsigned char y, char *pString)
{
    SetAddress(x, y);
    while (*pString) 
    {
	 	PrintChar(*pString);
	 	pString++;
    }
}  
             
/*写汉字函数*/
void PrintChinese(unsigned char x, unsigned char y)
{
	unsigned char i, j;
	
		for (j=0; j<sizeof(chineseTab)/32; j++)
	{
		for (i=0; i<32; i++)				   //0~11写汉字上半部分,12~23写下半部分
		{ 
			SetAddress(x+16*j+i%16, y+ i/16);	
		 	WriteByte(chineseTab[j][i], 1);
		}
	}	
}  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
/*画图程序*/
void PrintBmp(unsigned char x, unsigned char y)
{
	unsigned char  j;
	for (j=0; j<sizeof(bmpTab); j++)
	{
		SetAddress(x+j%84	, y+j/84	);	
		WriteByte(bmpTab[j], 1);		
	}	
} 

⌨️ 快捷键说明

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