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

📄 usbddriver.lst

📁 本代bootloader通过usb下载代码首先存放在sdram中
💻 LST
📖 第 1 页 / 共 3 页
字号:
    254          
    255                          // Adjust length and send descriptor
    256                          if (length > USBGenericDescriptor_GetLength((USBGenericDescriptor *) pQualifier)) {
   \   0000010C   0A00A0E1           MOV      R0,R10
   \   00000110   ........           BL       USBGenericDescriptor_GetLength
   \   00000114   060050E1           CMP      R0,R6
   \   00000118   0200002A           BCS      ??GetDescriptor_13
    257          
    258                              length = USBGenericDescriptor_GetLength((USBGenericDescriptor *) pQualifier);
   \   0000011C   0A00A0E1           MOV      R0,R10
   \   00000120   ........           BL       USBGenericDescriptor_GetLength
   \   00000124   0060A0E1           MOV      R6,R0
    259                          }
    260                          USBD_Write(0, pQualifier, length, 0, 0);
   \                     ??GetDescriptor_13:
   \   00000128   08D04DE2           SUB      SP,SP,#+8
   \   0000012C   0000A0E3           MOV      R0,#+0
   \   00000130   00008DE5           STR      R0,[SP, #+0]
   \   00000134   0030A0E3           MOV      R3,#+0
   \   00000138   0620A0E1           MOV      R2,R6
   \   0000013C   0A10A0E1           MOV      R1,R10
   \   00000140   100000EA           B        ??GetDescriptor_7
    261                      }
    262                      break;
    263          
    264                  case USBGenericDescriptor_OTHERSPEEDCONFIGURATION:
    265                      TRACE_INFO_WP("OSC ");
   \                     ??GetDescriptor_14:
   \   00000144   C0009FE5           LDR      R0,??GetDescriptor_9+0x8  ;; `?<Constant "OSC ">`
   \   00000148   ........           BL       printf
    266          
    267                      // Check if descriptor exists
    268                      if (!pOtherSpeed) {
   \   0000014C   00005BE3           CMP      R11,#+0
   \   00000150   2800000A           BEQ      ??GetDescriptor_12
    269          
    270                          USBD_Stall(0);
    271                      }
    272                      else {
    273          
    274                          // Adjust length and send descriptor
    275                          if (length > USBConfigurationDescriptor_GetTotalLength(pOtherSpeed)) {
   \   00000154   0B00A0E1           MOV      R0,R11
   \   00000158   ........           BL       USBConfigurationDescriptor_GetTotalLength
   \   0000015C   060050E1           CMP      R0,R6
   \   00000160   0200002A           BCS      ??GetDescriptor_15
    276          
    277                              length = USBConfigurationDescriptor_GetTotalLength(pOtherSpeed);
   \   00000164   0B00A0E1           MOV      R0,R11
   \   00000168   ........           BL       USBConfigurationDescriptor_GetTotalLength
   \   0000016C   0060A0E1           MOV      R6,R0
    278                          }
    279                          USBD_Write(0, pOtherSpeed, length, 0, 0);
   \                     ??GetDescriptor_15:
   \   00000170   08D04DE2           SUB      SP,SP,#+8
   \   00000174   0000A0E3           MOV      R0,#+0
   \   00000178   00008DE5           STR      R0,[SP, #+0]
   \   0000017C   0030A0E3           MOV      R3,#+0
   \   00000180   0620A0E1           MOV      R2,R6
   \   00000184   0B10A0E1           MOV      R1,R11
   \                     ??GetDescriptor_7:
   \   00000188   ........           BL       USBD_Write
   \   0000018C   08D08DE2           ADD      SP,SP,#+8        ;; stack cleaning
   \   00000190   F84FBDE8           POP      {R3-R11,LR}
   \   00000194   1EFF2FE1           BX       LR
    280                      }
    281                      break;
    282          
    283                  case USBGenericDescriptor_STRING:
    284                      TRACE_INFO_WP("Str%d ", index);
   \                     ??GetDescriptor_16:
   \   00000198   0510A0E1           MOV      R1,R5
   \   0000019C   6C009FE5           LDR      R0,??GetDescriptor_9+0xC  ;; `?<Constant "Str%d ">`
   \   000001A0   ........           BL       printf
    285          
    286                      // Check if descriptor exists
    287                      if (index > numStrings) {
   \   000001A4   050057E1           CMP      R7,R5
   \   000001A8   1200003A           BCC      ??GetDescriptor_12
    288          
    289                          USBD_Stall(0);
    290                      }
    291                      else {
    292          
    293                          pString = pStrings[index];
   \   000001AC   00009DE5           LDR      R0,[SP, #+0]
   \   000001B0   054190E7           LDR      R4,[R0, +R5, LSL #+2]
    294          
    295                          // Adjust length and send descriptor
    296                          if (length > USBGenericDescriptor_GetLength(pString)) {
   \   000001B4   0400A0E1           MOV      R0,R4
   \   000001B8   ........           BL       USBGenericDescriptor_GetLength
   \   000001BC   060050E1           CMP      R0,R6
   \   000001C0   0200002A           BCS      ??GetDescriptor_17
    297          
    298                              length = USBGenericDescriptor_GetLength(pString);
   \   000001C4   0400A0E1           MOV      R0,R4
   \   000001C8   ........           BL       USBGenericDescriptor_GetLength
   \   000001CC   0060A0E1           MOV      R6,R0
    299                          }
    300                          USBD_Write(0, pString, length, 0, 0);
   \                     ??GetDescriptor_17:
   \   000001D0   08D04DE2           SUB      SP,SP,#+8
   \   000001D4   0000A0E3           MOV      R0,#+0
   \   000001D8   00008DE5           STR      R0,[SP, #+0]
   \   000001DC   0030A0E3           MOV      R3,#+0
   \   000001E0   0620A0E1           MOV      R2,R6
   \   000001E4   0410A0E1           MOV      R1,R4
   \   000001E8   E6FFFFEA           B        ??GetDescriptor_7
    301                      }
    302                      break;
    303          
    304                  default:
    305                      TRACE_WARNING(
    306                                "USBDDriver_GetDescriptor: Unknown descriptor type (%d)\n\r",
    307                                type);
   \                     ??GetDescriptor_3:
   \   000001EC   0410A0E1           MOV      R1,R4
   \   000001F0   1C009FE5           LDR      R0,??GetDescriptor_9+0x10  ;; `?<Constant "-W- USBDDriver_GetDes...">`
   \   000001F4   ........           BL       printf
    308                      USBD_Stall(0);
   \                     ??GetDescriptor_12:
   \   000001F8   0000A0E3           MOV      R0,#+0
    309              }
    310          }
   \   000001FC   F84FBDE8           POP      {R3-R11,LR}
   \   00000200   ........           B        USBD_Stall       ;; tailcall
   \                     ??GetDescriptor_9:
   \   00000204   ........           DC32     `?<Constant "Cfg ">`
   \   00000208   ........           DC32     `?<Constant "Qua ">`
   \   0000020C   ........           DC32     `?<Constant "OSC ">`
   \   00000210   ........           DC32     `?<Constant "Str%d ">`
   \   00000214   ........           DC32     `?<Constant "-W- USBDDriver_GetDes...">`
    311          
    312          //------------------------------------------------------------------------------
    313          /// Sets the active setting of the given interface if the configuration supports
    314          /// it; otherwise, the control pipe is STALLed. If the setting of an interface
    315          /// changes.
    316          /// \parma pDriver  Pointer to a USBDDriver instance.
    317          /// \parma infnum  Interface number.
    318          /// \parma setting  New active setting for the interface.
    319          //------------------------------------------------------------------------------

   \                                 In section .text, align 4, keep-with-next
    320          static void SetInterface(
    321              USBDDriver *pDriver,
    322              unsigned char infnum,
    323              unsigned char setting)
    324          {
   \                     SetInterface:
   \   00000000   01402DE9           PUSH     {R0,LR}
   \   00000004   0130A0E1           MOV      R3,R1
   \   00000008   0210A0E1           MOV      R1,R2
    325              // Make sure alternate settings are supported
    326              if (!pDriver->pInterfaces) {
   \   0000000C   042090E5           LDR      R2,[R0, #+4]
   \   00000010   000052E3           CMP      R2,#+0
   \   00000014   0000001A           BNE      ??SetInterface_0
    327          
    328                  USBD_Stall(0);
   \   00000018   ........           B        ?Subroutine1
    329              }
    330              else {
    331          
    332                  // Change the current setting of the interface and trigger the callback 
    333                  // if necessary
    334                  if (pDriver->pInterfaces[infnum] != setting) {
   \                     ??SetInterface_0:
   \   0000001C   02C0A0E1           MOV      R12,R2
   \   00000020   0C20D3E7           LDRB     R2,[R3, +R12]
   \   00000024   010052E1           CMP      R2,R1
    335          
    336                      pDriver->pInterfaces[infnum] = setting;
   \   00000028   0C10C317           STRBNE   R1,[R3, +R12]
    337                      USBDDriverCallbacks_InterfaceSettingChanged(infnum, setting);
   \   0000002C   0300A011           MOVNE    R0,R3
   \   00000030   ........           BLNE     USBDDriverCallbacks_InterfaceSettingChanged
    338                  }
    339          
    340                  // Acknowledge the request
    341                  USBD_Write(0, 0, 0, 0, 0);
   \   00000034   08D04DE2           SUB      SP,SP,#+8
   \   00000038   0000A0E3           MOV      R0,#+0
   \   0000003C   00008DE5           STR      R0,[SP, #+0]
   \   00000040   0030A0E3           MOV      R3,#+0
   \   00000044   0020A0E1           MOV      R2,R0
   \   00000048   0010A0E1           MOV      R1,R0
   \   0000004C   ........           B        ??Subroutine0_0
    342              }
    343          }

   \                                 In section .text, align 4, keep-with-next
   \                     ?Subroutine1:
   \   00000000   0000A0E3           MOV      R0,#+0
   \   00000004   0050BDE8           POP      {R12,LR}
   \   00000008   ........           B        USBD_Stall       ;; tailcall
    344          
    345          //------------------------------------------------------------------------------
    346          /// Sends the currently active setting of the given interface to the USB
    347          /// host. If alternate settings are not supported, this function STALLs the
    348          /// control pipe.
    349          /// \param pDriver  Pointer to a USBDDriver instance.
    350          /// \param infnum  Interface number.
    351          //------------------------------------------------------------------------------

   \                                 In section .text, align 4, keep-with-next
    352          static void GetInterface(
    353              const USBDDriver *pDriver,
    354              unsigned char infnum)
    355          {
   \                     GetInterface:
   \   00000000   01402DE9           PUSH     {R0,LR}
    356              // Make sure alternate settings are supported, or STALL the control pipe
    357              if (!pDriver->pInterfaces) {
   \   00000004   042090E5           LDR      R2,[R0, #+4]
   \   00000008   000052E3           CMP      R2,#+0
   \   0000000C   0000001A           BNE      ??GetInterface_0
    358          
    359                  USBD_Stall(0);
   \   00000010   ........           B        ?Subroutine1
    360              }
    361              else {
    362          
    363                  // Sends the current interface setting to the host
    364                  USBD_Write(0, &(pDriver->pInterfaces[infnum]), 1, 0, 0);
   \                     ??GetInterface_0:
   \   00000014   08D04DE2           SUB      SP,SP,#+8
   \   00000018   0020A0E3           MOV      R2,#+0
   \   0000001C   00208DE5           STR      R2,[SP, #+0]
   \   00000020   0030A0E3           MOV      R3,#+0
   \   00000024   0120A0E3           MOV      R2,#+1
   \   00000028   040090E5           LDR      R0,[R0, #+4]
   \   0000002C   001081E0           ADD      R1,R1,R0
   \   00000030   ........           B        ?Subroutine0
    365              }
    366          }
    367          
    368          #ifdef BOARD_USB_UDPHS
    369          //------------------------------------------------------------------------------
    370          // Performs the selected test on the USB device (high-speed only).
    371          // \param test  Test selector value.
    372          //------------------------------------------------------------------------------
    373          static void USBDDriver_Test(unsigned char test)
    374          {
    375              TRACE_DEBUG("UDPHS_Test\n\r");
    376          
    377              // the lower byte of wIndex must be zero
    378              // the most significant byte of wIndex is used to specify the specific test mode
    379              switch (test) {
    380                  case USBFeatureRequest_TESTPACKET:
    381                      //Test mode Test_Packet: 
    382                      //Upon command, a port must repetitively transmit the following test packet until
    383                      //the exit action is taken. This enables the testing of rise and fall times, eye 
    384                      //patterns, jitter, and any other dynamic waveform specifications.
    385                      //The test packet is made up by concatenating the following strings. 
    386                      //(Note: For J/K NRZI data, and for NRZ data, the bit on the left is the first one 
    387                      //transmitted. 揝

⌨️ 快捷键说明

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