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

📄 usb_core.txt

📁 stm32.rar
💻 TXT
📖 第 1 页 / 共 5 页
字号:
00005e  4011              ANDS     r1,r1,r2              ;364
000060  f4815180          EOR      r1,r1,#0x1000         ;364
                  |L7.100|
000064  f8c01c00          STR      r1,[r0,#0xc00]        ;358
000068  4805              LDR      r0,|L7.128|
00006a  6800              LDR      r0,[r0,#0]            ;367  ; pUser_Standard_Requests
00006c  6980              LDR      r0,[r0,#0x18]         ;367
00006e  4780              BLX      r0                    ;367
000070  2000              MOVS     r0,#0                 ;368
000072  bd70              POP      {r4-r6,pc}
;;;370    
                          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
;;;408    
;;;409      wOffset = pInformation->Ctrl_Info.Usb_wOffset;
000000  4a06              LDR      r2,|L9.28|
;;;410      if (Length == 0)
000002  2800              CMP      r0,#0
000004  6812              LDR      r2,[r2,#0]            ;409  ; pInformation
000006  8a50              LDRH     r0,[r2,#0x12]         ;409
000008  d104              BNE      |L9.20|
;;;411      {
;;;412        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]
;;;413        return 0;
000010  2000              MOVS     r0,#0
;;;414      }
;;;415    
;;;416      return pDesc->Descriptor + wOffset;
;;;417    }
000012  4770              BX       lr
                  |L9.20|
000014  6809              LDR      r1,[r1,#0]            ;416
000016  4408              ADD      r0,r0,r1              ;416
000018  4770              BX       lr
;;;418    
                          ENDP

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

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

                  DataStageIn PROC
;;;483    void DataStageIn(void)
;;;484    {
000000  e92d5ff0          PUSH     {r4-r12,lr}
;;;485      ENDPOINT_INFO *pEPinfo = &pInformation->Ctrl_Info;
000004  f8df9098          LDR      r9,|L10.160|
;;;486      u32 save_wLength = pEPinfo->Usb_wLength;
;;;487      u32 ControlState = pInformation->ControlState;
000008  f8df8098          LDR      r8,|L10.164|
00000c  f8d91000          LDR      r1,[r9,#0]            ;485  ; pInformation
000010  f04f0a30          MOV      r10,#0x30
000014  8a08              LDRH     r0,[r1,#0x10]         ;486
000016  7a0e              LDRB     r6,[r1,#8]
000018  f1010410          ADD      r4,r1,#0x10           ;485
;;;488    
;;;489      u8 *DataBuffer;
;;;490      u32 Length;
;;;491    
;;;492      if ((save_wLength == 0) && (ControlState == LAST_IN_DATA))
00001c  b9b0              CBNZ     r0,|L10.76|
00001e  2e04              CMP      r6,#4
000020  d114              BNE      |L10.76|
;;;493      {
;;;494        if(Data_Mul_MaxPacketSize == TRUE)
000022  4921              LDR      r1,|L10.168|
000024  7808              LDRB     r0,[r1,#0]  ; Data_Mul_MaxPacketSize
000026  2801              CMP      r0,#1
000028  d10b              BNE      |L10.66|
;;;495        {
;;;496          /* No more data to send and empty packet */
;;;497          Send0LengthData();
00002a  4a20              LDR      r2,|L10.172|
00002c  2000              MOVS     r0,#0
00002e  6813              LDR      r3,[r2,#0]
000030  4a1f              LDR      r2,|L10.176|
000032  b29b              UXTH     r3,r3
000034  eb020243          ADD      r2,r2,r3,LSL #1
000038  6050              STR      r0,[r2,#4]
00003a  f8a8a000          STRH     r10,[r8,#0]  ; SaveTState
;;;498          ControlState = LAST_IN_DATA;
;;;499          Data_Mul_MaxPacketSize = FALSE;
00003e  7008              STRB     r0,[r1,#0]  ; Data_Mul_MaxPacketSize
000040  e029              B        |L10.150|
                  |L10.66|
;;;500        }
;;;501        else 
;;;502        {
;;;503          /* No more data to send so STALL the TX Status*/
;;;504          ControlState = WAIT_STATUS_OUT;
000042  2607              MOVS     r6,#7
;;;505          vSetEPTxStatus(EP_TX_STALL);
000044  2010              MOVS     r0,#0x10
000046  f8a80000          STRH     r0,[r8,#0]  ; SaveTState
00004a  e024              B        |L10.150|
                  |L10.76|
;;;506        }
;;;507        
;;;508        goto Expect_Status_Out;
;;;509      }
;;;510    
;;;511      Length = pEPinfo->PacketSize;
00004c  88a5              LDRH     r5,[r4,#4]
;;;512      ControlState = (save_wLength <= Length) ? LAST_IN_DATA : IN_DATA;
00004e  2604              MOVS     r6,#4
000050  42a8              CMP      r0,r5
000052  d900              BLS      |L10.86|
000054  2602              MOVS     r6,#2
                  |L10.86|
;;;513    
;;;514      if (Length > save_wLength)
000056  4285              CMP      r5,r0
000058  d900              BLS      |L10.92|
;;;515      {
;;;516        Length = save_wLength;
00005a  4605              MOV      r5,r0
                  |L10.92|
;;;517      }
;;;518    
;;;519      DataBuffer = (*pEPinfo->CopyData)(Length);
00005c  b2a8              UXTH     r0,r5
00005e  68a1              LDR      r1,[r4,#8]
000060  4607              MOV      r7,r0
000062  4788              BLX      r1
000064  4683              MOV      r11,r0
;;;520    
;;;521      UserToPMABufferCopy(DataBuffer, GetEPTxAddr(ENDP0), Length);
000066  2000              MOVS     r0,#0
000068  f7fffffe          BL       GetEPTxAddr
00006c  4601              MOV      r1,r0
00006e  463a              MOV      r2,r7
000070  4658              MOV      r0,r11
000072  f7fffffe          BL       UserToPMABufferCopy
;;;522    
;;;523      SetEPTxCount(ENDP0, Length);
000076  4639              MOV      r1,r7
000078  2000              MOVS     r0,#0
00007a  f7fffffe          BL       SetEPTxCount
;;;524    
;;;525      pEPinfo->Usb_wLength -= Length;
00007e  8820              LDRH     r0,[r4,#0]
;;;526      pEPinfo->Usb_wOffset += Length;
;;;527      vSetEPTxStatus(EP_TX_VALID);
;;;528    
;;;529      USB_StatusOut();/* Expect the host to abort the data IN stage */
000080  490c              LDR      r1,|L10.180|
000082  1b40              SUBS     r0,r0,r5              ;525
000084  8020              STRH     r0,[r4,#0]            ;525
000086  8860              LDRH     r0,[r4,#2]            ;526
000088  4428              ADD      r0,r0,r5              ;526
00008a  8060              STRH     r0,[r4,#2]            ;526
00008c  f8a8a000          STRH     r10,[r8,#0]           ;527  ; SaveTState
000090  f44f5040          MOV      r0,#0x3000
000094  8008              STRH     r0,[r1,#0]  ; SaveRState
                  |L10.150|
;;;530    
;;;531    Expect_Status_Out:
;;;532      pInformation->ControlState = ControlState;
000096  f8d90000          LDR      r0,[r9,#0]  ; pInformation
00009a  7206              STRB     r6,[r0,#8]
;;;533    }
00009c  e8bd9ff0          POP      {r4-r12,pc}
;;;534    
                          ENDP

                  |L10.160|
0000a0  00000000          DCD      pInformation
                  |L10.164|
0000a4  00000000          DCD      SaveTState
                  |L10.168|
0000a8  00000000          DCD      ||.data||
                  |L10.172|
0000ac  40005c50          DCD      0x40005c50
                  |L10.176|
0000b0  40006000          DCD      0x40006000
                  |L10.180|
0000b4  00000000          DCD      SaveRState

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

                  NoData_Setup0 PROC
;;;542    void NoData_Setup0(void)
;;;543    {
000000  b570              PUSH     {r4-r6,lr}
;;;544      RESULT Result = USB_UNSUPPORT;
;;;545      u32 RequestNo = pInformation->USBbRequest;
000002  4d30              LDR      r5,|L11.196|
;;;546      u32 ControlState;
;;;547    
;;;548      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]            ;545
00000a  064a              LSLS     r2,r1,#25
00000c  d128              BNE      |L11.96|
;;;549      {
;;;550        /* Device Request*/
;;;551        /* SET_CONFIGURATION*/
;;;552        if (RequestNo == SET_CONFIGURATION)
00000e  2c09              CMP      r4,#9
000010  d102              BNE      |L11.24|
;;;553        {
;;;554          Result = Standard_SetConfiguration();
000012  f7fffffe          BL       Standard_SetConfiguration
000016  e037              B        |L11.136|
                  |L11.24|
;;;555        }
;;;556    
;;;557        /*SET ADDRESS*/
;;;558        else if (RequestNo == SET_ADDRESS)
000018  2c05              CMP      r4,#5
00001a  d109              BNE      |L11.48|
;;;559        {
;;;560          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|
;;;561              || (pInformation->USBwIndex != 0)
000028  8881              LDRH     r1,[r0,#4]
00002a  bbb9              CBNZ     r1,|L11.156|
;;;562              || (pInformation->Current_Configuration != 0))
00002c  7a80              LDRB     r0,[r0,#0xa]
00002e  e036              B        |L11.158|
                  |L11.48|
;;;563            /* Device Address should be 127 or less*/
;;;564          {
;;;565            ControlState = STALLED;
;;;566            goto exit_NoData_Setup0;
;;;567          }
;;;568          else
;;;569          {
;;;570            Result = USB_SUCCESS;
;;;571          }
;;;572        }
;;;573        /*SET FEATURE for Device*/
;;;574        else if (RequestNo == SET_FEATURE)
000030  2c03              CMP      r4,#3
000032  d10a              BNE      |L11.74|
;;;575        {
;;;576          if ((pInformation->USBwValue0 == DEVICE_REMOTE_WAKEUP)
000034  78c1              LDRB     r1,[r0,#3]
000036  2901              CMP      r1,#1
000038  d127              BNE      |L11.138|
;;;577              && (pInformation->USBwIndex == 0)
00003a  8881              LDRH     r1,[r0,#4]
00003c  bb29              CBNZ     r1,|L11.138|
;;;578              && (ValBit(pInformation->Current_Feature, 5)))
00003e  7a40              LDRB     r0,[r0,#9]
000040  0680              LSLS     r0,r0,#26
000042  d522              BPL      |L11.138|
;;;579          {
;;;580            Result = Standard_SetDeviceFeature();
000044  f7fffffe          BL       Standard_SetDeviceFeature
000048  e01e              B        |L11.136|
                  |L11.74|
;;;581          }
;;;582          else
;;;583          {
;;;584            Result = USB_UNSUPPORT;
;;;585          }
;;;586        }
;;;587        /*Clear FEATURE for Device */
;;;588        else if (RequestNo == CLEAR_FEATURE)
00004a  2c01              CMP      r4,#1
00004c  d11d              BNE      |L11.138|
;;;589        {
;;;590          if (pInformation->USBwValue0 == DEVICE_REMOTE_WAKEUP
00004e  78c1              LDRB     r1,[r0,#3]
000050  2901              CMP      r1,#1
000052  d11a              BNE      |L11.138|
;;;591              && pInformation->USBwIndex == 0
000054  8881              LDRH     r1,[r0,#4]
000056  b9c1              CBNZ     r1,|L11.138|
;;;592              && ValBit(pInformation->Current_Feature, 5))
000058  7a40              LDRB     r0,[r0,#9]
00005a  0680              LSLS     r0,r0,#26

⌨️ 快捷键说明

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