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

📄 display_drive.h

📁 嵌入式单片机开发,嵌入式单片机开发,嵌入式单片机开发
💻 H
📖 第 1 页 / 共 2 页
字号:


/* 8 number ziku */
const unsigned char display_table[]={0xfa,0xa,0xbc,0x9e,0x4e,0xd6,0xf6,0x8a,0xfe,0xde,
                       					  0x36,0xec,0xce,0x76,0x6e,0x24,0xf4,0x70,0xe4,0x3e,00,0x26,0x34,0xee,0x4};  //0,1,2,3,4,5,6,7,8,9,o,p,q,b,h,r,e,l,f,d,,kong,n,c,A,-

const unsigned char display_table1[]={0xaf,0xa0,0xcb,0xe9,0xe4,0x6d,0x6f,0xa8,0xef,0xed,
                       					    0x63,0xce,0xec,0x67,0xe6,0x42,0x4f,0x07,0x4e,0xe3,00,0x62,0x43,0xee,0x40};  //0,1,2,3,4,5,6,7,8,9,o,p,q,b,h,r,e,l,f,d,,kong,n,c,A,-


/*jisuan 1---8wei */   
const unsigned char m2_tab[]={0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80};
/*LRAM15 user,seg FGE-->EFG */
const unsigned char efg_tab[]={0,4,2,6,1,5,3,7};



/*LCD  display mode set*/
void lcd_set()
{   
     lcdm=0x03;
     seg=0x00;   // set lcd frame frequency
     lcdtim=0x8;   //l4b 0x80
     lcdm=0x8b;  //0b
     //lcdtim=0x4b;   //0x80
     //lcdm=0x0b;  //0b
     seg=0xff; 
}


extern unsigned char powerdown_alllostv_status;
void lcd_display()
{   
    unsigned char l0,l2,l3,l4,i,light;                                      /*L0 ,L2,l3    */
    unsigned char *l1;
    unsigned char da,db,dc,la,lb,lc;
    unsigned int ja,jb,jc,rcurrent_reference_use;
    unsigned char inside_display[8],l,m;
    unsigned char lcopyram16;
    unsigned char quanshiya_light;
    unsigned char g;
light=RSOFT_RTC_SECOND&0x01;// one second light
rcurrent_reference_use=RCURRENT_REFERENCE;
//add 2005-2-23--------------->start
if(RFLAG_POWERDOWN==1)
	if( powerdown_alllostv_status==All_LOSTV_YES)
		{
			if((rcurrent_reference_use==288)||(rcurrent_reference_use==289))//powerdown  all lost v
				{
					for(l0=2;l0<8;l0++)
						DISPLAY_8_NUM[l0]=0;
				}
		}
//add 2005-2-23--------------->end
switch(DISPLAY_4_NUM[0])
     	{
      		case 0xb:	// tao shi duan
               		if(DISPLAY_4_NUM[1]!=5)
               			{               
                       			DISPLAY_8_NUM[0]=CHARMODE_f;
                       			DISPLAY_8_NUM[1]=DISPLAY_8_NUM[3];
                       			DISPLAY_8_NUM[2]=CHARMODE_KONG;
                       			DISPLAY_8_NUM[3]=CHARMODE_KONG;                     
                       	if((2!=testminute((DISPLAY_8_NUM[6]<<4)+DISPLAY_8_NUM[7])
							+testhour((DISPLAY_8_NUM[4]<<4)+DISPLAY_8_NUM[5]))
                          				||(DISPLAY_8_NUM[1]>3))
                         		{
                         			for(l0=0;l0<8;l0++)
                       				DISPLAY_8_NUM[l0]=CHARMODE_KONG;
                       	  		 DISPLAY_8_NUM[8]=0;
                              		 DISPLAY_8_NUM[6]=CHARMODE_n;
                             		 DISPLAY_8_NUM[7]=CHARMODE_o;
                             		 RFLAG_RIGHT_DOT=0;
                       	       }
                       	else
                       		switch(DISPLAY_8_NUM[1])
              	      			{
              	      				case 0x0: 
									RFLAG_JIAN_DISPLAY=1;
									break;
                             			case 0x1: 
									RFLAG_FENG_DISPLAY=1;
									break;
                             			case 0x2: 
									RFLAG_PING_DISPLAY=1;
									break;
                             			case 0x3: 
									RFLAG_GU_DISPLAY=1;
									break;                            
        	              		}
               		}
              
                 		break;
       case 0xc:  // fe he jijia ri                 
                  	DISPLAY_8_NUM[0]=CHAEMODE_p;
                 	 DISPLAY_8_NUM[1]=DISPLAY_8_NUM[3];
                 	 DISPLAY_8_NUM[2]=CHARMODE_KONG;
                  	DISPLAY_8_NUM[3]=CHARMODE_KONG;
                  	l0=1;
                  	if(DISPLAY_8_NUM[1]>5) 
				l0=0;
			if(DISPLAY_8_NUM[1]==0) 
				l0=0;
			if((0==l0)||(2!=testday((DISPLAY_8_NUM[6]<<4)+DISPLAY_8_NUM[7])
						+testmonth((DISPLAY_8_NUM[4]<<4)+DISPLAY_8_NUM[5])))               
                  		{
                  	 		for(l0=0;l0<8;l0++)
                       			DISPLAY_8_NUM[l0]=CHARMODE_KONG;
                      		DISPLAY_8_NUM[8]=0;
                      		DISPLAY_8_NUM[6]=CHARMODE_n;
                      		DISPLAY_8_NUM[7]=CHARMODE_o;
                      		RFLAG_RIGHT_DOT=0;
                  		}
                  break;
      case 0xd: // gon xiu ri B0 11   
                	if((DISPLAY_4_NUM[1]==0)&&(DISPLAY_4_NUM[2]==1)&&(DISPLAY_4_NUM[3]==1))
                		{ 
                			l4=RAM[R_WORKOFFDAY];
                      		DISPLAY_8_NUM[8]=0x7e;   // xiao shu dian
                      		if(RAM[R_WORKOFFDAY_PRICE]<=5)//    j9
                           			DISPLAY_8_NUM[0]=RAM[R_WORKOFFDAY_PRICE];
                      		else 
						DISPLAY_8_NUM[0]=1;//  j9
                     		for(l0=0;l0<7;l0++)
                     			{
                     				if(( m2_tab[6-l0]&l4)==0)
                     	    				DISPLAY_8_NUM[l0+1]=0;
                           			else 
                                			DISPLAY_8_NUM[l0+1]=1;
						}   //     j7-l0;
                	  	}
                 	break;      
 	}
// SHENG GUAN BAO JING  xu hao(3130 3131 3132)
if((rcurrent_reference_use>426)&&(rcurrent_reference_use<433))  
      {
      		l4=(DISPLAY_8_NUM[6]<<4)+(0xf&DISPLAY_8_NUM[7]);
	      for(l0=0;l0<8;l0++)
		    {
		    	if((m2_tab[l0]&l4)==0) 
					DISPLAY_8_NUM[7-l0]=0;
		       else   
			  	DISPLAY_8_NUM[7-l0]=1;
		      }
      }				
//dian chi dian ya changed   wu shi qu 
if(rcurrent_reference_use==260)  // dian chi dian ya 
       {
       	DISPLAY_8_NUM[2]=0;
        	DISPLAY_8_NUM[3]= RCURRENT_TAOSHIDUAN+1;
         	DISPLAY_8_NUM[0]=(current_fuheqi+1)/10;
         	DISPLAY_8_NUM[1]=(current_fuheqi+1)%10;
         	if((RAM[R_NUM_NIANSHIQU]==0)||(ryuyuedisplay_use==1))
         		{
         			DISPLAY_8_NUM[0]=0;
                		DISPLAY_8_NUM[1]=0;
			}
		// changed by zhanglong ---->start
		if(RFLAG_POWERDOWN==1)
			{
			// if powerdown,the voltage of  BAT is  
	         	DISPLAY_8_NUM[4]=0;
	         	DISPLAY_8_NUM[5]=0;
		  	DISPLAY_8_NUM[6]=0;
	         	DISPLAY_8_NUM[7]=0;
			}
		else
			{
			
			DISPLAY_8_NUM[4]=RAM[R_BATTERY_V+1]/16;
	         	DISPLAY_8_NUM[5]=RAM[R_BATTERY_V+1]%16;
		  	DISPLAY_8_NUM[6]=RAM[R_BATTERY_V]/16;
	         	DISPLAY_8_NUM[7]=RAM[R_BATTERY_V]%16;
			}
		// changed by zhanglong ---->end
        }
// add geng ju zhuang tai pan duan xiang
// 36  1  status---yue yue  cuo feng---------------------->start
if(rcurrent_reference_use==261)
      {
      		if(1==ryuyuedisplay_use)
        		DISPLAY_8_NUM[7]=1;
        	else 
        	       DISPLAY_8_NUM[7]=0;
       	 DISPLAY_8_NUM[6]=0;
        	 if(1==status_cuofeng_price) 
			DISPLAY_8_NUM[6]=1;
        }
// 36  1  status---yue yue  cuo feng---------------------->end

// 36 2    非安全认证密码锁定AAAAAAA
if(rcurrent_reference_use==262)
	// changed by zhanglong ---->start
	// mima dengji wei 3ji 
	{
		for(i=0;i<3;i++)		//old is 5
			if((RAM[R_PASSWORD_LOCK_TIME_0+2*i]+256*RAM[R_PASSWORD_LOCK_TIME_0+2*i+1])==0)
				DISPLAY_8_NUM[5+i]=0;	// old is 3
			else 
				DISPLAY_8_NUM[5+i]=1;	// old is 3
	  	DISPLAY_8_NUM[0]=CHARMODE_KONG;
	  	DISPLAY_8_NUM[1]=CHARMODE_KONG;
	  	DISPLAY_8_NUM[2]=CHARMODE_KONG;
	  	DISPLAY_8_NUM[3]=CHARMODE_KONG; 	// add
	  	DISPLAY_8_NUM[4]=CHARMODE_KONG; 	// add 
	  	DISPLAY_8_NUM[8]=0x06;				// xiaoshudian
        }
	// changed by zhanglong ---->end
//------------------------------------->
   //dianliang xuliang shi neng              	
 if(rcurrent_reference_use==456)
 	{
 	// changed by zhanglong ---->start
 		data_addr.addri=2;
         	read(ROM,8);
	  	for(i=0;i<8;i++)
	  		DISPLAY_8_NUM[7-i]=wr_data[i];
	// changed by zhanglong ---->end
	  	DISPLAY_8_NUM[8]=0x7e;	  
 	}
     	   
   //  XU HAO TIAO ZHENG
//    0------------->
switch(rcurrent_reference_use)
	{
		case 0: 
				DISPLAY_4_NUM[1]=CHARMODE_f;// d3
             			break;
  		case 1: 
				DISPLAY_4_NUM[3]=CHARMODE_h;
             			break;
  		case 2: 
				DISPLAY_4_NUM[3]=CHARMODE_l;
             			break;    
  		case 3: 
				DISPLAY_4_NUM[3]=CHARMODE_h;
             			break;
  		case 4: 
				DISPLAY_4_NUM[3]=CHARMODE_l;
             			break;
  		case 5: 
				DISPLAY_4_NUM[3]=CHARMODE_h;
             			break;
  		case 6: 
				DISPLAY_4_NUM[3]=CHARMODE_l;
             			break;
 
 // 133  shang xian wu gong  do in  displaymode   set lcd buffer from reference()  
 // 1141 chang shu  do   set lcd buffer from reference()  
//  AA关于相别指示的特别处理AAAAA----------->START
  		case 293+1:
  		case 300+1:
  		case 307+1:
  		case 314+1:
  		case 321+1: 
  	         		i=DISPLAY_8_NUM[7];
  	         		DISPLAY_8_NUM[7]=0x1&i;
  	         		DISPLAY_8_NUM[6]=(0x2&i)>1;
  	         		DISPLAY_8_NUM[5]=(0x4&i)>>2;
  	         		break;

//  AA关于相别指示的特别处理AAAAA----------->end

    }    
//  display   100%  o000-------->A000  
 if(DISPLAY_8_NUM[4]==10)
     DISPLAY_8_NUM[4]=CHARMODE_A;// moniter  100%
 /*************************************************************/
for(l=0;l<8;l++)
	inside_display[l]=0xef&display_table1[DISPLAY_8_NUM[l]];
if((0x8&DISPLAY_4_NUM[4])==0x8) 
	inside_display[7]=inside_display[7]|0x10;// gang
if(1==RFLAG_STATUS_BATTERY) 
	inside_display[0]=inside_display[0]|0x10;// battery
for(l=1;l<7;l++)
	if((DISPLAY_8_NUM[8]&m2_tab[7-l])!=0)
	       inside_display[l]=inside_display[l]|0x10;
lram6=inside_display[0];
lram7=inside_display[1];
lram8=inside_display[2];
lram9=inside_display[3];
lram12=inside_display[4];
lram13=inside_display[5];
lram14=inside_display[6];
lram15=inside_display[7];
for(l=0;l<4;l++)
	inside_display[l]=0xfe&display_table[DISPLAY_4_NUM[l]];
i=0;
if(0==RFLAG_B_A_KU)// a ku
   	{
   		i=0;
         	if(RLCD_DISPLAY_STATUS==DISPLAY_AUTO)
         	  	if(1==RFLAG_DISPLAY_AUTO_SET)
         	  		i=1;
         	if(RLCD_DISPLAY_STATUS==DISPLAY_KEY)
         	 	if(1==RFLAG_DISPLAY_KEY_SET)
         	 		i=1;
         	if(i==1)
         		{
         			inside_display[0]=0xfe&display_table[CHARMODE_KONG];
                		inside_display[1]=0xfe&display_table[displaynum_auto_key/100];
                		inside_display[2]=0xfe&display_table[(displaynum_auto_key%100)/10];

⌨️ 快捷键说明

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