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

📄 lcd_osd.lst

📁 液晶显示器程序代码
💻 LST
📖 第 1 页 / 共 5 页
字号:
C51 COMPILER V7.06   LCD_OSD                                                               11/21/2005 13:47:29 PAGE 1   


C51 COMPILER V7.06, COMPILATION OF MODULE LCD_OSD
OBJECT MODULE PLACED IN .\Output\Lcd_osd.obj
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE Code\Lcd_osd.c OPTIMIZE(9,SPEED) BROWSE DEBUG OBJECTEXTEND CODE SYMBOLS PRI
                    -NT(.\Output\Lcd_osd.lst) PREPRINT(.\Output\Lcd_osd.i) OBJECT(.\Output\Lcd_osd.obj)

stmt level    source

   1          #define __OSD__
   2          
   3          #include "reg52.h" 
   4          
   5          #include "Header\MAIN_DEF.H"
   6          #include "Header\CONFIG.H"
   7          #include "Header\ACCESS.H"
   8          #include "Header\LCD_FUNC.H"
   9          #include "Header\LCD_AUTO.H"
  10          #include "Header\LCD_MSG.H"
  11          #include "Header\LCD_MAIN.H"
  12          #include "Header\LCD_OSD.H"
  13          #include "Header\FONT.H"
  14          #include "Header\OSD.H"
  15          #include "Header\SRC_CTRL.H"
  16          #include "Header\OSD_TREE.H"
  17          
  18          #include "Header\rgb_echo.H"
  19          
  20          #if (TV_CHIP != TV_NONE)
              #include "TUNER.H"
              #endif
  23          
  24          //////////////////////////////////////////////////////////////////////////////////////////////////////////
             -////
  25          // OSD Process Dispatch Table
  26          // In this code, when input source is not VGA, AUTO CONFIG page will not be shown.
  27          //////////////////////////////////////////////////////////////////////////////////////////////////////////
             -////
  28          
  29          unsigned char GetNextPageIdx(unsigned char ucPageCurr)
  30          {
  31   1          switch (stGUD1.INPUT_SOURCE & 0x07)
  32   1          {
  33   2          case SOURCE_VGA :
  34   2              return (5 <= ucPageCurr) ? 1 : ucPageCurr + 1;
  35   2          case SOURCE_DVI :
  36   2              return (5 <= ucPageCurr) ? 1 : ucPageCurr + 1;
  37   2          case SOURCE_AV  :
  38   2              return (5 <= ucPageCurr) ? 1 : ucPageCurr + 1;
  39   2          case SOURCE_SV  :
  40   2              return (5 <= ucPageCurr) ? 1 : ucPageCurr + 1;
  41   2          case SOURCE_YUV :
  42   2              return (5 <= ucPageCurr) ? 1 : ucPageCurr + 1;
  43   2          default :
  44   2              return 1;
  45   2          }
  46   1          
  47   1      }
  48          
  49          unsigned char GetPrevPageIdx(unsigned char ucPageCurr)
  50          {
  51   1         switch (stGUD1.INPUT_SOURCE & 0x07)
  52   1          {
C51 COMPILER V7.06   LCD_OSD                                                               11/21/2005 13:47:29 PAGE 2   

  53   2          case SOURCE_VGA :
  54   2              return (1 >= ucPageCurr) ? 5 : ucPageCurr - 1;
  55   2          case SOURCE_DVI :
  56   2              return (1 >= ucPageCurr) ? 5 : ucPageCurr - 1;
  57   2          case SOURCE_AV  :
  58   2              return (1 >= ucPageCurr) ? 5 : ucPageCurr - 1;
  59   2          case SOURCE_SV  :
  60   2              return (1 >= ucPageCurr) ? 5 : ucPageCurr - 1;
  61   2          case SOURCE_YUV :
  62   2              return (1 >= ucPageCurr) ? 5 : ucPageCurr - 1;
  63   2          default :
  64   2              return 1;
  65   2          }
  66   1      
  67   1      }
  68          
  69          //////////////////////////////////////////////////////////////////////////////////////////////////////////
             -////
  70          // OSD Process Public Function
  71          //////////////////////////////////////////////////////////////////////////////////////////////////////////
             -////
  72          
  73          //  OSD Window : Control OSD Windows
  74          //  win_no     : bit 2 ~ 0   Window Number 0 ~ 7
  75          //  row_start  : bit 10 ~ 0  Window Row Start Address
  76          //  row_end    : bit 10 ~ 0  Window Row End Address
  77          //  col_start  : bit 10 ~ 0  Window Column Start Address
  78          //  col_end    : bit 10 ~ 0  Window Column End Address
  79          //  width      : bit 2 ~ 0   shadow/border width or 3D button thickness in pixel unit 1~8 pixel
  80          //  height     : bit 2 ~ 0   shadow/border height in line unit , it must the same with width for 3D button
             - thickness
  81          //  color      : bit 3 ~ 0   window color index in 16-color LUT
  82          //  color_sb   : bit 7 ~ 4   shadow color or left-top/bottom border color for 3D window
  83          //             : bit 3 ~ 0   border color or right-bottom/top border color
  84          //  gradient   : bit 7       R Gradient Polarity 0 : Decrease  1 : Increase
  85          //             : bit 6       G Gradient Polarity 0 : Decrease  1 : Increase
  86          //             : bit 5       B Gradient Polarity 0 : Decrease  1 : Increase
  87          //             : bit 4 ~ 3   Gradient level      00~11 : 1 step ~ 4 setp per level
  88          //             : bit 2       Enable Red Color Gradient
  89          //             : bit 1       Enable Green Color Gradient
  90          //             : bit 0       Enable Blue Color Gradient
  91          //  gra_level  : bit 2~0     111 ~ 001 : 7 level ~ 1 level per gradient, 000 : 8 level per gradient
  92          //  attr       : bit 6       1 - Enable Gradient function      0 - Disable Gradient function
  93          //             : bit 5       1 - Vertical Gradient             0 - Horizontal Gradient
  94          //             : bit 4       1 - Enable Shadow/Border/3D button   0 - Disable
  95          //             : bit 3 ~ 1   000 : Shadow Type 1
  96          //                           001 : Shadow Type 2
  97          //                           010 : Shadow Type 3
  98          //                           011 : Shadow Type 4
  99          //                           100 : 3D Button Type 1
 100          //                           101 : 3D Button Type 2
 101          //                           110 : Reserved
 102          //                           111 : Border
 103          //             : bit 0       1 - Enable Window            0 - Disable Window
 104          void OSD_Window(unsigned char win_no, unsigned int row_start, unsigned int row_end, unsigned int col_start
             -, unsigned int col_end,
 105                                                  unsigned char width, unsigned char height, unsigned char color, unsigned char color_sb, unsigned char
             - gradient,
 106                                                  unsigned char gray_level,unsigned char attr)
 107          {
 108   1              if(win_no > 7)  
 109   1                      return;
C51 COMPILER V7.06   LCD_OSD                                                               11/21/2005 13:47:29 PAGE 3   

 110   1      
 111   1              Data[0]     = 5;
 112   1              Data[1]     = Y_INC;
 113   1              Data[2]     = OSD_ADDR_MSB_90;
 114   1              Data[3]     = 0xc1;
 115   1              Data[4]     = (win_no << 2);
 116   1              Data[5]     = 0;
 117   1              RTDWrite(Data);
 118   1              Data[0]     = 6;
 119   1              Data[1]     = N_INC;
 120   1              Data[2]     = OSD_DATA_92;
 121   1              Data[3]     = ((width & 0x07) << 3) | (height & 0x07);
 122   1              Data[4]     = color_sb;
 123   1              Data[5]     = gradient;
 124   1              Data[6]     = 0;
 125   1              RTDWrite(Data);
 126   1      
 127   1              Data[0]     = 5;
 128   1              Data[1]     = Y_INC;
 129   1              Data[2]     = OSD_ADDR_MSB_90;
 130   1              Data[3]     = 0xe1;
 131   1              Data[4]     = (win_no << 2) + 1;
 132   1              Data[5]     = 0;
 133   1              RTDWrite(Data);
 134   1              Data[0]     = 9;
 135   1              Data[1]     = N_INC;
 136   1              Data[2]     = OSD_DATA_92;
 137   1              Data[3]     = (unsigned char)((unsigned int)(row_start & 0x003f) << 2);
 138   1              Data[4]     = (unsigned char)((unsigned int)(col_start & 0x0007) << 5) | 
 139   1                                    (unsigned char)((unsigned int)(row_start & 0x07c0) >> 6);
 140   1              Data[5]     = (unsigned char)((unsigned int)(col_start & 0x07f8) >> 3);
 141   1      
 142   1              Data[6]     = (unsigned char)((unsigned int)(row_end & 0x003f) << 2);
 143   1              Data[7]    = (unsigned char)((unsigned int)(col_end & 0x0007) << 5) | 
 144   1                                        (unsigned char)((unsigned int)(row_end & 0x07c0) >> 6);
 145   1              Data[8]    = (unsigned char)((unsigned int)(col_end & 0x07f8) >> 3);
 146   1              Data[9]     = 0;
 147   1              RTDWrite(Data);
 148   1      
 149   1              Delay_Xms(25);
 150   1              
 151   1              /*
 152   1              do
 153   1              {
 154   1                      RTDRead(0x94, 0x01, Y_INC);
 155   1              }
 156   1              while( ((Data[0] >> 5) & 0x01) );
 157   1              */
 158   1              
 159   1              Data[0]     = 5;
 160   1              Data[1]     = Y_INC;
 161   1              Data[2]     = OSD_ADDR_MSB_90;
 162   1              Data[3]     = 0xc1;
 163   1              Data[4]     = (win_no << 2) + 3;
 164   1              Data[5]     = 0;
 165   1              RTDWrite(Data);
 166   1              Data[0]     = 6;
 167   1              Data[1]     = N_INC;
 168   1              Data[2]     = OSD_DATA_92;
 169   1              Data[3]    = 0x00;
 170   1              Data[4]    = (unsigned char)((gray_level & 0x07) << 4) |( color & 0x0f);
 171   1              Data[5]    = attr;
C51 COMPILER V7.06   LCD_OSD                                                               11/21/2005 13:47:29 PAGE 4   

 172   1              Data[6]    = 0;
 173   1              RTDWrite(Data);
 174   1      
 175   1      }
 176          
 177          /////////////////////////////////////////////////////////////////////////////////////
 178          //anson
 179          /////////////////////////////////////////////////////////////////////////////////////
 180          void OSD_Fact_Line(unsigned char row, unsigned char col, unsigned char length,
 181                        unsigned char value, unsigned char indicate)
 182          {
 183   1              unsigned int idata usStart_Addr;
 184   1              unsigned char idata ucTemp;
 185   1      
 186   1              usStart_Addr = FONT_SELECT_ADDRESS;
 187   1      
 188   1              //The address of the first character Cn1 in Row n = FONT_SELECT_ADDRESS + Row0_length + Row1_length +...+
             -Row(n-1)_length
 189   1              for(ucTemp = 1; ucTemp < row+1; ucTemp ++)
 190   1                      usStart_Addr += FactRow_Info[0][ucTemp];
 191   1      
 192   1              Data[0] = 5;
 193   1              Data[1] = Y_INC;
 194   1              Data[2] = OSD_ADDR_MSB_90;
 195   1      
 196   1              if( (col+1) > FactRow_Info[0][row + 1]) // if column_start > row_length, then return
 197   1                      return;
 198   1              else if((col + 1 + length) > FactRow_Info[0][row + 1])  // if column_start + length > row_length, then re-
             -calculate the length
 199   1                      length = FactRow_Info[0][row + 1] - col;
 200   1      
 201   1              // indicate : 0, 1, 2, 3 set byte 0, 1, 2 and all byte
 202   1              Data[3] = (unsigned char)( ((usStart_Addr + col)  & 0x0fff) >> 8 ) | (((indicate << 2) + 1) << 4);
 203   1              Data[4] = (unsigned char)((usStart_Addr + col) & 0x00ff);
 204   1              Data[5] = 0;
 205   1              RTDWrite(Data);
 206   1      
 207   1              Data[0]     = (indicate == 3) ? length * 3 + 3 : length + 3;
 208   1              Data[1]     = BURST;
 209   1              Data[2]     = OSD_DATA_92;
 210   1              Data[3]     = value;
 211   1              Data[4]     = 0;
 212   1              RTDWrite(Data);
 213   1      
 214   1      }
 215          
 216          void OSD_Fact_Clear(unsigned char row_start, unsigned char height, unsigned char col_start, unsigned char 
             -width)
 217          {

⌨️ 快捷键说明

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