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

📄 g240128.c

📁 一个240128 控制芯片t6963c的显示图像和汉字的C语言源码
💻 C
📖 第 1 页 / 共 2 页
字号:
{"ing auxiliary services such as"},{"cleaning air-conditioning,high"},
{"purified water station,high ai"},{"r-pressure station etc.,and mo"},
{"re important,we have a coopera"},{"tive,responsible,high level an"},
{"d high efficiency R&D team and"},{"staff.                        "},
{" BLUEMOON DISPLAY specializes "},{"in producing TN,HTN,STN,FSTN-L"},
{"CD panels and LCD modules,owni"},{"ng a variety of LCD modules,al"},
{"phanumeric,character and graph"},{"ic,offering lots of standard o"},
{"f LCD panels and LCD modules t"},{"o choose from and we also deve"},
{"lop custom products for your s"},{"pecial need.                  "},
{"         APPLICATION          "},{"Communcation field(telephone,m"},
{"obile phone,interphone,facsimi"},{"le machine,etc.,              "},
{"Instrument & Meters(medical tr"},{"eatment,electron,mechanism,che"},
{"mical technology,motorcar,etc."},{"Family utility(air-condition,r"},
{"adio product remote controller"},{",VCD,DVD,etc.,                "},
{"Calculargraph(watch,clock,tabl"},{"e-board,etc.,                 "},
{"Informative terminal(electroni"},{"cal dictionary,translation mac"},
{"hine,PDA,computer,top grade di"},{"splay panels,etc.,            "},
{"Calculation(calculator,POS,etc"},{"Game machines etc.,           "}
};

void wait(void)
{
 uchar i;
 for(i=0;i<3;i++)
  {;} 
}
void wait1(void)
{
 uchar i,j;
 for(i=0;i<0x2f;i++)
    {for(j=0;j<0xee;j++){;}
     }
}
void busy(uchar n)
{uchar x;
   switch(n){
   case 0:
   do{
      P1=0xff;
      CD2 = 1;
      CE2 = 0;
      WR2 = 1;
      RD2 = 0;
      x=P1;
      RD2 = 1;
      CE2 = 1;
   }while(x & 0x2A!=0x2A);
   break;
   case 1:
   do{
      P1=0xff;
      CD2 = 1;
      CE2 = 0;
      WR2 = 1;
      RD2 = 0;
      x=P1;
      RD2 = 1;
      CE2 = 1;
     }while(x & 0x08!=0x08);
   break;
  }
}
void wr_dat(uchar x)
{
 CD2 = 0;
 P1=x;
 CE2 = 0;
 WR2 = 0;
 RD2 = 1;
 WR2 = 1;
 CE2 = 1;
}

void wr_com(uchar x)
{
 CD2 = 1;
 P1=x; 
 CE2 = 0;
 WR2 = 0;
 RD2 = 1;
 WR2 = 1;
 CE2 = 1;
}

void wr_2com(uchar i,uchar j,uchar cc)
{
   busy(0);
   wr_dat(i);
   busy(0);
   wr_dat(j);
   busy(0);
   wr_com(cc);
}
void wr_1com(uchar i,uchar cc)
{
   busy(0);
   wr_dat(i);
   busy(0);
   wr_com(cc);
}

/* initialize lcd */
void lcd_init(void)
{
    RESET=1;
    RESET=1;
    wr_2com(0x00,0x00,0x40);
    wr_2com(30,0x00,0x41);
    wr_2com(0x00,0x08,0x42);
    wr_2com(30,0x00,0x43);
    busy(0);
    wr_com(0xa7);
    busy(0);
    wr_com(0x80);
    busy(0);
    wr_com(0x9c);
}
void code_clear(void)
{
    uchar w,j;
    wr_2com(0x00,0x00,0x24); 
    busy(0);
    wr_com(0xb0);
    for(w=0;w<16;w++){
       for(j=0;j<30;j++){
       busy(1);
       wr_dat(0x00);
       }
    }
    busy(1);
    wr_com(0xb2);
}

void graph_clear(void)
{
    uchar w,j;
    busy(1);
    wr_com(0xb2);
    wr_2com(0x00,0x08,0x24); 
    busy(0);
    wr_com(0xb0);
    for(w=0;w<128;w++){
    for(j=0;j<30;j++){
       busy(1);
       wr_dat(0x00);
       }
    }
    busy(1);
    wr_com(0xb2);
}

void wr_point(uchar x,uchar y,uchar cc)
{
    uint i,hb,la;
    i=y*30+x;
    la=i&0x00ff;
    hb=i&0xff00;
    hb=hb>>8;
    hb=hb+0x08;
    wr_2com(la,hb,0x24);
    wr_1com(cc,0xc4);
}

void wr_code(uchar x,uchar y,uchar cc)
{
    uint i,hb,la;
    i=y*30+x;
    la=i&0x00ff;
    hb=i&0xff00;
    hb=hb>>8;
    wr_2com(la,hb,0x24);
    cc=cc-0x20;
    wr_1com(cc,0xc4);
}
/****************** write code test LCD ******************************/


/****************main program*********************************/
void main()
{
    uchar hx,hy,dx,dy,gx,gy;
    uint dat;
    while(1){
    FS=1;
    dat=0;
    lcd_init();
    code_clear();
    graph_clear(); 
    
   
    
 /*===================================================*/   
     for(hx=0;hx<128;hx++)
      {for(hy=0;hy<30;hy++) 
        {dx=hy;dy=hx;
        	
         wr_point(dx,dy,Bmp2[dat++]);
        
        }
    }


/*for(;;)*/{
   wait1();wait1();wait1();
   wait1();wait1();wait1();
   wait1();wait1();wait1();
   wait1();wait1();wait1();
   wait1();wait1();wait1();
   wait1();wait1();wait1();
   wait1();wait1();wait1();
   wait1();wait1();wait1();
   wait1();wait1();wait1();
   wait1();wait1();wait1();
   wait1();wait1();wait1();
   wait1();wait1();wait1();
   wait1();wait1();wait1();
   wait1();wait1();wait1();
   wait1();wait1();wait1();
   wait1();wait1();wait1();
   wait1();wait1();wait1();
  

   busy(0);
   wr_com(0x94);
   code_clear();
   graph_clear();
        for(gy=0;gy<16;gy++)
        {
          for(gx=0;gx<30;gx++)
           {
          wr_code(gx,gy,text2[gy][gx]);
          wait1(); 
           }
       }
   for(dy=1;dy<33;dy++)
   {
     for(gy=0;gy<15;gy++)
        {
          for(gx=0;gx<30;gx++)
           {
          wr_code(gx,gy,text2[gy+dy][gx]);
           }
         }
          for(gx=0;gx<30;gx++)
           {
          wr_code(gx,15,' ');
           }
      for(gx=0;gx<30;gx++)
           {
          wr_code(gx,15,text2[15+dy][gx]);
        wait1();
           }
      }

 wait1();wait1();wait1();wait1();wait1();wait1();
 wait1();wait1();wait1();wait1();wait1();wait1();
 wait1();wait1();wait1();wait1();wait1();wait1();
 wait1();wait1();wait1();wait1();wait1();wait1();
 } 
 }
 }

⌨️ 快捷键说明

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