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

📄 usb_core.txt

📁 MP3_PLAYER.rar
💻 TXT
📖 第 1 页 / 共 5 页
字号:
000068  4805              LDR      r0,|L7.128|
00006a  6800              LDR      r0,[r0,#0]            ;371  ; pUser_Standard_Requests
00006c  6980              LDR      r0,[r0,#0x18]         ;371
00006e  4780              BLX      r0                    ;371
000070  2000              MOVS     r0,#0                 ;372
000072  bd70              POP      {r4-r6,pc}
;;;374    
                          ENDP

                  |L7.116|
000074  00000000          DCD      pInformation
                  |L7.120|
000078  40005000          DCD      0x40005000
                  |L7.124|
00007c  00000000          DCD      Device_Table
                  |L7.128|
000080  00000000          DCD      pUser_Standard_Requests

                          AREA ||i.Standard_SetDeviceFeature||, CODE, READONLY, ALIGN=2

                  Standard_SetDeviceFeature PROC
000000  b510              PUSH     {r4,lr}
000002  4806              LDR      r0,|L8.28|
000004  6800              LDR      r0,[r0,#0]  ; pInformation
000006  7a41              LDRB     r1,[r0,#9]
000008  f0410120          ORR      r1,r1,#0x20
00000c  7241              STRB     r1,[r0,#9]
00000e  4804              LDR      r0,|L8.32|
000010  6800              LDR      r0,[r0,#0]  ; pUser_Standard_Requests
000012  69c0              LDR      r0,[r0,#0x1c]
000014  4780              BLX      r0
000016  2000              MOVS     r0,#0
000018  bd10              POP      {r4,pc}
                          ENDP

00001a  0000              DCW      0x0000
                  |L8.28|
00001c  00000000          DCD      pInformation
                  |L8.32|
000020  00000000          DCD      pUser_Standard_Requests

                          AREA ||i.Standard_GetDescriptorData||, CODE, READONLY, ALIGN=2

                  Standard_GetDescriptorData PROC
;;;412    
;;;413      wOffset = pInformation->Ctrl_Info.Usb_wOffset;
000000  4a06              LDR      r2,|L9.28|
;;;414      if (Length == 0)
000002  2800              CMP      r0,#0
000004  6812              LDR      r2,[r2,#0]            ;413  ; pInformation
000006  8a50              LDRH     r0,[r2,#0x12]         ;413
000008  d104              BNE      |L9.20|
;;;415      {
;;;416        pInformation->Ctrl_Info.Usb_wLength = pDesc->Descriptor_Size - wOffset;
00000a  8889              LDRH     r1,[r1,#4]
00000c  1a08              SUBS     r0,r1,r0
00000e  8210              STRH     r0,[r2,#0x10]
;;;417        return 0;
000010  2000              MOVS     r0,#0
;;;418      }
;;;419    
;;;420      return pDesc->Descriptor + wOffset;
;;;421    }
000012  4770              BX       lr
                  |L9.20|
000014  6809              LDR      r1,[r1,#0]            ;420
000016  4408              ADD      r0,r0,r1              ;420
000018  4770              BX       lr
;;;422    
                          ENDP

00001a  0000              DCW      0x0000
                  |L9.28|
00001c  00000000          DCD      pInformation

                          AREA ||i.DataStageIn||, CODE, READONLY, ALIGN=2

                  DataStageIn PROC
;;;487    void DataStageIn(void)
;;;488    {
000000  e92d47f0          PUSH     {r4-r10,lr}
;;;489      ENDPOINT_INFO *pEPinfo = &pInformation->Ctrl_Info;
000004  f8df8074          LDR      r8,|L10.124|
;;;490      u32 save_wLength = pEPinfo->Usb_wLength;
;;;491      u32 ControlState = pInformation->ControlState;
000008  f8df9074          LDR      r9,|L10.128|
00000c  f8d81000          LDR      r1,[r8,#0]            ;489  ; pInformation
000010  f1010410          ADD      r4,r1,#0x10           ;489
000014  8a08              LDRH     r0,[r1,#0x10]         ;490
000016  7a09              LDRB     r1,[r1,#8]
;;;492    
;;;493      u8 *DataBuffer;
;;;494      u32 Length;
;;;495    
;;;496      if ((save_wLength == 0) && (ControlState == LAST_IN_DATA))
000018  b930              CBNZ     r0,|L10.40|
00001a  2904              CMP      r1,#4
00001c  d104              BNE      |L10.40|
;;;497      {
;;;498        /* no more data to send so STALL the TX Status*/
;;;499        ControlState = WAIT_STATUS_OUT;
00001e  2707              MOVS     r7,#7
;;;500        vSetEPTxStatus(EP_TX_STALL);
000020  2010              MOVS     r0,#0x10
000022  f8a90000          STRH     r0,[r9,#0]  ; SaveTState
;;;501        goto Expect_Status_Out;
000026  e024              B        |L10.114|
                  |L10.40|
;;;502      }
;;;503    
;;;504      Length = pEPinfo->PacketSize;
000028  88a5              LDRH     r5,[r4,#4]
;;;505      ControlState = (save_wLength <= Length) ? LAST_IN_DATA : IN_DATA;
00002a  2704              MOVS     r7,#4
00002c  42a8              CMP      r0,r5
00002e  d900              BLS      |L10.50|
000030  2702              MOVS     r7,#2
                  |L10.50|
;;;506    
;;;507      if (Length > save_wLength)
000032  4285              CMP      r5,r0
000034  d900              BLS      |L10.56|
;;;508      {
;;;509        Length = save_wLength;
000036  4605              MOV      r5,r0
                  |L10.56|
;;;510      }
;;;511    
;;;512      DataBuffer = (*pEPinfo->CopyData)(Length);
000038  b2a8              UXTH     r0,r5
00003a  68a1              LDR      r1,[r4,#8]
00003c  4606              MOV      r6,r0
00003e  4788              BLX      r1
000040  4682              MOV      r10,r0
;;;513    
;;;514      UserToPMABufferCopy(DataBuffer, GetEPTxAddr(ENDP0), Length);
000042  2000              MOVS     r0,#0
000044  f7fffffe          BL       GetEPTxAddr
000048  4601              MOV      r1,r0
00004a  4632              MOV      r2,r6
00004c  4650              MOV      r0,r10
00004e  f7fffffe          BL       UserToPMABufferCopy
;;;515    
;;;516      SetEPTxCount(ENDP0, Length);
000052  4631              MOV      r1,r6
000054  2000              MOVS     r0,#0
000056  f7fffffe          BL       SetEPTxCount
;;;517    
;;;518      pEPinfo->Usb_wLength -= Length;
00005a  8820              LDRH     r0,[r4,#0]
;;;519      pEPinfo->Usb_wOffset += Length;
;;;520      vSetEPTxStatus(EP_TX_VALID);
;;;521    
;;;522      USB_StatusOut();/* Expect the host to abort the data IN stage */
00005c  4909              LDR      r1,|L10.132|
00005e  1b40              SUBS     r0,r0,r5              ;518
000060  8020              STRH     r0,[r4,#0]            ;518
000062  8860              LDRH     r0,[r4,#2]            ;519
000064  4428              ADD      r0,r0,r5              ;519
000066  8060              STRH     r0,[r4,#2]            ;519
000068  2030              MOVS     r0,#0x30              ;520
00006a  f8a90000          STRH     r0,[r9,#0]            ;520  ; SaveTState
00006e  0200              LSLS     r0,r0,#8
000070  8008              STRH     r0,[r1,#0]  ; SaveRState
                  |L10.114|
;;;523    
;;;524    Expect_Status_Out:
;;;525      pInformation->ControlState = ControlState;
000072  f8d80000          LDR      r0,[r8,#0]  ; pInformation
000076  7207              STRB     r7,[r0,#8]
;;;526    }
000078  e8bd87f0          POP      {r4-r10,pc}
;;;527    
                          ENDP

                  |L10.124|
00007c  00000000          DCD      pInformation
                  |L10.128|
000080  00000000          DCD      SaveTState
                  |L10.132|
000084  00000000          DCD      SaveRState

                          AREA ||i.NoData_Setup0||, CODE, READONLY, ALIGN=2

                  NoData_Setup0 PROC
;;;535    void NoData_Setup0(void)
;;;536    {
000000  b570              PUSH     {r4-r6,lr}
;;;537      RESULT Result = USB_UNSUPPORT;
;;;538      u32 RequestNo = pInformation->USBbRequest;
000002  4d30              LDR      r5,|L11.196|
;;;539      u32 ControlState;
;;;540    
;;;541      if (Type_Recipient == (STANDARD_REQUEST | DEVICE_RECIPIENT))
000004  6828              LDR      r0,[r5,#0]  ; pInformation
000006  7801              LDRB     r1,[r0,#0]
000008  7844              LDRB     r4,[r0,#1]            ;538
00000a  064a              LSLS     r2,r1,#25
00000c  d128              BNE      |L11.96|
;;;542      {
;;;543        /* Device Request*/
;;;544        /* SET_CONFIGURATION*/
;;;545        if (RequestNo == SET_CONFIGURATION)
00000e  2c09              CMP      r4,#9
000010  d102              BNE      |L11.24|
;;;546        {
;;;547          Result = Standard_SetConfiguration();
000012  f7fffffe          BL       Standard_SetConfiguration
000016  e037              B        |L11.136|
                  |L11.24|
;;;548        }
;;;549    
;;;550        /*SET ADDRESS*/
;;;551        else if (RequestNo == SET_ADDRESS)
000018  2c05              CMP      r4,#5
00001a  d109              BNE      |L11.48|
;;;552        {
;;;553          if ((pInformation->USBwValue0 > 127) || (pInformation->USBwValue1 != 0)
00001c  78c1              LDRB     r1,[r0,#3]
00001e  297f              CMP      r1,#0x7f
000020  d83e              BHI      |L11.160|
000022  7881              LDRB     r1,[r0,#2]
000024  2900              CMP      r1,#0
000026  d13b              BNE      |L11.160|
;;;554              || (pInformation->USBwIndex != 0)
000028  8881              LDRH     r1,[r0,#4]
00002a  bbb9              CBNZ     r1,|L11.156|
;;;555              || (pInformation->Current_Configuration != 0))
00002c  7a80              LDRB     r0,[r0,#0xa]
00002e  e036              B        |L11.158|
                  |L11.48|
;;;556            /* Device Address should be 127 or less*/
;;;557          {
;;;558            ControlState = STALLED;
;;;559            goto exit_NoData_Setup0;
;;;560          }
;;;561          else
;;;562          {
;;;563            Result = USB_SUCCESS;
;;;564          }
;;;565        }
;;;566        /*SET FEATURE for Device*/
;;;567        else if (RequestNo == SET_FEATURE)
000030  2c03              CMP      r4,#3
000032  d10a              BNE      |L11.74|
;;;568        {
;;;569          if ((pInformation->USBwValue0 == DEVICE_REMOTE_WAKEUP)
000034  78c1              LDRB     r1,[r0,#3]
000036  2901              CMP      r1,#1
000038  d127              BNE      |L11.138|
;;;570              && (pInformation->USBwIndex == 0)
00003a  8881              LDRH     r1,[r0,#4]
00003c  bb29              CBNZ     r1,|L11.138|
;;;571              && (ValBit(pInformation->Current_Feature, 5)))
00003e  7a40              LDRB     r0,[r0,#9]
000040  0680              LSLS     r0,r0,#26
000042  d522              BPL      |L11.138|
;;;572          {
;;;573            Result = Standard_SetDeviceFeature();
000044  f7fffffe          BL       Standard_SetDeviceFeature
000048  e01e              B        |L11.136|
                  |L11.74|
;;;574          }
;;;575          else
;;;576          {
;;;577            Result = USB_UNSUPPORT;
;;;578          }
;;;579        }
;;;580        /*Clear FEATURE for Device */
;;;581        else if (RequestNo == CLEAR_FEATURE)
00004a  2c01              CMP      r4,#1
00004c  d11d              BNE      |L11.138|
;;;582        {
;;;583          if (pInformation->USBwValue0 == DEVICE_REMOTE_WAKEUP
00004e  78c1              LDRB     r1,[r0,#3]
000050  2901              CMP      r1,#1
000052  d11a              BNE      |L11.138|
;;;584              && pInformation->USBwIndex == 0
000054  8881              LDRH     r1,[r0,#4]
000056  b9c1              CBNZ     r1,|L11.138|
;;;585              && ValBit(pInformation->Current_Feature, 5))
000058  7a40              LDRB     r0,[r0,#9]
00005a  0680              LSLS     r0,r0,#26
00005c  d515              BPL      |L11.138|
00005e  e00c              B        |L11.122|
                  |L11.96|
;;;586          {
;;;587            Result = Standard_ClearFeature();
;;;588          }
;;;589          else
;;;590          {
;;;591            Result = USB_UNSUPPORT;
;;;592          }
;;;593        }
;;;594    
;;;595      }
;;;596    
;;;597      /* Interface Request*/
;;;598      else if (Type_Recipient == (STANDARD_REQUEST | INTERFACE_RECIPIENT))
000060  f001007f          AND      r0,r1,#0x7f
000064  2801              CMP      r0,#1
000066  d104              BNE      |L11.114|
;;;599      {
;;;600        /*SET INTERFACE*/
;;;601        if (RequestNo == SET_INTERFACE)
000068  2c0b              CMP      r4,#0xb
00006a  d10e              BNE      |L11.138|
;;;602        {
;;;603          Result = Standard_SetInterface();
00006c  f7fffffe          BL       Standard_SetInterface
000070  e00a              B        |L11.136|
                  |L11.114|
;;;604        }
;;;605      }
;;;606    
;;;607      /* EndPoint Request*/
;;;608      else if (Type_Recipient == (STANDARD_REQUEST | ENDPOINT_RECIPIENT))
000072  2802              CMP      r0,#2
000074  d109              BNE      |L11.138|
;;;609      {
;;;610        /*CLEAR FEATURE for EndPoint*/

⌨️ 快捷键说明

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