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

📄 usbddriver.lst

📁 ATmel的AT91sam7SE芯片 USB固件开发源代码
💻 LST
📖 第 1 页 / 共 5 页
字号:
###############################################################################
#                                                                             #
#                                                       29/Jul/2008  16:07:19 #
# IAR ARM ANSI C/C++ Compiler V5.11.0.20622/W32 EVALUATION                    #
# Copyright 1999-2007 IAR Systems. All rights reserved.                       #
#                                                                             #
#    Cpu mode     =  arm                                                      #
#    Endian       =  little                                                   #
#    Source file  =  D:\rock\atarm\at91sam7se\software\usb-device-core-projec #
#                    t-1.3-iar5-at91sam7se-ek\at91lib\usb\device\core\USBDDri #
#                    ver.c                                                    #
#    Command line =  D:\rock\atarm\at91sam7se\software\usb-device-core-projec #
#                    t-1.3-iar5-at91sam7se-ek\at91lib\usb\device\core\USBDDri #
#                    ver.c -D at91sam7se512 -lC D:\rock\atarm\at91sam7se\soft #
#                    ware\usb-device-core-project-1.3-iar5-at91sam7se-ek\at91 #
#                    sam7se-ek\usb-device-core-project\ewp\at91sam7se512_sdra #
#                    m\List\ --remarks -o D:\rock\atarm\at91sam7se\software\u #
#                    sb-device-core-project-1.3-iar5-at91sam7se-ek\at91sam7se #
#                    -ek\usb-device-core-project\ewp\at91sam7se512_sdram\Obj\ #
#                     --no_cse --no_unroll --no_inline --no_code_motion       #
#                    --no_tbaa --no_clustering --no_scheduling --debug        #
#                    --endian little --cpu ARM7TDMI -e --fpu None             #
#                    --dlib_config "D:\Program Files\IAR Systems\Embedded     #
#                    Workbench 5.0 Evaluation\ARM\INC\DLib_Config_Full.h" -I  #
#                    D:\rock\atarm\at91sam7se\software\usb-device-core-projec #
#                    t-1.3-iar5-at91sam7se-ek\at91sam7se-ek\usb-device-core-p #
#                    roject\ewp\..\..\..\at91lib\ -I                          #
#                    D:\rock\atarm\at91sam7se\software\usb-device-core-projec #
#                    t-1.3-iar5-at91sam7se-ek\at91sam7se-ek\usb-device-core-p #
#                    roject\ewp\..\..\..\at91lib\boards\at91sam7se-ek\ -I     #
#                    D:\rock\atarm\at91sam7se\software\usb-device-core-projec #
#                    t-1.3-iar5-at91sam7se-ek\at91sam7se-ek\usb-device-core-p #
#                    roject\ewp\..\..\..\at91lib\peripherals\ -I              #
#                    D:\rock\atarm\at91sam7se\software\usb-device-core-projec #
#                    t-1.3-iar5-at91sam7se-ek\at91sam7se-ek\usb-device-core-p #
#                    roject\ewp\..\..\..\at91lib\components\ -I               #
#                    D:\rock\atarm\at91sam7se\software\usb-device-core-projec #
#                    t-1.3-iar5-at91sam7se-ek\at91sam7se-ek\usb-device-core-p #
#                    roject\ewp\..\..\..\at91lib\usb\ -I "D:\Program          #
#                    Files\IAR Systems\Embedded Workbench 5.0                 #
#                    Evaluation\ARM\INC\" --interwork --cpu_mode arm -On      #
#    List file    =  D:\rock\atarm\at91sam7se\software\usb-device-core-projec #
#                    t-1.3-iar5-at91sam7se-ek\at91sam7se-ek\usb-device-core-p #
#                    roject\ewp\at91sam7se512_sdram\List\USBDDriver.lst       #
#    Object file  =  D:\rock\atarm\at91sam7se\software\usb-device-core-projec #
#                    t-1.3-iar5-at91sam7se-ek\at91sam7se-ek\usb-device-core-p #
#                    roject\ewp\at91sam7se512_sdram\Obj\USBDDriver.o          #
#                                                                             #
#                                                                             #
###############################################################################

D:\rock\atarm\at91sam7se\software\usb-device-core-project-1.3-iar5-at91sam7se-ek\at91lib\usb\device\core\USBDDriver.c
      1          /* ----------------------------------------------------------------------------
      2           *         ATMEL Microcontroller Software Support  -  ROUSSET  -
      3           * ----------------------------------------------------------------------------
      4           * Copyright (c) 2006, Atmel Corporation
      5          
      6           * All rights reserved.
      7           *
      8           * Redistribution and use in source and binary forms, with or without
      9           * modification, are permitted provided that the following conditions are met:
     10           *
     11           * - Redistributions of source code must retain the above copyright notice,
     12           * this list of conditions and the disclaiimer below.
     13           *
     14           * - Redistributions in binary form must reproduce the above copyright notice,
     15           * this list of conditions and the disclaimer below in the documentation and/or
     16           * other materials provided with the distribution.
     17           *
     18           * Atmel's name may not be used to endorse or promote products derived from
     19           * this software without specific prior written permission.
     20           *
     21           * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR
     22           * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
     23           * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
     24           * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,
     25           * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
     26           * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
     27           * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
     28           * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
     29           * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
     30           * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     31           * ----------------------------------------------------------------------------
     32           */
     33          
     34          //------------------------------------------------------------------------------
     35          //      Headers
     36          //------------------------------------------------------------------------------
     37          
     38          #include "USBDDriver.h"
     39          #include "USBDDriverCallbacks.h"
     40          #include "USBD.h"
     41          #include <board.h>
     42          #include <utility/trace.h>
     43          #include <usb/common/core/USBGenericDescriptor.h>
     44          #include <usb/common/core/USBDeviceDescriptor.h>
     45          #include <usb/common/core/USBConfigurationDescriptor.h>
     46          #include <usb/common/core/USBDeviceQualifierDescriptor.h>
     47          #include <usb/common/core/USBEndpointDescriptor.h>
     48          #include <usb/common/core/USBFeatureRequest.h>
     49          #include <usb/common/core/USBSetAddressRequest.h>
     50          #include <usb/common/core/USBGetDescriptorRequest.h>
     51          #include <usb/common/core/USBSetConfigurationRequest.h>
     52          #include <usb/common/core/USBInterfaceRequest.h>
     53          
     54          #include <string.h>

   \                                 In section .text, align 4
   \   __??Code32?? __intrinsic __code __interwork void *memset(void *, int, size_t)
   \                     memset:
   \   00000000   70402DE9           PUSH     {R4-R6,LR}
   \   00000004   0040B0E1           MOVS     R4,R0
   \   00000008   0150B0E1           MOVS     R5,R1
   \   0000000C   0260B0E1           MOVS     R6,R2
   \   00000010   0520B0E1           MOVS     R2,R5
   \   00000014   0610B0E1           MOVS     R1,R6
   \   00000018   0400B0E1           MOVS     R0,R4
   \   0000001C   ........           BL       __aeabi_memset
   \   00000020   0400B0E1           MOVS     R0,R4
   \   00000024   7040BDE8           POP      {R4-R6,LR}
   \   00000028   1EFF2FE1           BX       LR               ;; return
     55          
     56          //------------------------------------------------------------------------------
     57          //      Local functions
     58          //------------------------------------------------------------------------------
     59          
     60          //------------------------------------------------------------------------------
     61          /// Configures the device by setting it into the Configured state and
     62          /// initializing all endpoints.
     63          /// \param pDriver  Pointer to a USBDDriver instance.
     64          /// \param cfgnum  Configuration number to set.
     65          //------------------------------------------------------------------------------

   \                                 In section .text, align 4, keep-with-next
     66          static void SetConfiguration(USBDDriver *pDriver, unsigned char cfgnum)
     67          {
   \                     SetConfiguration:
   \   00000000   F0402DE9           PUSH     {R4-R7,LR}
   \   00000004   24D04DE2           SUB      SP,SP,#+36
   \   00000008   0040B0E1           MOVS     R4,R0
   \   0000000C   0150B0E1           MOVS     R5,R1
     68              USBEndpointDescriptor *pEndpoints[BOARD_USB_NUMENDPOINTS+1];
     69              const USBConfigurationDescriptor *pConfiguration;
     70          
     71              // Use different descriptor depending on device speed
     72              if (USBD_IsHighSpeed()) {
   \   00000010   ........           BL       USBD_IsHighSpeed
   \   00000014   000050E3           CMP      R0,#+0
   \   00000018   0300000A           BEQ      ??SetConfiguration_0
     73          
     74                  pConfiguration = pDriver->pDescriptors->pHsConfiguration;
   \   0000001C   000094E5           LDR      R0,[R4, #+0]
   \   00000020   140090E5           LDR      R0,[R0, #+20]
   \   00000024   0060B0E1           MOVS     R6,R0
   \   00000028   020000EA           B        ??SetConfiguration_1
     75              }
     76              else {
     77          
     78                  pConfiguration = pDriver->pDescriptors->pFsConfiguration;
   \                     ??SetConfiguration_0:
   \   0000002C   000094E5           LDR      R0,[R4, #+0]
   \   00000030   040090E5           LDR      R0,[R0, #+4]
   \   00000034   0060B0E1           MOVS     R6,R0
     79              }
     80          
     81              // Set & save the desired configuration
     82              USBD_SetConfiguration(cfgnum);
   \                     ??SetConfiguration_1:
   \   00000038   0500B0E1           MOVS     R0,R5
   \   0000003C   FF0010E2           ANDS     R0,R0,#0xFF      ;; Zero extend
   \   00000040   ........           BL       USBD_SetConfiguration
     83              pDriver->cfgnum = cfgnum;
   \   00000044   0850C4E5           STRB     R5,[R4, #+8]
     84          
     85              // If the configuration is not 0, configure endpoints
     86              if (cfgnum != 0) {
   \   00000048   FF5015E2           ANDS     R5,R5,#0xFF      ;; Zero extend
   \   0000004C   000055E3           CMP      R5,#+0
   \   00000050   1300000A           BEQ      ??SetConfiguration_2
     87              
     88                  // Parse configuration to get endpoint descriptors
     89                  USBConfigurationDescriptor_Parse(pConfiguration, 0, pEndpoints, 0);
   \   00000054   0030A0E3           MOV      R3,#+0
   \   00000058   0D20B0E1           MOVS     R2,SP
   \   0000005C   0010A0E3           MOV      R1,#+0
   \   00000060   0600B0E1           MOVS     R0,R6
   \   00000064   ........           BL       USBConfigurationDescriptor_Parse
     90              
     91                  // Configure endpoints
     92                  int i = 0;
   \   00000068   0000A0E3           MOV      R0,#+0
   \   0000006C   0070B0E1           MOVS     R7,R0
     93                  while (pEndpoints[i] != 0) {
   \                     ??SetConfiguration_3:
   \   00000070   0400A0E3           MOV      R0,#+4
   \   00000074   0D10B0E1           MOVS     R1,SP
   \   00000078   901721E0           MLA      R1,R0,R7,R1
   \   0000007C   000091E5           LDR      R0,[R1, #+0]
   \   00000080   000050E3           CMP      R0,#+0
   \   00000084   0600000A           BEQ      ??SetConfiguration_2
     94              
     95                      USBD_ConfigureEndpoint(pEndpoints[i]);
   \   00000088   0400A0E3           MOV      R0,#+4
   \   0000008C   0D10B0E1           MOVS     R1,SP
   \   00000090   901721E0           MLA      R1,R0,R7,R1
   \   00000094   000091E5           LDR      R0,[R1, #+0]
   \   00000098   ........           BL       USBD_ConfigureEndpoint
     96                      i++;
   \   0000009C   017097E2           ADDS     R7,R7,#+1
   \   000000A0   F2FFFFEA           B        ??SetConfiguration_3
     97                  }
     98              }
     99          
    100              // Acknowledge the request
    101              USBD_Write(0, // Endpoint #0
    102                         0, // No data buffer
    103                         0, // No data buffer
    104                         (TransferCallback) USBDDriverCallbacks_ConfigurationChanged,
    105                         (void *) (unsigned int) cfgnum);
   \                     ??SetConfiguration_2:
   \   000000A4   08D04DE2           SUB      SP,SP,#+8
   \   000000A8   0500B0E1           MOVS     R0,R5
   \   000000AC   FF0010E2           ANDS     R0,R0,#0xFF      ;; Zero extend
   \   000000B0   00008DE5           STR      R0,[SP, #+0]

⌨️ 快捷键说明

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