init.LST
上传用户:ids068
上传日期:2013-04-04
资源大小:639k
文件大小:27k
源码类别:

USB编程

开发平台:

C/C++

  1. C51 COMPILER V7.06   INIT                                                                  07/02/2003 10:27:48 PAGE 1   
  2. C51 COMPILER V7.06, COMPILATION OF MODULE INIT
  3. OBJECT MODULE PLACED IN init.OBJ
  4. COMPILER INVOKED BY: C:KEILC51BINC51.EXE init.c OPTIMIZE(2,SPEED) BROWSE DEBUG OBJECTEXTEND
  5. stmt level    source
  6.    1          /****************************************Copyright (c)**************************************************
  7.    2          **                               广州周立功单片机发展有限公司
  8.    3          **                                     研    究    所
  9.    4          **                                 http://www.zlgmcu.com
  10.    5          **--------------当前版本修订------------------------------------------------------------------------------
  11.    6          ** 修改人: 刘英斌
  12.    7          ** 日 期:2003-03-13
  13.    8          ** 描 述:ISP1581 V1.0
  14.    9          **------------------------------------------------------------------------------------------------------
  15.   10          ********************************************************************************************************/
  16.   11          
  17.   12          #include "standard.h"
  18.   13          #include "Kernel.h"
  19.   14          #include "D14.h"
  20.   15          
  21.   16          //***********************************************************************
  22.   17          //*                                                                                                                                                            *
  23.   18          //*                      External Variable Definition                                              *
  24.   19          //*                                                                                                                                                            *
  25.   20          //***********************************************************************
  26.   21          
  27.   22          extern void Start_mSEC_Timer(Data);
  28.   23          extern void Start_SEC_Timer(Data);
  29.   24          extern KERNEL Kernel_Flag;
  30.   25          extern USB_INT_FLAG     USB_Int_Flag;
  31.   26          extern USB_DEVICE USB_Device;
  32.   27          extern UI Temp,PIO_Count;
  33.   28          extern UC Device_Config_Value;
  34.   29          extern UC idata Endpt_FIFO[MAX_BUF];
  35.   30          extern void DMA_Init(void);
  36.   31          extern ULI bytecount;
  37.   32          extern UC Address_Count;
  38.   33          extern UC xdata Address[20];
  39.   34          
  40.   35          //***********************************************************************
  41.   36          //*                                                                                                                                                            *
  42.   37          //*                      Prototype Routine Definition                                              *
  43.   38          //*                                                                                                                                                            *
  44.   39          //***********************************************************************
  45.   40          
  46.   41          void Init_D14_SFR(void);
  47.   42          void Init_Endpoint(void);
  48.   43          
  49.   44          void Init_Main(void);
  50.   45          void Init_8051(void);
  51.   46          void Init_D14(void);
  52.   47          
  53.   48          //***********************************************************************
  54.   49          //*                                                                                                                                                            *
  55.   50          //*                          Variable Definition                                                              *
  56.   51          //*                                                                                                                                                            *
  57.   52          //***********************************************************************
  58.   53          
  59.   54          TIMER Timer;
  60.   55          DATA_SWAP       idata   Data_Swap;
  61. C51 COMPILER V7.06   INIT                                                                  07/02/2003 10:27:48 PAGE 2   
  62.   56          DMA_INT_FLAG    DMA_Int_Flag;
  63.   57          
  64.   58          UI      count;
  65.   59          UC      Device_Config_Value;
  66.   60          UC      Type;
  67.   61          
  68.   62          UI      idata   Init_Count;
  69.   63          
  70.   64          volatile D14_CNTRL_REG  xdata   D14_Cntrl_Reg   _at_    0x7000;
  71.   65          
  72.   66          D14_CNTRL_REG xdata *D14_Cntrl_Ptr = &D14_Cntrl_Reg;
  73.   67          
  74.   68          
  75.   69          //***********************************************************************
  76.   70          //*                                                                                                                                                    *
  77.   71          //*     Routine         : Init_Main                                                        *
  78.   72          //*     Input           : None                                                                                              *
  79.   73          //*     Output  : None                                                                        *
  80.   74          //*     Function        : To initialize the D14 and the 8051                                  *
  81.   75          //*                                                                                                                                                            *
  82.   76          //***********************************************************************
  83.   77          
  84.   78          void Init_Main(void)
  85.   79          {
  86.   80   1              
  87.   81   1              AUXR = 0x02;
  88.   82   1              CKCON = 0x01;
  89.   83   1                      
  90.   84   1      
  91.   85   1              //disable ISP1581 chip select
  92.   86   1              ISP1581_CS = 1;         //关1581片选
  93.   87   1              bytecount = 0;
  94.   88   1              PIO_Count = 64;
  95.   89   1              
  96.   90   1          Type = 0;
  97.   91   1              USB_Device.BITS.DMA_Test_Mode = PIO_Test;
  98.   92   1              
  99.   93   1              //初始化8051
  100.   94   1              Init_8051();                                                    
  101.   95   1              
  102.   96   1              ISP1581_CS = 0;         //片选ISP1581
  103.   97   1      
  104.   98   1              D14_Cntrl_Reg.D14_MODE.BITS.SOFTCT = 0; 
  105.   99   1              
  106.  100   1              //检查是否连接了ISP1581
  107.  101   1              do
  108.  102   1              {
  109.  103   2                      //reset ISP1581                  
  110.  104   2                      ISP1581_RESET = 0;
  111.  105   2                      Start_mSEC_Timer(100);
  112.  106   2                      ISP1581_RESET = 1;
  113.  107   2                      Start_mSEC_Timer(100);
  114.  108   2                      
  115.  109   2                      //读取接口器件是否ISP1581            
  116.  110   2                      if(D14_Cntrl_Ptr->D14_CHIP_ID_MBYTE == 0x81 && D14_Cntrl_Ptr->D14_CHIP_ID_MSB == 0x15)
  117.  111   2                              break;
  118.  112   2              }while(1);
  119.  113   1              
  120.  114   1              //初始化标志寄存器
  121.  115   1              USB_Int_Flag.VALUE = 0;//USB中断标志寄存器
  122.  116   1              DMA_Int_Flag.VALUE = 0;//DMA中断标志寄存器
  123.  117   1              Kernel_Flag.VALUE = 0;//ISP1581状态标志寄存器
  124. C51 COMPILER V7.06   INIT                                                                  07/02/2003 10:27:48 PAGE 3   
  125.  118   1              
  126.  119   1              //设置为设备默认状态
  127.  120   1              Kernel_Flag.BITS.HS_FS_State = FULL_SPEED;//设置为全速状态
  128.  121   1              HS_FS_LED = FULL_SPEED_LED;
  129.  122   1              
  130.  123   1              //初始化ISP1581
  131.  124   1              Init_D14();                             
  132.  125   1      }
  133.  126          
  134.  127          
  135.  128          
  136.  129          
  137.  130          //***********************************************************************
  138.  131          //*                                                                                                                                                    *
  139.  132          //*     Routine         : Init 8051                                                     *
  140.  133          //*     Input           : 8051 Special Function Register                                            *
  141.  134          //*     Output  : None                                                                             *
  142.  135          //*     Function        : To initialize 8051                                                  *
  143.  136          //*                                                                                                                                                            *
  144.  137          //***********************************************************************
  145.  138          
  146.  139          void Init_8051(void)
  147.  140          {
  148.  141   1              
  149.  142   1              //定义定时器方式
  150.  143   1              TMOD = 0x01;
  151.  144   1              
  152.  145   1              //初始化定时器时间
  153.  146   1              Timer.mSEC_Scale = 2000;
  154.  147   1              Timer.Hundred_mSEC_Scale = 20000;
  155.  148   1              
  156.  149   1              //reset timer control
  157.  150   1              TCON = 0;                   
  158.  151   1              
  159.  152   1              //disable all interrupt
  160.  153   1              EA = 0;                           
  161.  154   1              
  162.  155   1              //disable UART interrupt
  163.  156   1              //disable timer 1 overflow interrupt
  164.  157   1              //disable external interrupt 1
  165.  158   1              //enable timer 0 overflow interrupt
  166.  159   1              //enable external interrupt 0
  167.  160   1              IE = 0x02;                      
  168.  161   1              
  169.  162   1              //reset interrupt priority
  170.  163   1              IP = 0;                         
  171.  164   1              PT1 = 1;
  172.  165   1              PT0 = 1;
  173.  166   1      //      EX0 = 1;                //开ISP1581中断 
  174.  167   1              //enable all interrupt
  175.  168   1              EA = 1;                         
  176.  169   1              
  177.  170   1              
  178.  171   1              //disable all power mode control
  179.  172   1              //enable half/doble baud rate 
  180.  173   1              PCON = 0x40;    
  181.  174   1      }
  182.  175          
  183.  176          //***********************************************************************
  184.  177          //*                                                                                                                                                    *
  185.  178          //*     Routine         : Init D14                                                      *
  186.  179          //*     Input           : ISP1581 SFR                                                               *
  187. C51 COMPILER V7.06   INIT                                                                  07/02/2003 10:27:48 PAGE 4   
  188.  180          //*     Output  : None                                                                             *
  189.  181          //*     Function        : To initialize ISP1581                                               *
  190.  182          //*                                                                                                                                                            *
  191.  183          //***********************************************************************
  192.  184          
  193.  185          void Init_D14(void)
  194.  186          {
  195.  187   1              
  196.  188   1              //初始化ISP1581寄存器
  197.  189   1              Init_D14_SFR();
  198.  190   1              
  199.  191   1              //初始化ISP1581端点
  200.  192   1              Init_Endpoint();                
  201.  193   1              
  202.  194   1              //初始化ISP1581工作标志寄存器
  203.  195   1              USB_Device.BITS.State = USB_Default;
  204.  196   1              Device_Config_Value = 0;
  205.  197   1              USB_Device.BITS.Alter_Interface = 0;
  206.  198   1              USB_Device.BITS.Big_Endian = On;
  207.  199   1              Kernel_Flag.BITS.Tx_Done = 0;
  208.  200   1              EX0 = 1;                //开ISP1581中断
  209.  201   1              
  210.  202   1      }
  211.  203          
  212.  204          //***********************************************************************
  213.  205          //*                                                                                                                                                    *
  214.  206          //*     Routine         : Init D14 SFR                                                  *
  215.  207          //*     Input           : ISP1581 SFR                                                               *
  216.  208          //*     Output  : None                                                                             *
  217.  209          //*     Function        : To initialize ISP1581                                               *
  218.  210          //*                                                                                                                                                            *
  219.  211          //***********************************************************************
  220.  212          
  221.  213          void Init_D14_SFR(void)
  222.  214          {
  223.  215   1              //enable Global Interrupt enable
  224.  216   1              //enable soft connect and other feature
  225.  217   1              //enable wakeup on chip select
  226.  218   1              //disable soft connect
  227.  219   1              //设置模式:时钟始终有效,全局中断使能,片选唤醒
  228.  220   1              D14_Cntrl_Reg.D14_MODE.VALUE |= 0x8C;
  229.  221   1              
  230.  222   1              //set all interrupt source to mode 1
  231.  223   1              //设置全部中断为模式1,电平触发,低电平有效
  232.  224   1              D14_Cntrl_Reg.D14_INT_CONFIG.VALUE = 0x54;                      
  233.  225   1              
  234.  226   1              //设置中断使能寄存器
  235.  227   1              //注释: D14_Cntrl_Reg.D14_INT_ENABLE.VALUE = 0x790D0000;先发送高字节
  236.  228   1              //0x14(xdata)=0x79
  237.  229   1              //0x15(xdata)=0x0D
  238.  230   1              //0x16(xdata)=00
  239.  231   1              //0x17(xdata0=00
  240.  232   1              //使用端点0和端点2
  241.  233   1              D14_Cntrl_Reg.D14_INT_ENABLE.VALUE = 0x39fd0000;        
  242.  234   1      
  243.  235   1      }
  244.  236          
  245.  237          
  246.  238          //***********************************************************************
  247.  239          //*                                                                                                                                                    *
  248.  240          //*     Routine         : Init Endpoint                                                 *
  249.  241          //*     Input           : ISP1581 FIFO                                                              *
  250. C51 COMPILER V7.06   INIT                                                                  07/02/2003 10:27:48 PAGE 5   
  251.  242          //*     Output  : None                                                                             *
  252.  243          //*     Function        : To initialize ISP1581 endpoint FIFO                                 *
  253.  244          //*                                                                                                                                                            *
  254.  245          //***********************************************************************
  255.  246          
  256.  247          void Init_Endpoint(void)
  257.  248          {
  258.  249   1              //设置全速端点
  259.  250   1              if(Kernel_Flag.BITS.HS_FS_State == FULL_SPEED)
  260.  251   1              {
  261.  252   2                      //设置全速端点FIFO大小
  262.  253   2      
  263.  254   2                      //Interrupt Out MaxPacketSize Endpoint
  264.  255   2                      D14_Cntrl_Reg.D14_ENDPT_INDEX = 2;//选择端点
  265.  256   2                      D14_Cntrl_Reg.D14_ENDPT_MAXPKTSIZE.VALUE = 0x4000;      //FIFO=64bytes
  266.  257   2                      
  267.  258   2                      //Interrupt In MaxPacketSize Endpoint
  268.  259   2                      D14_Cntrl_Reg.D14_ENDPT_INDEX = 3;//选择端点
  269.  260   2                      D14_Cntrl_Reg.D14_ENDPT_MAXPKTSIZE.VALUE = 0x4000;//FIFO=64bytes
  270.  261   2                      
  271.  262   2                      //Bulk Out MaxPacketSize Endpoint
  272.  263   2                      D14_Cntrl_Reg.D14_ENDPT_INDEX = 4;//选择端点
  273.  264   2                      D14_Cntrl_Reg.D14_ENDPT_MAXPKTSIZE.VALUE = 0x4000;//FIFO=64bytes
  274.  265   2                      
  275.  266   2                      
  276.  267   2                      //Bulk In MaxPacketSize Endpoint
  277.  268   2                      D14_Cntrl_Reg.D14_ENDPT_INDEX = 5;//选择端点
  278.  269   2                      D14_Cntrl_Reg.D14_ENDPT_MAXPKTSIZE.VALUE = 0x4000;//FIFO=64bytes
  279.  270   2                      
  280.  271   2                      
  281.  272   2                      //Iso Out MaxPacketSize Endpoint
  282.  273   2                      D14_Cntrl_Reg.D14_ENDPT_INDEX = 6;//选择端点
  283.  274   2                      D14_Cntrl_Reg.D14_ENDPT_MAXPKTSIZE.VALUE = 0x4000;//FIFO=64bytes
  284.  275   2                      
  285.  276   2                      //Iso In MaxPacketSize Endpoint
  286.  277   2                      D14_Cntrl_Reg.D14_ENDPT_INDEX = 7;//选择端点
  287.  278   2                      D14_Cntrl_Reg.D14_ENDPT_MAXPKTSIZE.VALUE = 0x4000;//FIFO=64bytes
  288.  279   2                      
  289.  280   2                      //设置全速端点类型
  290.  281   2      
  291.  282   2                      //Interrupt In Endpoint Type
  292.  283   2                      D14_Cntrl_Reg.D14_ENDPT_INDEX = 2;//选择端点
  293.  284   2                      D14_Cntrl_Reg.D14_ENDPT_TYPE.VALUE = 0x1700;//设置为中断,使用双缓冲,禁止FIFO,禁止无空包
  294.  285   2                      
  295.  286   2                      
  296.  287   2                      //Interrupt Out Endpoint Type
  297.  288   2                      D14_Cntrl_Reg.D14_ENDPT_INDEX = 3;//选择端点
  298.  289   2                      D14_Cntrl_Reg.D14_ENDPT_TYPE.VALUE = 0x1700;//设置为中断,使用双缓冲,禁止FIFO,禁止无空包
  299.  290   2                      
  300.  291   2                      
  301.  292   2                      //Bulk Out Endpoint Type
  302.  293   2                      D14_Cntrl_Reg.D14_ENDPT_INDEX = 4;//选择端点
  303.  294   2                      D14_Cntrl_Reg.D14_ENDPT_TYPE.VALUE = 0x1600;//设置为批量,使用双缓冲,禁止FIFO,禁止无空包
  304.  295   2                      
  305.  296   2                      
  306.  297   2                      //Bulk In Endpoint Type
  307.  298   2                      D14_Cntrl_Reg.D14_ENDPT_INDEX = 5;//选择端点
  308.  299   2                      D14_Cntrl_Reg.D14_ENDPT_TYPE.VALUE = 0x1600;//设置为批量,使用双缓冲,禁止FIFO,禁止无空包
  309.  300   2                      
  310.  301   2                      
  311.  302   2                      //Iso Out Endpoint Type
  312.  303   2                      D14_Cntrl_Reg.D14_ENDPT_INDEX = 6;//选择端点
  313. C51 COMPILER V7.06   INIT                                                                  07/02/2003 10:27:48 PAGE 6   
  314.  304   2                      D14_Cntrl_Reg.D14_ENDPT_TYPE.VALUE = 0x1500;//设置为同步,使用双缓冲,禁止FIFO,禁止无空包
  315.  305   2                      
  316.  306   2                      
  317.  307   2                      //Iso In Endpoint Type
  318.  308   2                      D14_Cntrl_Reg.D14_ENDPT_INDEX = 7;//选择端点
  319.  309   2                      D14_Cntrl_Reg.D14_ENDPT_TYPE.VALUE = 0x1500;//设置为同步,使用双缓冲,禁止FIFO,禁止无空包
  320.  310   2                      
  321.  311   2                      //端点使能                              
  322.  312   2      
  323.  313   2                      //enable FIFO
  324.  314   2                      D14_Cntrl_Reg.D14_ENDPT_INDEX = 2;//选择端点
  325.  315   2                      D14_Cntrl_Reg.D14_ENDPT_TYPE.VALUE |= 0x0800;                   
  326.  316   2                      
  327.  317   2                      //enable FIFO
  328.  318   2                      D14_Cntrl_Reg.D14_ENDPT_INDEX = 3;//选择端点
  329.  319   2                      D14_Cntrl_Reg.D14_ENDPT_TYPE.VALUE |= 0x0800;                   
  330.  320   2                      
  331.  321   2                      //enable FIFO
  332.  322   2                      D14_Cntrl_Reg.D14_ENDPT_INDEX = 4;//选择端点
  333.  323   2                      D14_Cntrl_Reg.D14_ENDPT_TYPE.VALUE |= 0x0800;                   
  334.  324   2                      
  335.  325   2                      //enable FIFO
  336.  326   2                      D14_Cntrl_Reg.D14_ENDPT_INDEX = 5;//选择端点
  337.  327   2                      D14_Cntrl_Reg.D14_ENDPT_TYPE.VALUE |= 0x0800;                   
  338.  328   2                      
  339.  329   2                      //enable FIFO
  340.  330   2                      D14_Cntrl_Reg.D14_ENDPT_INDEX = 6;//选择端点
  341.  331   2                      D14_Cntrl_Reg.D14_ENDPT_TYPE.VALUE |= 0x0800;                   
  342.  332   2                      
  343.  333   2                      //enable FIFO
  344.  334   2                      D14_Cntrl_Reg.D14_ENDPT_INDEX = 7;//选择端点
  345.  335   2                      D14_Cntrl_Reg.D14_ENDPT_TYPE.VALUE |= 0x0800;                   
  346.  336   2                      
  347.  337   2              }
  348.  338   1              
  349.  339   1              //设置高速端点
  350.  340   1              if(Kernel_Flag.BITS.HS_FS_State == HIGH_SPEED)
  351.  341   1              {
  352.  342   2                      //设置全速端点FIFO大小
  353.  343   2                      
  354.  344   2                      //Interrupt Out MaxPacketSize Endpoint
  355.  345   2                      D14_Cntrl_Reg.D14_ENDPT_INDEX = 2;//选择端点
  356.  346   2                      D14_Cntrl_Reg.D14_ENDPT_MAXPKTSIZE.VALUE = 0x4000;//FIFO=64bytes
  357.  347   2                      
  358.  348   2                      //Interrupt In MaxPacketSize Endpoint
  359.  349   2                      D14_Cntrl_Reg.D14_ENDPT_INDEX = 3;//选择端点
  360.  350   2                      D14_Cntrl_Reg.D14_ENDPT_MAXPKTSIZE.VALUE = 0x4000;//FIFO=64bytes
  361.  351   2                      
  362.  352   2                      //Bulk Out MaxPacketSize Endpoint
  363.  353   2                      D14_Cntrl_Reg.D14_ENDPT_INDEX = 4;//选择端点
  364.  354   2                      D14_Cntrl_Reg.D14_ENDPT_MAXPKTSIZE.VALUE = 0x0002;//FIFO=64bytes
  365.  355   2                      
  366.  356   2                      //Bulk In MaxPacketSize Endpoint
  367.  357   2                      D14_Cntrl_Reg.D14_ENDPT_INDEX = 5;//选择端点
  368.  358   2                      D14_Cntrl_Reg.D14_ENDPT_MAXPKTSIZE.VALUE = 0x0002;//FIFO=64bytes
  369.  359   2                      
  370.  360   2                      
  371.  361   2                      //Iso Out MaxPacketSize Endpoint
  372.  362   2                      D14_Cntrl_Reg.D14_ENDPT_INDEX = 6;//选择端点
  373.  363   2                      D14_Cntrl_Reg.D14_ENDPT_MAXPKTSIZE.VALUE = 0x4000;//FIFO=64bytes
  374.  364   2                      
  375.  365   2                      //Iso In MaxPacketSize Endpoint
  376. C51 COMPILER V7.06   INIT                                                                  07/02/2003 10:27:48 PAGE 7   
  377.  366   2                      D14_Cntrl_Reg.D14_ENDPT_INDEX = 7;//选择端点
  378.  367   2                      D14_Cntrl_Reg.D14_ENDPT_MAXPKTSIZE.VALUE = 0x4000;//FIFO=64bytes
  379.  368   2                      
  380.  369   2                      //设置高速端点类型
  381.  370   2      
  382.  371   2                      //Interrupt In Endpoint Type
  383.  372   2                      D14_Cntrl_Reg.D14_ENDPT_INDEX = 2;//选择端点
  384.  373   2                      D14_Cntrl_Reg.D14_ENDPT_TYPE.VALUE = 0x1700;
  385.  374   2                      
  386.  375   2                      
  387.  376   2                      //Interrupt Out Endpoint Type
  388.  377   2                      D14_Cntrl_Reg.D14_ENDPT_INDEX = 3;//选择端点
  389.  378   2                      D14_Cntrl_Reg.D14_ENDPT_TYPE.VALUE = 0x1700;
  390.  379   2                      
  391.  380   2                      
  392.  381   2                      //Bulk Out Endpoint Type
  393.  382   2                      D14_Cntrl_Reg.D14_ENDPT_INDEX = 4;//选择端点
  394.  383   2                      D14_Cntrl_Reg.D14_ENDPT_TYPE.VALUE = 0x1600;
  395.  384   2                      
  396.  385   2                      
  397.  386   2                      //Bulk In Endpoint Type
  398.  387   2                      D14_Cntrl_Reg.D14_ENDPT_INDEX = 5;//选择端点
  399.  388   2                      D14_Cntrl_Reg.D14_ENDPT_TYPE.VALUE = 0x1600;
  400.  389   2                      
  401.  390   2                      
  402.  391   2                      //Iso Out Endpoint Type
  403.  392   2                      D14_Cntrl_Reg.D14_ENDPT_INDEX = 6;//选择端点
  404.  393   2                      D14_Cntrl_Reg.D14_ENDPT_TYPE.VALUE = 0x1500;
  405.  394   2                      
  406.  395   2                      
  407.  396   2                      //Iso In Endpoint Type
  408.  397   2                      D14_Cntrl_Reg.D14_ENDPT_INDEX = 7;//选择端点
  409.  398   2                      D14_Cntrl_Reg.D14_ENDPT_TYPE.VALUE = 0x1500;
  410.  399   2                      
  411.  400   2                      //端点使能                              
  412.  401   2      
  413.  402   2                      //enable FIFO
  414.  403   2                      D14_Cntrl_Reg.D14_ENDPT_INDEX = 2;//选择端点
  415.  404   2                      D14_Cntrl_Reg.D14_ENDPT_TYPE.VALUE |= 0x0800;                   
  416.  405   2                      
  417.  406   2                      //enable FIFO
  418.  407   2                      D14_Cntrl_Reg.D14_ENDPT_INDEX = 3;//选择端点
  419.  408   2                      D14_Cntrl_Reg.D14_ENDPT_TYPE.VALUE |= 0x0800;                   
  420.  409   2                      
  421.  410   2                      //enable FIFO
  422.  411   2                      D14_Cntrl_Reg.D14_ENDPT_INDEX = 4;//选择端点
  423.  412   2                      D14_Cntrl_Reg.D14_ENDPT_TYPE.VALUE |= 0x0800;                   
  424.  413   2                      
  425.  414   2                      //enable FIFO
  426.  415   2                      D14_Cntrl_Reg.D14_ENDPT_INDEX = 5;//选择端点
  427.  416   2                      D14_Cntrl_Reg.D14_ENDPT_TYPE.VALUE |= 0x0800;                   
  428.  417   2                      
  429.  418   2                      //enable FIFO
  430.  419   2                      D14_Cntrl_Reg.D14_ENDPT_INDEX = 6;//选择端点
  431.  420   2                      D14_Cntrl_Reg.D14_ENDPT_TYPE.VALUE |= 0x0800;                   
  432.  421   2                      
  433.  422   2                      //enable FIFO
  434.  423   2                      D14_Cntrl_Reg.D14_ENDPT_INDEX = 7;//选择端点
  435.  424   2                      D14_Cntrl_Reg.D14_ENDPT_TYPE.VALUE |= 0x0800;
  436.  425   2                      
  437.  426   2              }
  438.  427   1              
  439. C51 COMPILER V7.06   INIT                                                                  07/02/2003 10:27:48 PAGE 8   
  440.  428   1              //设置默认地址有效
  441.  429   1              D14_Cntrl_Reg.D14_ADDRESS.VALUE = 0x80;         
  442.  430   1      }
  443.  431          
  444.  432          
  445.  433          
  446.  434          
  447.  435          
  448.  436          
  449.  437          
  450.  438          
  451.  439          
  452.  440          
  453.  441          
  454.  442          
  455.  443          
  456.  444          
  457.  445          
  458.  446          
  459.  447          
  460.  448          
  461.  449          
  462.  450          
  463.  451          
  464.  452          
  465.  453          
  466.  454          
  467.  455          
  468.  456          
  469. MODULE INFORMATION:   STATIC OVERLAYABLE
  470.    CODE SIZE        =    976    ----
  471.    CONSTANT SIZE    =   ----    ----
  472.    XDATA SIZE       =   ----    ----
  473.    PDATA SIZE       =   ----    ----
  474.    DATA SIZE        =     12    ----
  475.    IDATA SIZE       =      4    ----
  476.    BIT SIZE         =   ----    ----
  477. END OF MODULE INFORMATION.
  478. C51 COMPILATION COMPLETE.  0 WARNING(S),  0 ERROR(S)