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

📄 usb_core.txt

📁 stm32.rar
💻 TXT
📖 第 1 页 / 共 5 页
字号:
00005c  d515              BPL      |L11.138|
00005e  e00c              B        |L11.122|
                  |L11.96|
;;;593          {
;;;594            Result = Standard_ClearFeature();
;;;595          }
;;;596          else
;;;597          {
;;;598            Result = USB_UNSUPPORT;
;;;599          }
;;;600        }
;;;601    
;;;602      }
;;;603    
;;;604      /* Interface Request*/
;;;605      else if (Type_Recipient == (STANDARD_REQUEST | INTERFACE_RECIPIENT))
000060  f001007f          AND      r0,r1,#0x7f
000064  2801              CMP      r0,#1
000066  d104              BNE      |L11.114|
;;;606      {
;;;607        /*SET INTERFACE*/
;;;608        if (RequestNo == SET_INTERFACE)
000068  2c0b              CMP      r4,#0xb
00006a  d10e              BNE      |L11.138|
;;;609        {
;;;610          Result = Standard_SetInterface();
00006c  f7fffffe          BL       Standard_SetInterface
000070  e00a              B        |L11.136|
                  |L11.114|
;;;611        }
;;;612      }
;;;613    
;;;614      /* EndPoint Request*/
;;;615      else if (Type_Recipient == (STANDARD_REQUEST | ENDPOINT_RECIPIENT))
000072  2802              CMP      r0,#2
000074  d109              BNE      |L11.138|
;;;616      {
;;;617        /*CLEAR FEATURE for EndPoint*/
;;;618        if (RequestNo == CLEAR_FEATURE)
000076  2c01              CMP      r4,#1
000078  d102              BNE      |L11.128|
                  |L11.122|
;;;619        {
;;;620          Result = Standard_ClearFeature();
00007a  f7fffffe          BL       Standard_ClearFeature
00007e  e003              B        |L11.136|
                  |L11.128|
;;;621        }
;;;622        /* SET FEATURE for EndPoint*/
;;;623        else if (RequestNo == SET_FEATURE)
000080  2c03              CMP      r4,#3
000082  d102              BNE      |L11.138|
;;;624        {
;;;625          Result = Standard_SetEndPointFeature();
000084  f7fffffe          BL       Standard_SetEndPointFeature
                  |L11.136|
;;;626        }
;;;627      }
;;;628      else
;;;629      {
;;;630        Result = USB_UNSUPPORT;
;;;631      }
;;;632    
;;;633    
;;;634      if (Result != USB_SUCCESS)
000088  b160              CBZ      r0,|L11.164|
                  |L11.138|
;;;635      {
;;;636        Result = (*pProperty->Class_NoData_Setup)(RequestNo);
00008a  480f              LDR      r0,|L11.200|
00008c  6800              LDR      r0,[r0,#0]  ; pProperty
00008e  6941              LDR      r1,[r0,#0x14]
000090  b2e0              UXTB     r0,r4
000092  4788              BLX      r1
;;;637        if (Result == USB_NOT_READY)
000094  2803              CMP      r0,#3
000096  d102              BNE      |L11.158|
;;;638        {
;;;639          ControlState = PAUSE;
000098  2009              MOVS     r0,#9
;;;640          goto exit_NoData_Setup0;
00009a  e00f              B        |L11.188|
                  |L11.156|
00009c  e000              B        |L11.160|
                  |L11.158|
;;;641        }
;;;642      }
;;;643    
;;;644      if (Result != USB_SUCCESS)
00009e  b108              CBZ      r0,|L11.164|
                  |L11.160|
;;;645      {
;;;646        ControlState = STALLED;
0000a0  2008              MOVS     r0,#8
;;;647        goto exit_NoData_Setup0;
0000a2  e00b              B        |L11.188|
                  |L11.164|
;;;648      }
;;;649    
;;;650      ControlState = WAIT_STATUS_IN;/* After no data stage SETUP */
;;;651    
;;;652      USB_StatusIn();
0000a4  4a09              LDR      r2,|L11.204|
0000a6  2006              MOVS     r0,#6                 ;650
0000a8  6813              LDR      r3,[r2,#0]
0000aa  2100              MOVS     r1,#0
0000ac  4a08              LDR      r2,|L11.208|
0000ae  b29b              UXTH     r3,r3
0000b0  eb020243          ADD      r2,r2,r3,LSL #1
0000b4  6051              STR      r1,[r2,#4]
0000b6  4a07              LDR      r2,|L11.212|
0000b8  2130              MOVS     r1,#0x30
0000ba  8011              STRH     r1,[r2,#0]  ; SaveTState
                  |L11.188|
;;;653    
;;;654    exit_NoData_Setup0:
;;;655      pInformation->ControlState = ControlState;
0000bc  6829              LDR      r1,[r5,#0]  ; pInformation
0000be  7208              STRB     r0,[r1,#8]
;;;656      return;
;;;657    }
0000c0  bd70              POP      {r4-r6,pc}
;;;658    
                          ENDP

0000c2  0000              DCW      0x0000
                  |L11.196|
0000c4  00000000          DCD      pInformation
                  |L11.200|
0000c8  00000000          DCD      pProperty
                  |L11.204|
0000cc  40005c50          DCD      0x40005c50
                  |L11.208|
0000d0  40006000          DCD      0x40006000
                  |L11.212|
0000d4  00000000          DCD      SaveTState

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

                  Data_Setup0 PROC
;;;666    void Data_Setup0(void)
;;;667    {
000000  e92d41f0          PUSH     {r4-r8,lr}
;;;668      u8 *(*CopyRoutine)(u16);
;;;669      RESULT Result;
;;;670      u32 Request_No = pInformation->USBbRequest;
000004  4f5d              LDR      r7,|L12.380|
000006  4c5e              LDR      r4,|L12.384|
000008  6838              LDR      r0,[r7,#0]  ; pInformation
00000a  2509              MOVS     r5,#9
00000c  7842              LDRB     r2,[r0,#1]
00000e  2600              MOVS     r6,#0
;;;671    
;;;672      u32 Related_Endpoint, Reserved;
;;;673      u32 wOffset, Status;
;;;674    
;;;675    
;;;676    
;;;677      CopyRoutine = NULL;
;;;678      wOffset = 0;
;;;679    
;;;680      if (Request_No == GET_DESCRIPTOR)
000010  6821              LDR      r1,[r4,#0]
000012  2a06              CMP      r2,#6
000014  d10f              BNE      |L12.54|
;;;681      {
;;;682        if (Type_Recipient == (STANDARD_REQUEST | DEVICE_RECIPIENT))
000016  7802              LDRB     r2,[r0,#0]
000018  0652              LSLS     r2,r2,#25
00001a  d16f              BNE      |L12.252|
;;;683        {
;;;684          u8 wValue1 = pInformation->USBwValue1;
00001c  7880              LDRB     r0,[r0,#2]
;;;685          if (wValue1 == DEVICE_DESCRIPTOR)
00001e  2801              CMP      r0,#1
000020  d101              BNE      |L12.38|
;;;686          {
;;;687            CopyRoutine = pProperty->GetDeviceDescriptor;
000022  69c9              LDR      r1,[r1,#0x1c]
000024  e062              B        |L12.236|
                  |L12.38|
;;;688          }
;;;689          else if (wValue1 == CONFIG_DESCRIPTOR)
000026  2802              CMP      r0,#2
000028  d101              BNE      |L12.46|
;;;690          {
;;;691            CopyRoutine = pProperty->GetConfigDescriptor;
00002a  6a09              LDR      r1,[r1,#0x20]
00002c  e05e              B        |L12.236|
                  |L12.46|
;;;692          }
;;;693          else if (wValue1 == STRING_DESCRIPTOR)
00002e  2803              CMP      r0,#3
000030  d164              BNE      |L12.252|
;;;694          {
;;;695            CopyRoutine = pProperty->GetStringDescriptor;
000032  6a49              LDR      r1,[r1,#0x24]
000034  e05a              B        |L12.236|
                  |L12.54|
;;;696          }  /* End of GET_DESCRIPTOR */
;;;697        }
;;;698      }
;;;699    
;;;700      /*GET STATUS*/
;;;701      else if ((Request_No == GET_STATUS) && (pInformation->USBwValue == 0)
000036  bb82              CBNZ     r2,|L12.154|
000038  8842              LDRH     r2,[r0,#2]
00003a  2a00              CMP      r2,#0
00003c  d15e              BNE      |L12.252|
;;;702               && (pInformation->USBwLength == 0x0002)
00003e  88c2              LDRH     r2,[r0,#6]
000040  2a02              CMP      r2,#2
000042  d15b              BNE      |L12.252|
;;;703               && (pInformation->USBwIndex1 == 0))
000044  7902              LDRB     r2,[r0,#4]
000046  2a00              CMP      r2,#0
000048  d158              BNE      |L12.252|
;;;704      {
;;;705        /* GET STATUS for Device*/
;;;706        if ((Type_Recipient == (STANDARD_REQUEST | DEVICE_RECIPIENT))
00004a  7802              LDRB     r2,[r0,#0]
00004c  0653              LSLS     r3,r2,#25
00004e  d103              BNE      |L12.88|
;;;707            && (pInformation->USBwIndex == 0))
000050  8883              LDRH     r3,[r0,#4]
000052  b90b              CBNZ     r3,|L12.88|
                  |L12.84|
;;;708        {
;;;709          CopyRoutine = Standard_GetStatus;
000054  494b              LDR      r1,|L12.388|
000056  e049              B        |L12.236|
                  |L12.88|
;;;710        }
;;;711    
;;;712        /* GET STATUS for Interface*/
;;;713        else if (Type_Recipient == (STANDARD_REQUEST | INTERFACE_RECIPIENT))
000058  f002027f          AND      r2,r2,#0x7f
00005c  2a01              CMP      r2,#1
00005e  d10a              BNE      |L12.118|
;;;714        {
;;;715          if (((*pProperty->Class_Get_Interface_Setting)(pInformation->USBwIndex0, 0) == USB_SUCCESS)
000060  698a              LDR      r2,[r1,#0x18]
000062  7940              LDRB     r0,[r0,#5]
000064  2100              MOVS     r1,#0
000066  4790              BLX      r2
000068  2800              CMP      r0,#0
00006a  d147              BNE      |L12.252|
;;;716              && (pInformation->Current_Configuration != 0))
00006c  6838              LDR      r0,[r7,#0]  ; pInformation
00006e  7a80              LDRB     r0,[r0,#0xa]
000070  2800              CMP      r0,#0
000072  d1ef              BNE      |L12.84|
000074  e042              B        |L12.252|
                  |L12.118|
;;;717          {
;;;718            CopyRoutine = Standard_GetStatus;
;;;719          }
;;;720        }
;;;721    
;;;722        /* GET STATUS for EndPoint*/
;;;723        else if (Type_Recipient == (STANDARD_REQUEST | ENDPOINT_RECIPIENT))
000076  2a02              CMP      r2,#2
000078  d140              BNE      |L12.252|
;;;724        {
;;;725          Related_Endpoint = (pInformation->USBwIndex0 & 0x0f);
00007a  7940              LDRB     r0,[r0,#5]
;;;726          Reserved = pInformation->USBwIndex0 & 0x70;
;;;727    
;;;728          if (ValBit(pInformation->USBwIndex0, 7))
00007c  4942              LDR      r1,|L12.392|
00007e  f0000270          AND      r2,r0,#0x70           ;726
000082  0603              LSLS     r3,r0,#24
000084  f000000f          AND      r0,r0,#0xf            ;725
;;;729          {
;;;730            /*Get Status of endpoint & stall the request if the related_ENdpoint
;;;731            is Disabled*/
;;;732            Status = _GetEPTxStatus(Related_Endpoint);
000088  eb010180          ADD      r1,r1,r0,LSL #2
00008c  f8d11c00          LDR      r1,[r1,#0xc00]
000090  d504              BPL      |L12.156|
000092  f3c11101          UBFX     r1,r1,#4,#2
000096  0109              LSLS     r1,r1,#4
000098  e003              B        |L12.162|
                  |L12.154|
00009a  e00a              B        |L12.178|
                  |L12.156|
;;;733          }
;;;734          else
;;;735          {
;;;736            Status = _GetEPRxStatus(Related_Endpoint);
00009c  f3c13101          UBFX     r1,r1,#12,#2
0000a0  0309              LSLS     r1,r1,#12
                  |L12.162|
;;;737          }
;;;738    
;;;739          if ((Related_Endpoint < Device_Table.Total_Endpoint) && (Reserved == 0)
0000a2  4b3a              LDR      r3,|L12.396|
0000a4  781b              LDRB     r3,[r3,#0]  ; Device_Table
0000a6  4283              CMP      r3,r0
0000a8  d928              BLS      |L12.252|
0000aa  bb3a              CBNZ     r2,|L12.252|
;;;740              && (Status != 0))
0000ac  2900              CMP      r1,#0
0000ae  d1d1              BNE      |L12.84|
0000b0  e024              B        |L12.252|
                  |L12.178|
;;;741          {
;;;742            CopyRoutine = Standard_GetStatus;
;;;743          }
;;;744        }
;;;745    
;;;746      }
;;;747    
;;;748      /*GET CONFIGURATION*/
;;;749      else if (Request_No == GET_CONFIGURATION)
0000b2  2a08              CMP      r2,#8
0000b4  d104              BNE      |L12.192|
;;;750      {
;;;751        if (Type_Recipient == (STANDARD_REQUEST | DEVICE_RECIPIENT))

⌨️ 快捷键说明

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