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

📄 al320_osd.lst

📁 基于averlogic公司的AL320的AUO 2.4" SRGB屏的驱动程序
💻 LST
📖 第 1 页 / 共 2 页
字号:
C51 COMPILER V7.50   AL320_OSD                                                             06/25/2008 18:08:07 PAGE 1   


C51 COMPILER V7.50, COMPILATION OF MODULE AL320_OSD
OBJECT MODULE PLACED IN .\Output\AL320_OSD.obj
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE AL320_OSD.C BROWSE DEBUG OBJECTEXTEND PRINT(.\Output\AL320_OSD.lst) OBJECT(
                    -.\Output\AL320_OSD.obj)

line level    source

   1          /*--------------------------------------------------------------------------
   2          AL320_OSD.C
   3          C file for AL320_OSD
   4          
   5          History:
   6          07/20/2006 : First Version V0.1 ---HsinChu Office
   7          
   8          Copyright (c) 1998-2006 AverLogic Inc
   9          All rights reserved.
  10          --------------------------------------------------------------------------*/
  11          #include <REG52.H>
  12          #include "DATATYPE.H"
  13          #include "AL320_OSD.H"
  14          #include "I2C.H"
  15          
  16          
  17          // ********************************************************************************
  18          // Function: AL320_EnableOSD
  19          // Description:  Setup OSD Control Register
  20          // Input parameters:   ucEnableFlag==>OSD ON or OFF 
  21          // Return values:      None
  22          // ******************************************************************************** 
  23          void AL320_EnableOSD(Byte ucEnableFlag)
  24          {
  25   1      
  26   1              Byte ucTemp;
  27   1      
  28   1              ucTemp = GetReg(SLAVE_ADDRESS_AL320,OSD_CONTROL1); 
  29   1              ucTemp &= 0x0e;
  30   1              SetReg(SLAVE_ADDRESS_AL320, OSD_CONTROL1,(ucTemp | ucEnableFlag));
  31   1              
  32   1      }
  33          
  34          // ********************************************************************************
  35          // Function: AL320_EnableOSDBlinking
  36          // Description:  Enable or Disable OSD Blinking
  37          // Input parameters:   ucEnableFlag==>OSD Blinking Enable or Disable
  38          // Return values:      None
  39          // ******************************************************************************** 
  40          void AL320_EnableOSDBlinking(Byte ucEnableFlag)
  41          {
  42   1      
  43   1              Byte ucTemp;
  44   1      
  45   1              ucTemp = GetReg(SLAVE_ADDRESS_AL320,OSD_CONTROL1); 
  46   1              ucTemp &= 0x0b;
  47   1              SetReg(SLAVE_ADDRESS_AL320, OSD_CONTROL1, (ucTemp | ucEnableFlag));
  48   1      }
  49          
  50          // ********************************************************************************
  51          // Function: AL320_SetOSDFontContext
  52          // Description:  Setup OSD 1 or 2 Byte Mode
  53          // Input parameters:   ucContext==> 1 or 2 Byte Mode
  54          // Return values:      None
C51 COMPILER V7.50   AL320_OSD                                                             06/25/2008 18:08:07 PAGE 2   

  55          // ******************************************************************************** 
  56          void AL320_SetOSDFontContext(Byte ucContext)
  57          {
  58   1      
  59   1              Byte ucTemp;
  60   1      
  61   1              ucTemp = GetReg(SLAVE_ADDRESS_AL320,OSD_CONTROL1); 
  62   1              ucTemp &= 0x0d;
  63   1              SetReg(SLAVE_ADDRESS_AL320, OSD_CONTROL1, (ucTemp | ucContext));
  64   1      }
  65          
  66          // ********************************************************************************
  67          // Function: AL320_SetOSDFontPixelDepth
  68          // Description:  Setup OSD 1 or 2 Byte Mode
  69          // Input parameters:   ucDepth==> 1 or 2 bit per pixel
  70          // Return values:      None
  71          // ******************************************************************************** 
  72          void AL320_SetOSDFontPixelDepth(Byte ucDepth)
  73          {
  74   1      
  75   1              Byte ucTemp;
  76   1      
  77   1              ucTemp = GetReg(SLAVE_ADDRESS_AL320,OSD_CONTROL1); 
  78   1              ucTemp &= 0x07;
  79   1              SetReg(SLAVE_ADDRESS_AL320, OSD_CONTROL1, (ucTemp | ucDepth));
  80   1      }
  81          
  82          // ********************************************************************************
  83          // Function: AL320_SetOSDDisplayStart
  84          // Description:  Setup OSD Display Start
  85          // Input parameters:   ucStartX==>Horizontal Start 
  86          //                                         ucStartY==>Vertical Start
  87          // Return values:      None 
  88          // ******************************************************************************** 
  89          void AL320_SetOSDDisplayStart(void)
  90          {
  91   1      
  92   1              SetReg(SLAVE_ADDRESS_AL320, OSD_HSTART, 13);
  93   1              SetReg(SLAVE_ADDRESS_AL320, OSD_VSTART, 10);
  94   1      
  95   1      } 
  96          
  97          // ********************************************************************************
  98          // Function: AL320_SetOSDRamAddress
  99          // Description:  Setup OSD Ram Address
 100          // Input parameters:   ucRamAddress==>Ram Address
 101          // Return values:      None 
 102          // ********************************************************************************  
 103          /*
 104          void AL320_SetOSDRamAddress(Byte ucRamAddress){
 105          
 106                  SetReg(SLAVE_ADDRESS_AL320, RAMADDR1ST, ucRamAddress);
 107          }
 108          
 109          */
 110          // ********************************************************************************
 111          // Function: AL320_SetOSDRamStride
 112          // Description:  Setup OSD Ram Stride
 113          // Input parameters:   ucRamStride==>Ram Stride
 114          // Return values:      None 
 115          // ******************************************************************************** 
 116                  void AL320_SetOSDRamStride(Word uiRamStride)
C51 COMPILER V7.50   AL320_OSD                                                             06/25/2008 18:08:07 PAGE 3   

 117                  {
 118   1             
 119   1              SetReg(SLAVE_ADDRESS_AL320, RAMSTRIDELOW, (Byte)(uiRamStride & 0xff));
 120   1              SetReg(SLAVE_ADDRESS_AL320, RAMSTRIDEHIGH, (Byte)((uiRamStride >> 8) & 0xff));
 121   1          }
 122          
 123          // ********************************************************************************
 124          // Function: AL320_SetOSDFontSize
 125          // Description:  Setup OSD Font Size
 126          // Input parameters:   wFontWidth==>Font Width 
 127          //                                         wFontHeight==>Font Height 
 128          //                     ucFontLineStride==>Font Line Size
 129          // Return values:      None
 130          // ******************************************************************************** 
 131          void AL320_SetOSDFontSize(Word uiFontWidth, Word uiFontHeight, Byte ucFontLineStride)
 132          {
 133   1      
 134   1              SetReg(SLAVE_ADDRESS_AL320, BMAPHSIZELOW, (Byte)(uiFontWidth & 0xff));
 135   1              SetReg(SLAVE_ADDRESS_AL320, BMAPHSIZEHIGH, (Byte)((uiFontWidth >> 8) & 0xff));
 136   1              SetReg(SLAVE_ADDRESS_AL320, BMAPHTOTALLOW, (Byte)((uiFontWidth) & 0xff));
 137   1              SetReg(SLAVE_ADDRESS_AL320, BMAPHTOTALHIGH, (Byte)(((uiFontWidth) >> 8) & 0xff));
 138   1         
 139   1              SetReg(SLAVE_ADDRESS_AL320, BMAPVSIZELOW, (Byte)(uiFontHeight & 0xff));
 140   1              SetReg(SLAVE_ADDRESS_AL320, BMAPVSIZEHIGH, (Byte)((uiFontHeight >> 8) & 0xff));
 141   1              SetReg(SLAVE_ADDRESS_AL320, BMAPVTOTALLOW, (Byte)(uiFontHeight & 0xff));
 142   1              SetReg(SLAVE_ADDRESS_AL320, BMAPVTOTALHIGH, (Byte)((uiFontHeight >> 8) & 0xff));
 143   1         
 144   1              SetReg(SLAVE_ADDRESS_AL320, FONT_LINE_SIZE, ucFontLineStride); 
 145   1      }
 146          
 147          // ********************************************************************************
 148          // Function: AL320_SetOSDSize
 149          // Description:  Setup OSD Icon Size
 150          // Input parameters:   ucWidth==>ICON Horizontal Total 
 151          //                                         ucHeight==>ICON Vertical Total
 152          // Return values:      None
 153          // ******************************************************************************** 
 154          void AL320_SetOSDSize(Byte ucWidth, Byte ucHeight){
 155   1      
 156   1              SetReg(SLAVE_ADDRESS_AL320, ICON_HTOTAL, ucWidth);
 157   1              SetReg(SLAVE_ADDRESS_AL320, ICON_VTOTAL, ucHeight);
 158   1      }
 159          // ********************************************************************************
 160          // Function: AL320_SetOSDFontAddress
 161          // Description:  Setup OSD Font Address
 162          // Input parameters:   ucFontAddress==>Font address 
 163          // Return values:      None
 164          // ******************************************************************************** 
 165          void AL320_SetOSDFontAddress(Word uiFontAddress){
 166   1      
 167   1              SetReg(SLAVE_ADDRESS_AL320, FONTADDR1STLOW, (Byte)(uiFontAddress & 0xff));
 168   1              SetReg(SLAVE_ADDRESS_AL320, FONTADDR1STHIGH, (Byte)((uiFontAddress >> 8) & 0xff));
 169   1      }
 170          // ********************************************************************************
 171          // Function: AL320_SetOSDColor

⌨️ 快捷键说明

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