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

📄 tft.lst

📁 IC: NT39102的彩屏的驱动
💻 LST
字号:
C51 COMPILER V7.50   TFT                                                                   07/22/2008 21:22:19 PAGE 1   


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

line level    source

   1          //DJN Co.,LTD.
   2          //LCM operation code
   3          //Driver IC: NT39102
   4          //Panel: AUO 1.77
   5          #include "reg52.h"
   6          #include <absacc.h>
   7          #include"bmp.h"
   8          unsigned char xdata bmpr[40960];
   9          /********************************************************************************
  10            DESCRIPTION:
  11           LCM initialization sequence.
  12            PARAMETERS:
  13            RETURNS:
  14            REMARKS:
  15          *********************************************************************************/ 
  16          void LCD_WRITE_A0(unsigned char cmd)
  17          {
  18   1         XBYTE[0xe000]=cmd;
  19   1      }
  20          void LCD_WRITE_A1(unsigned char DATA)
  21          {
  22   1         XBYTE[0xe001]=DATA;
  23   1      }
  24          void Delayms(unsigned char ms)
  25          {
  26   1         unsigned char a,b;
  27   1         for(;ms>0;ms--)
  28   1          for(a=0;a<10;a++)
  29   1                for(b=0;b<100;b++);
  30   1      }
  31          
  32          
  33          void init_lcd()
  34          {
  35   1        P3=0XFF;
  36   1        Delayms(200);
  37   1        P3=0X00;
  38   1        Delayms(200);
  39   1        P3=0XFF;
  40   1        LCD_WRITE_A0(0x0001); LCD_WRITE_A1(0x0002); /* 7-6=00: panel resolution 128x160, 4-2=000: 16 bit color m
             -od, 1=0: power on, 0=0: out of range data white */ \
  41   1        LCD_WRITE_A0(0x0002); LCD_WRITE_A1(0x0012); /* 7=0: sub panel off (CSV=1), 5=0: line inversion, 4=1: sub
             - panel off, 3=0: main panel on */                  \
  42   1        LCD_WRITE_A0(0x0003); LCD_WRITE_A1(0x0020); /* 7-6=01: 16 bit mode, 5-4=10: 16 bit transfer, 18 bit data
             - (BODR=10) */                                      \
  43   1        LCD_WRITE_A0(0x0005); LCD_WRITE_A1(0x0008); /* 4-3=01: typical bias, 5,2-0=0,00: 1.82MHz */             
             -                                                   \
  44   1        LCD_WRITE_A0(0x0008); LCD_WRITE_A1(0x000C); /* 6-0=0001100: VCOM_L 0.197 V */                           
             -                                                   \
  45   1        LCD_WRITE_A0(0x0007); LCD_WRITE_A1(0x007f); /* 6-0=1110100: VCOM_H 4.003 V */                           
             -                                                   \
  46   1        LCD_WRITE_A0(0x0021); LCD_WRITE_A1(0x0000); /* gamma adjustment 2.0 */                                  
             -                                                   \
  47   1        LCD_WRITE_A0(0x0022); LCD_WRITE_A1(0x0000); /* gamma adjustment 2.0 */                                  
             -                                                   \
C51 COMPILER V7.50   TFT                                                                   07/22/2008 21:22:19 PAGE 2   

  48   1        LCD_WRITE_A0(0x0023); LCD_WRITE_A1(0x0024); /* gamma adjustment 2.0 */                                  
             -                                                   \
  49   1        LCD_WRITE_A0(0x0024); LCD_WRITE_A1(0x001B); /* gamma adjustment 2.0 */                                  
             -                                                   \
  50   1        LCD_WRITE_A0(0x0025); LCD_WRITE_A1(0x0009); /* gamma adjustment 2.0 */                                  
             -                                                   \
  51   1        LCD_WRITE_A0(0x0026); LCD_WRITE_A1(0x0000); /* gamma adjustment 2.0 */                                  
             -                                                   \
  52   1        LCD_WRITE_A0(0x0027); LCD_WRITE_A1(0x0000); /* gamma adjustment 2.0 */                                  
             -                                                   \
  53   1        LCD_WRITE_A0(0x0028); LCD_WRITE_A1(0x0000); /* gamma adjustment 2.0 */                                  
             -                                                   \
  54   1        LCD_WRITE_A0(0x0006); LCD_WRITE_A1(0x00C7);  /* 7=1: internal register, 6=1: power on */
  55   1      }
  56          void set_windows(unsigned char x_s,unsigned char x_e,unsigned char y_s,unsigned char y_e)
  57          {
  58   1         LCD_WRITE_A0(0x0009); LCD_WRITE_A1(x_s); 
  59   1         LCD_WRITE_A0(0x0011); LCD_WRITE_A1(x_e); 
  60   1         LCD_WRITE_A0(0x0010); LCD_WRITE_A1(y_s); 
  61   1         LCD_WRITE_A0(0x0012); LCD_WRITE_A1(y_e); 
  62   1      }
  63          
  64          /********************************************************************************
  65            DESCRIPTION:
  66           LCM display window setting.
  67            PARAMETERS:
  68           xs: Horizontal Address Start Position
  69           xe: Horizontal Address End Position
  70           ys: Vertical Address Start Position
  71           ye: Vertical Address End Position
  72            RETURNS:
  73            REMARKS:
  74          *********************************************************************************/
  75          
  76           main()
  77           {
  78   1       unsigned int a=0;
  79   1       init_lcd();
  80   1       for(a=0;a<40960;a++)
  81   1       {
  82   2         bmpr[a]=bmp[a];
  83   2       }
  84   1       set_windows(0,127,0,159);
  85   1       for(a=0;a<128*160;a++)
  86   1       {
  87   2        LCD_WRITE_A1(bmpr[a*2+1]);
  88   2        LCD_WRITE_A1(bmpr[a*2]);
  89   2        }
  90   1       while(1);
  91   1      }
  92          /********************************************************************************
  93            DESCRIPTION:
  94           LCM enter_sleep_mode sequence.
  95            PARAMETERS:
  96            RETURNS:
  97            REMARKS:
  98           1) This command has no effect when module is already in sleep in mode. 
  99          Sleep In Mode can only be exit by the Sleep Out Command (11h).
 100           2) It will be necessary to wait 5msec before sending next command, 
 101          this is to allow time for the supply voltages and clock circuits to stabilize.
 102           3) It will be necessary to wait 120msec after sending Sleep Out command 
 103          (when in Sleep In Mode) before Sleep In command can be sent.
C51 COMPILER V7.50   TFT                                                                   07/22/2008 21:22:19 PAGE 3   

 104          *********************************************************************************/ 
 105          
 106           
 107          /********************************************************************************
 108            DESCRIPTION:
 109           LCM exit_sleep_mode sequence.
 110            PARAMETERS:
 111            RETURNS:
 112            REMARKS:
 113           1) This command has no effect when module is already in sleep out mode. 
 114          Sleep Out Mode can only be exit by the Sleep In Command (10h).
 115           2) It will be necessary to wait 5msec before sending next command.
 116          *********************************************************************************/


MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =    363    ----
   CONSTANT SIZE    =  40960    ----
   XDATA SIZE       =  40960    ----
   PDATA SIZE       =   ----    ----
   DATA SIZE        =   ----       6
   IDATA SIZE       =   ----    ----
   BIT SIZE         =   ----    ----
END OF MODULE INFORMATION.


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

⌨️ 快捷键说明

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