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

USB编程

开发平台:

C/C++

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