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

📄 lgdp4523.lst

📁 单片机点屏。驱动LG4523程序。TFT2。0的LCM驱动程序
💻 LST
字号:
C51 COMPILER V7.06   LGDP4523                                                              02/21/2009 19:10:11 PAGE 1   


C51 COMPILER V7.06, COMPILATION OF MODULE LGDP4523
OBJECT MODULE PLACED IN LGDP4523.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE LGDP4523.c BROWSE DEBUG OBJECTEXTEND

stmt level    source

   1          /************************************************
   2          dots            176*220
   3          controller      LGDP4523
   4          interface       8080/16bits   P1-L,P0-H
   5          ************************************************/
   6          #include <absacc.h>
   7          #include <reg51.h>
   8          #define uchar unsigned char
   9          #define uint unsigned int
  10          //#define p0XBYTE[0x0000]
  11          
  12          sbit cs         =P3^5;
  13          sbit res        =P3^4;
  14          sbit rs         =P2^3;
  15          sbit wr         =P2^2;
  16          sbit uc4    =P2^7;
  17          sbit uc6    =P2^5;
  18          sbit step= P2^0;
  19          
  20          #define         HSIZE           176
  21          #define         VSIZE           220
  22          void dis_bar();
  23          void pause();
  24          void display_image(void);
  25          
  26          
  27          unsigned char code image[]= {
  28          
  29          0x12,
  30          };
  31          
  32          
  33          void delay(uint t)
  34          {
  35   1              uchar t1;
  36   1              while(t--)
  37   1              for(t1=16;t1>0;t1--) //16
  38   1              {;}  //0.1ms
  39   1      }
  40          
  41          
  42          
  43          void write_data(uchar data_h,data_l)
  44          {
  45   1       uc4=0;
  46   1       uc6=0;
  47   1       cs=0;
  48   1       rs=1;
  49   1       P0=data_h;
  50   1       P1=data_l;
  51   1       wr=0;
  52   1       wr=1;
  53   1       cs=1;
  54   1      
  55   1       }
C51 COMPILER V7.06   LGDP4523                                                              02/21/2009 19:10:11 PAGE 2   

  56          
  57          
  58          /*void write_command1(uchar datac)
  59          {
  60           uc4=0;
  61           uc6=0;
  62           cs=0;
  63           rs=0;
  64           P1=datac;
  65           wr=0;
  66           wr=1;
  67           cs=1;
  68          
  69          }*/
  70          void write_command(uchar dd)
  71          {
  72   1       uc4=0;
  73   1       uc6=0;
  74   1       cs=0;
  75   1       rs=0;
  76   1       //rd=1;
  77   1       //P0=0x00;
  78   1       //P0=dd;
  79   1       P1=dd;
  80   1       wr=0;
  81   1       //delay(0);
  82   1       wr=1;
  83   1       cs=1;
  84   1      
  85   1       }
  86          
  87          void initialization()
  88          {
  89   1      //int p,p1,p2;
  90   1      res=0;
  91   1      delay(350);
  92   1      res=1;
  93   1      delay(150);
  94   1      //*********************Initial code******************************
  95   1      write_command(0x07);write_data(0x00,0x00);
  96   1      write_command(0x12);write_data(0x00,0x00);
  97   1      write_command(0x13);write_data(0x00,0x00);
  98   1      write_command(0x14);write_data(0x01,0x00);
  99   1      delay(50);
 100   1      write_command(0x11);write_data(0x00,0x00);
 101   1      write_command(0x12);write_data(0x00,0x08);
 102   1      write_command(0x13);write_data(0x0D,0x51);
 103   1      delay(50);
 104   1      write_command(0x10);write_data(0x01,0x34);
 105   1      write_command(0x11);write_data(0x14,0x40);
 106   1      write_command(0x12);write_data(0x00,0x18);
 107   1      delay(50);
 108   1      write_command(0x10);write_data(0x41,0x30);
 109   1      write_command(0x13);write_data(0x30,0x48);
 110   1      delay(50);
 111   1      write_command(0x00);write_data(0x00,0x01);
 112   1      write_command(0x01);write_data(0x01,0x1B);
 113   1      write_command(0x02);write_data(0x07,0x00);
 114   1      write_command(0x03);write_data(0x10,0x30);
 115   1      write_command(0x04);write_data(0x00,0x00);
 116   1      write_command(0x08);write_data(0x08,0x08);
 117   1      write_command(0x09);write_data(0x00,0x00);
C51 COMPILER V7.06   LGDP4523                                                              02/21/2009 19:10:11 PAGE 3   

 118   1      write_command(0x0B);write_data(0x5C,0x38);
 119   1      write_command(0x0C);write_data(0x00,0x01);
 120   1      write_command(0x14);write_data(0x01,0x20);
 121   1      write_command(0x21);write_data(0x00,0x00);
 122   1      write_command(0x30);write_data(0x00,0x00);
 123   1      write_command(0x31);write_data(0x03,0x07);
 124   1      write_command(0x32);write_data(0x00,0x00);
 125   1      write_command(0x33);write_data(0x02,0x07);
 126   1      write_command(0x34);write_data(0x01,0x06);
 127   1      write_command(0x35);write_data(0x01,0x02);
 128   1      write_command(0x36);write_data(0x05,0x00);
 129   1      write_command(0x37);write_data(0x07,0x02);
 130   1      write_command(0x38);write_data(0x0A,0x1C);
 131   1      write_command(0x39);write_data(0x00,0x13);
 132   1      write_command(0x3A);write_data(0x03,0x04);
 133   1      write_command(0x3B);write_data(0x03,0x04);
 134   1      write_command(0x3C);write_data(0x03,0x04);
 135   1      write_command(0x3D);write_data(0x03,0x04);
 136   1      write_command(0x3E);write_data(0x00,0x03);
 137   1      write_command(0x3F);write_data(0x00,0x03);
 138   1      write_command(0x40);write_data(0x00,0x00);
 139   1      write_command(0x42);write_data(0xDB,0x00);
 140   1      write_command(0x43);write_data(0xDB,0x00);
 141   1      write_command(0x44);write_data(0xAF,0x00);
 142   1      write_command(0x45);write_data(0xDB,0x00);
 143   1      write_command(0x60);write_data(0x00,0x00);
 144   1      write_command(0x61);write_data(0x00,0x02);
 145   1      write_command(0x71);write_data(0x00,0x40);
 146   1      delay(50);
 147   1      write_command(0x10);write_data(0x44,0x30);
 148   1      write_command(0x07);write_data(0x00,0x05);
 149   1      delay(50);
 150   1      write_command(0x07);write_data(0x00,0x25);
 151   1      write_command(0x07);write_data(0x00,0x27);
 152   1      delay(50);
 153   1      write_command(0x0C);write_data(0x00,0x01);
 154   1      write_command(0x40);write_data(0x00,0x00);
 155   1      write_command(0x07);write_data(0x00,0x37);
 156   1      write_command(0x22);
 157   1      }
 158          
 159          
 160          void display_rgb(uchar h_data,l_data)
 161          {
 162   1      
 163   1              uint i,j;
 164   1              write_command(0x22);
 165   1              for(i=0;i<HSIZE;i++)
 166   1                      for(j=0;j<VSIZE;j++)
 167   1                              {
 168   2                              write_data(h_data,l_data);
 169   2                              }
 170   1              //write_command(0x2c,0x2c);
 171   1      }
 172          
 173          
 174          void main()
 175          {
 176   1              res=0;
 177   1              delay(20);
 178   1              res=1;
 179   1              delay(200);
C51 COMPILER V7.06   LGDP4523                                                              02/21/2009 19:10:11 PAGE 4   

 180   1              initialization();
 181   1              while(1)
 182   1              {
 183   2              /*display_image();
 184   2              delay(200000);
 185   2                      pause();*/
 186   2              dis_bar();
 187   2                      delay(2000);
 188   2                      pause();
 189   2              display_rgb(0xf8,0x00);
 190   2                      delay(2000);
 191   2                      pause();
 192   2                      display_rgb(0x07,0xe0);
 193   2                      delay(2000);
 194   2                      pause();
 195   2                      display_rgb(0x00,0x1f);
 196   2                      delay(2000);
 197   2                      pause();
 198   2                      display_rgb(0x00,0x00);
 199   2                      delay(2000);
 200   2                      pause();
 201   2              display_rgb(0xff,0xff);
 202   2                      delay(2000);
 203   2             pause();
 204   2      
 205   2              }
 206   1      }
 207          
 208          void dis_bar(void)
 209          {
 210   1              int i,j,k;
 211   1      
 212   1          write_command(0x22);
 213   1      
 214   1                        for(i=0;i<22;i++)     //display line
 215   1                      {
 216   2                               for(j=0;j<VSIZE;j++)
 217   2                              {
 218   3                                 write_data(0xF8,0x00);
 219   3                              }
 220   2                      }
 221   1      
 222   1                        for(i=0;i<22;i++)     //display line
 223   1                      {
 224   2                              for(j=0;j<VSIZE;j++)
 225   2                              {
 226   3                              write_data(0x07,0xe0);
 227   3                              }
 228   2                      }
 229   1      
 230   1                        for(i=0;i<22;i++)     //display line
 231   1                      {
 232   2                              for(j=0;j<VSIZE;j++)
 233   2                              {
 234   3                               write_data(0x00,0x1f);
 235   3                              }
 236   2                      }
 237   1      
 238   1                        for(i=0;i<22;i++)     //display line
 239   1                      {
 240   2                              for(j=0;j<VSIZE;j++)
 241   2                              {
C51 COMPILER V7.06   LGDP4523                                                              02/21/2009 19:10:11 PAGE 5   

 242   3                               write_data(0xfc,0x08);
 243   3      
 244   3                              }
 245   2                      }
 246   1      
 247   1                        for(i=0;i<22;i++)     //display line
 248   1                      {
 249   2                              for(j=0;j<VSIZE;j++)
 250   2                              {
 251   3                               write_data(0xff,0xe0);
 252   3      
 253   3                              }
 254   2                      }
 255   1      
 256   1                              for(i=0;i<22;i++)     //display line
 257   1                      {
 258   2                              for(j=0;j<VSIZE;j++)
 259   2                              {
 260   3                               write_data(0xff,0xff);
 261   3      
 262   3                              }
 263   2                      }
 264   1      
 265   1                              for(i=0;i<22;i++)     //display line
 266   1                      {
 267   2                              for(j=0;j<VSIZE;j++)
 268   2                              {
 269   3                               write_data(0xf8,0x1f);
 270   3      
 271   3                              }
 272   2                      }
 273   1      
 274   1                              for(i=0;i<22;i++)     //display line
 275   1                      {
 276   2                              for(j=0;j<VSIZE;j++)
 277   2                              {
 278   3                               write_data(0x00,0x00);
 279   3      
 280   3                              }
 281   2                      }
 282   1      
 283   1      }
*** WARNING C280 IN LINE 210 OF LGDP4523.C: 'k': unreferenced local variable
 284          
 285          
 286          void pause()
 287          {
 288   1              while(!step);
 289   1      }
 290          
 291          
 292          
 293          
 294          
 295          
 296          
 297          /*void display_image(void)
 298           {
 299            int i;
 300            int j;
 301            int k=0;
 302            write_command1(0x22);
C51 COMPILER V7.06   LGDP4523                                                              02/21/2009 19:10:11 PAGE 6   

 303            for(i=0;i<240;i++)
 304              {
 305                for(j=0;j<320;j++)
 306                {
 307               write_data(image[k++],image[k]);
 308                k++;
 309                }
 310               }
 311           // for(i=0;i<128*160;i++)
 312             // {
 313             //  write_data(image[i++],image[i]);
 314             // }
 315          
 316          // }
 317          
 318          }*/


MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =   1083    ----
   CONSTANT SIZE    =      1    ----
   XDATA SIZE       =   ----    ----
   PDATA SIZE       =   ----    ----
   DATA SIZE        =   ----       4
   IDATA SIZE       =   ----    ----
   BIT SIZE         =   ----    ----
END OF MODULE INFORMATION.


C51 COMPILATION COMPLETE.  1 WARNING(S),  0 ERROR(S)

⌨️ 快捷键说明

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