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

📄 usb_core.txt

📁 MP3_PLAYER.rar
💻 TXT
📖 第 1 页 / 共 5 页
字号:
                  |L5.94|
00005e  7801              LDRB     r1,[r0,#0]            ;211  ; StatusInfo
000060  f0410101          ORR      r1,r1,#1              ;211
                  |L5.100|
000064  7001              STRB     r1,[r0,#0]            ;211  ; StatusInfo
000066  e003              B        |L5.112|
                  |L5.104|
000068  f3c13101          UBFX     r1,r1,#12,#2          ;217
                  |L5.108|
00006c  2901              CMP      r1,#1                 ;209
00006e  d0f6              BEQ      |L5.94|
                  |L5.112|
000070  4806              LDR      r0,|L5.140|
000072  6800              LDR      r0,[r0,#0]            ;228  ; pUser_Standard_Requests
000074  6900              LDR      r0,[r0,#0x10]         ;228
000076  4780              BLX      r0                    ;228
000078  e7e0              B        |L5.60|
                  |L5.122|
00007a  2000              MOVS     r0,#0                 ;226
00007c  bd10              POP      {r4,pc}
;;;231    
                          ENDP

00007e  0000              DCW      0x0000
                  |L5.128|
000080  00000000          DCD      pInformation
                  |L5.132|
000084  00000000          DCD      ||.data||
                  |L5.136|
000088  40005000          DCD      0x40005000
                  |L5.140|
00008c  00000000          DCD      pUser_Standard_Requests

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

                  Standard_ClearFeature PROC
;;;240    RESULT Standard_ClearFeature(void)
;;;241    {
000000  b570              PUSH     {r4-r6,lr}
;;;242      u32     Type_Rec = Type_Recipient;
000002  4837              LDR      r0,|L6.224|
000004  6801              LDR      r1,[r0,#0]  ; pInformation
000006  7808              LDRB     r0,[r1,#0]
000008  f010007f          ANDS     r0,r0,#0x7f
;;;243      u32     Status;
;;;244    
;;;245    
;;;246      if (Type_Rec == (STANDARD_REQUEST | DEVICE_RECIPIENT))
00000c  d104              BNE      |L6.24|
;;;247      {/*Device Clear Feature*/
;;;248        ClrBit(pInformation->Current_Feature, 5);
00000e  7a48              LDRB     r0,[r1,#9]
000010  f00000df          AND      r0,r0,#0xdf
000014  7248              STRB     r0,[r1,#9]
;;;249        return USB_SUCCESS;
000016  e05c              B        |L6.210|
                  |L6.24|
;;;250      }
;;;251      else if (Type_Rec == (STANDARD_REQUEST | ENDPOINT_RECIPIENT))
000018  2802              CMP      r0,#2
00001a  d15e              BNE      |L6.218|
;;;252      {/*EndPoint Clear Feature*/
;;;253        DEVICE* pDev;
;;;254        u32 Related_Endpoint;
;;;255        u32 wIndex0;
;;;256        u32 rEP;
;;;257    
;;;258        if ((pInformation->USBwValue != ENDPOINT_STALL)
00001c  8848              LDRH     r0,[r1,#2]
00001e  2800              CMP      r0,#0
000020  d15b              BNE      |L6.218|
;;;259            || (pInformation->USBwIndex1 != 0))
000022  7908              LDRB     r0,[r1,#4]
000024  2800              CMP      r0,#0
000026  d158              BNE      |L6.218|
;;;260        {
;;;261          return USB_UNSUPPORT;
;;;262        }
;;;263    
;;;264        pDev = &Device_Table;
;;;265        wIndex0 = pInformation->USBwIndex0;
000028  794a              LDRB     r2,[r1,#5]
;;;266        rEP = wIndex0 & ~0x80;
;;;267        Related_Endpoint = ENDP0 + rEP;
;;;268    
;;;269        if (ValBit(pInformation->USBwIndex0, 7))
00002a  4d2f              LDR      r5,|L6.232|
00002c  0613              LSLS     r3,r2,#24
00002e  f0220080          BIC      r0,r2,#0x80           ;266
000032  2b00              CMP      r3,#0
;;;270        {
;;;271          /*Get Status of endpoint & stall the request if the related_ENdpoint
;;;272          is Disabled*/
;;;273          Status = _GetEPTxStatus(Related_Endpoint);
000034  eb050380          ADD      r3,r5,r0,LSL #2
000038  4c2a              LDR      r4,|L6.228|
00003a  f8d33c00          LDR      r3,[r3,#0xc00]
00003e  da03              BGE      |L6.72|
000040  f3c31301          UBFX     r3,r3,#4,#2
000044  011b              LSLS     r3,r3,#4
000046  e002              B        |L6.78|
                  |L6.72|
;;;274        }
;;;275        else
;;;276        {
;;;277          Status = _GetEPRxStatus(Related_Endpoint);
000048  f3c33301          UBFX     r3,r3,#12,#2
00004c  031b              LSLS     r3,r3,#12
                  |L6.78|
;;;278        }
;;;279    
;;;280        if ((rEP >= pDev->Total_Endpoint) || (Status == 0)
00004e  7826              LDRB     r6,[r4,#0]
000050  4286              CMP      r6,r0
000052  d942              BLS      |L6.218|
000054  b3f3              CBZ      r3,|L6.212|
;;;281            || (pInformation->Current_Configuration == 0))
000056  7a89              LDRB     r1,[r1,#0xa]
000058  b3e1              CBZ      r1,|L6.212|
;;;282        {
;;;283          return USB_UNSUPPORT;
;;;284        }
;;;285    
;;;286    
;;;287        if (wIndex0 & 0x80)
00005a  0611              LSLS     r1,r2,#24
00005c  d510              BPL      |L6.128|
;;;288        {
;;;289          /* IN endpoint */
;;;290          if (_GetTxStallStatus(Related_Endpoint ))
00005e  eb050180          ADD      r1,r5,r0,LSL #2
000062  f8d11c00          LDR      r1,[r1,#0xc00]
000066  f3c11101          UBFX     r1,r1,#4,#2
00006a  2901              CMP      r1,#1
00006c  d12d              BNE      |L6.202|
;;;291          {
;;;292            ClearDTOG_TX(Related_Endpoint);
00006e  b2c0              UXTB     r0,r0
000070  4604              MOV      r4,r0
000072  f7fffffe          BL       ClearDTOG_TX
;;;293            SetEPTxStatus(Related_Endpoint, EP_TX_VALID);
000076  2130              MOVS     r1,#0x30
000078  4620              MOV      r0,r4
00007a  f7fffffe          BL       SetEPTxStatus
00007e  e024              B        |L6.202|
                  |L6.128|
;;;294          }
;;;295        }
;;;296        else
;;;297        {
;;;298          /* OUT endpoint */
;;;299          if (_GetRxStallStatus(Related_Endpoint))
000080  eb050480          ADD      r4,r5,r0,LSL #2
000084  f8d41c00          LDR      r1,[r4,#0xc00]
000088  f3c13101          UBFX     r1,r1,#12,#2
00008c  2901              CMP      r1,#1
00008e  d11c              BNE      |L6.202|
000090  f64b768f          MOV      r6,#0xbf8f
;;;300          {
;;;301            if (Related_Endpoint == ENDP0)
000094  b970              CBNZ     r0,|L6.180|
;;;302            {
;;;303              /* After clear the STALL, enable the default endpoint receiver */
;;;304              SetEPRxCount(Related_Endpoint, Device_Property.MaxPacketSize);
000096  4815              LDR      r0,|L6.236|
000098  f890102c          LDRB     r1,[r0,#0x2c]  ; Device_Property
00009c  2000              MOVS     r0,#0
00009e  f7fffffe          BL       SetEPRxCount
;;;305              _SetEPRxStatus(Related_Endpoint, EP_RX_VALID);
0000a2  f8d50c00          LDR      r0,[r5,#0xc00]
0000a6  b280              UXTH     r0,r0
0000a8  4030              ANDS     r0,r0,r6
0000aa  f4805040          EOR      r0,r0,#0x3000
0000ae  f8c50c00          STR      r0,[r5,#0xc00]
0000b2  e00a              B        |L6.202|
                  |L6.180|
;;;306            }
;;;307            else
;;;308            {
;;;309              ClearDTOG_RX(Related_Endpoint);
0000b4  b2c0              UXTB     r0,r0
0000b6  f7fffffe          BL       ClearDTOG_RX
;;;310              _SetEPRxStatus(Related_Endpoint, EP_RX_VALID);
0000ba  f8d40c00          LDR      r0,[r4,#0xc00]
0000be  b280              UXTH     r0,r0
0000c0  4030              ANDS     r0,r0,r6
0000c2  f4805040          EOR      r0,r0,#0x3000
0000c6  f8c40c00          STR      r0,[r4,#0xc00]
                  |L6.202|
;;;311            }
;;;312          }
;;;313        }
;;;314        pUser_Standard_Requests->User_ClearFeature();
0000ca  4809              LDR      r0,|L6.240|
0000cc  6800              LDR      r0,[r0,#0]  ; pUser_Standard_Requests
0000ce  6940              LDR      r0,[r0,#0x14]
0000d0  4780              BLX      r0
                  |L6.210|
;;;315        return USB_SUCCESS;
0000d2  e000              B        |L6.214|
                  |L6.212|
0000d4  e001              B        |L6.218|
                  |L6.214|
0000d6  2000              MOVS     r0,#0
;;;316      }
;;;317    
;;;318      return USB_UNSUPPORT;
;;;319    }
0000d8  bd70              POP      {r4-r6,pc}
                  |L6.218|
0000da  2002              MOVS     r0,#2                 ;318
0000dc  bd70              POP      {r4-r6,pc}
;;;320    
                          ENDP

0000de  0000              DCW      0x0000
                  |L6.224|
0000e0  00000000          DCD      pInformation
                  |L6.228|
0000e4  00000000          DCD      Device_Table
                  |L6.232|
0000e8  40005000          DCD      0x40005000
                  |L6.236|
0000ec  00000000          DCD      Device_Property
                  |L6.240|
0000f0  00000000          DCD      pUser_Standard_Requests

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

                  Standard_SetEndPointFeature PROC
;;;329    RESULT Standard_SetEndPointFeature(void)
;;;330    {
000000  b570              PUSH     {r4-r6,lr}
;;;331      u32    wIndex0;
;;;332      u32    Related_Endpoint;
;;;333      u32    rEP;
;;;334      u32   Status;
;;;335    
;;;336      wIndex0 = pInformation->USBwIndex0;
000002  481c              LDR      r0,|L7.116|
000004  6802              LDR      r2,[r0,#0]  ; pInformation
;;;337      rEP = wIndex0 & ~0x80;
;;;338      Related_Endpoint = ENDP0 + rEP;
;;;339    
;;;340      if (ValBit(pInformation->USBwIndex0, 7))
000006  481c              LDR      r0,|L7.120|
000008  7951              LDRB     r1,[r2,#5]            ;336
00000a  f0210580          BIC      r5,r1,#0x80
00000e  060b              LSLS     r3,r1,#24
000010  eb000085          ADD      r0,r0,r5,LSL #2
;;;341      {
;;;342        /* get Status of endpoint & stall the request if the related_ENdpoint
;;;343        is Disabled*/
;;;344        Status = _GetEPTxStatus(Related_Endpoint);
000014  f8d03c00          LDR      r3,[r0,#0xc00]
000018  f0210480          BIC      r4,r1,#0x80           ;337
00001c  d503              BPL      |L7.38|
00001e  f3c31301          UBFX     r3,r3,#4,#2
000022  011b              LSLS     r3,r3,#4
000024  e002              B        |L7.44|
                  |L7.38|
;;;345      }
;;;346      else
;;;347      {
;;;348        Status = _GetEPRxStatus(Related_Endpoint);
000026  f3c33301          UBFX     r3,r3,#12,#2
00002a  031b              LSLS     r3,r3,#12
                  |L7.44|
;;;349      }
;;;350    
;;;351      if (Related_Endpoint >= Device_Table.Total_Endpoint
00002c  4d13              LDR      r5,|L7.124|
00002e  782d              LDRB     r5,[r5,#0]  ; Device_Table
000030  42a5              CMP      r5,r4
000032  d904              BLS      |L7.62|
;;;352          || pInformation->USBwValue != 0 || Status == 0
000034  8854              LDRH     r4,[r2,#2]
000036  b914              CBNZ     r4,|L7.62|
000038  b10b              CBZ      r3,|L7.62|
;;;353          || pInformation->Current_Configuration == 0)
00003a  7a92              LDRB     r2,[r2,#0xa]
00003c  b90a              CBNZ     r2,|L7.66|
                  |L7.62|
;;;354      {
;;;355        return USB_UNSUPPORT;
00003e  2002              MOVS     r0,#2
;;;356      }
;;;357      else
;;;358      {
;;;359        if (wIndex0 & 0x80)
;;;360        {
;;;361          /* IN endpoint */
;;;362          _SetEPTxStatus(Related_Endpoint, EP_TX_STALL);
;;;363        }
;;;364    
;;;365        else
;;;366        {
;;;367          /* OUT endpoint */
;;;368          _SetEPRxStatus(Related_Endpoint, EP_RX_STALL);
;;;369        }
;;;370      }
;;;371      pUser_Standard_Requests->User_SetEndPointFeature();
;;;372      return USB_SUCCESS;
;;;373    }
000040  bd70              POP      {r4-r6,pc}
                  |L7.66|
000042  0609              LSLS     r1,r1,#24             ;359
000044  f8d01c00          LDR      r1,[r0,#0xc00]        ;362
000048  d506              BPL      |L7.88|
00004a  f64872bf          MOV      r2,#0x8fbf            ;362
00004e  b289              UXTH     r1,r1                 ;362
000050  4011              ANDS     r1,r1,r2              ;362
000052  f0810110          EOR      r1,r1,#0x10           ;362
000056  e005              B        |L7.100|
                  |L7.88|
000058  f64b728f          MOV      r2,#0xbf8f            ;368
00005c  b289              UXTH     r1,r1                 ;368
00005e  4011              ANDS     r1,r1,r2              ;368
000060  f4815180          EOR      r1,r1,#0x1000         ;368
                  |L7.100|
000064  f8c01c00          STR      r1,[r0,#0xc00]        ;362

⌨️ 快捷键说明

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