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

📄 bit1601.lst

📁 dvr
💻 LST
字号:
C51 COMPILER V7.50   BIT1601                                                               12/14/2005 10:05:36 PAGE 1   


C51 COMPILER V7.50, COMPILATION OF MODULE BIT1601
OBJECT MODULE PLACED IN .\OBJ\Bit1601.obj
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE Bit1601.c LARGE OPTIMIZE(9,SIZE) BROWSE PRINT(.\LST\Bit1601.lst) OBJECT(.\O
                    -BJ\Bit1601.obj)

line level    source

   1           /*
   2          ********************************************************************************
   3          *
   4          * (c) Copyright 2002, Vineyard Technologies, Inc.
   5          *
   6          * Filename : bit1601.c
   7          * Programmer(s): Steve KyeongHyeon Lee
   8          * Created : 2003/02/05
   9          * Modified :
  10          *
  11          * Description :
  12          ********************************************************************************
  13          */
  14          #include "types.h"
  15          
  16          #ifndef TW2804
  17          
  18          #include "i2c.h"
  19          #include "bit1601.h"
  20          #include "gio.h"
  21          
  22          code u8 bit1601_ids[NUM_CAM] = {0x88,0x8a,0x8c,0x8e};
  23          xdata u8 video_active=0;
  24          
  25          // ++++++++++++++++++++++++++++++++++++++++++
  26          // Added by JC 11:32AM  2004/09/17
  27          
  28          /* ------------------------------------
  29              Header Files
  30             ------------------------------------ */
  31          #include "8052reg.h"
  32          
  33          /* ------------------------------------
  34              Type Definitions
  35             ------------------------------------ */
  36          typedef unsigned char       UB8;        /* 8-bit data */
  37          typedef unsigned short int  UW16;       /*16-bit data */
  38          typedef unsigned long       UW32;       /*32-bit data */
  39          
  40          /* ------------------------------------
  41              Variables Definitions/Declarations
  42             ------------------------------------ */
  43          
  44          #define VD_RST_ON   { P1_6 = 0;    }
  45          #define VD_RST_OFF  { P1_6 = 1;    }
  46          
  47          /* ------------------------------------
  48              Function Prototypes
  49             ------------------------------------ */
  50          static void YUV_HardwareReset(void);
  51          static void YUV_Init(UB8 bPAL);
  52          // ++++++++++++++++++++++++++++++++++++++++++
  53          
  54          //===============================================================================
C51 COMPILER V7.50   BIT1601                                                               12/14/2005 10:05:36 PAGE 2   

  55          //
  56          //===============================================================================
  57          void bit1601_init(u8 ntsc_pal)
  58          {
  59   1          // ------------------------------------------
  60   1          // Removed by JC 11:11AM  2004/10/13
  61   1          #ifdef NOT_JUNK
              
                  xdata u8 ch=0;
                  xdata u8 devid=0;
              
                  for(ch=0; ch < NUM_CAM; ch++)
                  {
                      devid = bit1601_read(ch,0x00);
              
                      bit1601_write(ch,0x06,0x60);
                      bit1601_write(ch,0x02,0x40);
                      bit1601_write(ch,0x20,0x20);
                      bit1601_write(ch,0x28,0x0c);
                      bit1601_write(ch,0x2e,0x5d);
                      bit1601_write(ch,0x2f,0xe6);// force blueback
              
                      if(ntsc_pal) // PAL CASE
                      {
                          bit1601_write(ch,0x03,0x92);
                          bit1601_write(ch,0x07,0x12);// VACTIVE
                          bit1601_write(ch,0x08,0x16);// VDELAY
                          bit1601_write(ch,0x09,0x20);// VACTIVE
                          bit1601_write(ch,0x0c,0x8c);// comb filer soft
                          bit1601_write(ch,0x12,0x0f);// sharpness soft
                          bit1601_write(ch,0x1c,0x01);//PAL
                          bit1601_write(ch,0x1d,0x7f);
              
                      }
                      else        // NTSC CASE
                      {
                         bit1601_write(ch,0x03,0xA2);
                         bit1601_write(ch,0x07,0x02);// VACTIVE
                         bit1601_write(ch,0x08,0x15);// VDELAY
                         bit1601_write(ch,0x09,0xF0);// VACTIVE
                         bit1601_write(ch,0x0C,0x9c);//7.5IRE
                         bit1601_write(ch,0x12,0x01);// sharpness soft
                         bit1601_write(ch,0x1c,0x00);//NTSC
                         bit1601_write(ch,0x1d,0x00);
                      }   
                      if(devid==0x18) bit1601_write(ch,0x06,0xe0); //bit1601A
                      else{
                                      bit1601_write(ch,0x06,0xc0); //bit1601B   
                                      bit1601_write(ch,0x3b,0x00); //bit1601B   
                      }
                      #ifdef MAKE_VDELAY
                      if(ntsc_pal)    bit1601_write(ch,0x08,0x1b-0x0b);    // To make horizontal upper line
                      else            bit1601_write(ch,0x08,0x15-0x0b);    // To make horizontal upper line
                      #endif
              
                  }
                  #endif
 112   1          // ------------------------------------------
 113   1      
 114   1          // ++++++++++++++++++++++++++++++++++++++++++
 115   1          // Added by JC 11:12AM  2004/10/13
 116   1          YUV_Init(ntsc_pal);
C51 COMPILER V7.50   BIT1601                                                               12/14/2005 10:05:36 PAGE 3   

 117   1          // ++++++++++++++++++++++++++++++++++++++++++
 118   1      
 119   1      }
 120          
 121          // ------------------------------------------
 122          // Removed by JC 11:11AM  2004/10/13
 123          #ifdef NOT_JUNK
              // ------------------------------------------
              //===============================================================================
              //
              //===============================================================================
              u8 bit1601_write(u8 ch, u8 idx, u8 val)
              {
                 i2c_pkt_write(bit1601_ids[ch],idx,val);
                 return 0;
              }
              
              //===============================================================================
              //
              //===============================================================================
              u8 bit1601_read(u8 ch, u8 idx)
              {
                  return i2c_pkt_read(bit1601_ids[ch],idx);
              }
              #endif
 142          // ------------------------------------------
 143          
 144          /*
 145          //===============================================================================
 146          //
 147          //===============================================================================
 148          u8 bit1601_read_video_active(void)
 149          {
 150              u8 ch=0;
 151              u8 pre_video_active;
 152              
 153              pre_video_active = video_active;
 154          
 155              for(ch = 0; ch < NUM_CAM; ch++ )
 156              {
 157                  if(0x80 & bit1601_read(ch,0x01))
 158                      video_active &= ~(1 << (NUM_CAM-(ch+1)));
 159                  else
 160                      video_active |= (1 << (NUM_CAM-(ch+1)));
 161              }
 162          
 163              if(pre_video_active != video_active)
 164                  return 1;
 165              else
 166                  return 0;
 167          }
 168          */
 169          
 170          #endif // TW2804
 171          
 172          // ++++++++++++++++++++++++++++++++++++++++++
 173          // Added by JC 11:13AM  2004/10/13
 174          
 175          
 176          /* ::::::::::::::::::::::::::::::::::::
 177              Video Decoder Register Definition
 178             :::::::::::::::::::::::::::::::::::: */
C51 COMPILER V7.50   BIT1601                                                               12/14/2005 10:05:36 PAGE 4   

 179          
 180          #define YUV_MAD_1                   0x40
 181          #define YUV_MAD_2                   0x42
 182          #define YUV_MAD_3                   0x48
 183          #define YUV_MAD_4                   0x4A
 184          
 185          // MAD: 0x40
 186          static UB8 code ab01_74_1[] = {
 187              0x67,       //  02  01
 188              0xFF,       //  04  02
 189              0xFC,       //  06  03
 190              0xE8,//20051104 david modify 0xF8,       //  08  04
 191              0xE0,       //  0A  05
 192              0xFF,       //  0C  06
 193              0x66,       //C0  0E  07
 194              0x60,       //55  10  08
 195              0x24,       //33  12  09
 196              0x00,       //  14  0A
 197              0x55,       //  16  0B
 198              0x45,       //  18  0C
 199              0x49,       //  1A  0D
 200              0x8C,       //  1C  0E
 201              0x00,       //  1E  0F
 202              0x00,       //14  20  10 
 203              0x40,       //  22  11
 204              0x7F,       //  24  12
 205              0x7F,       //  26  13 
 206              0x1F,       //  28  14 
 207              0x1F,       //  2A  15
 208              0xA0,       //  2C  16 //0x20=color kill function on   (礚癟腹块

⌨️ 快捷键说明

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