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

📄 usb_core.txt

📁 MP3_PLAYER.rar
💻 TXT
📖 第 1 页 / 共 5 页
字号:
; generated by ARM/Thumb C/C++ Compiler with , RVCT3.1 [Build 938] for uVision
; commandline ArmCC [--split_sections --debug -c --asm --interleave -o.\Obj\usb_core.o --depend=.\Obj\usb_core.d --device=DARMSTM --apcs=interwork -O3 -I.\Code\FATSystem\INC -I.\Code\Library\INC -I.\Code\SDCard\INC -I.\Code\Speaker\INC -I.\Code\System\INC -I.\Code\USBMassStorage\INC -I.\Code\User\INC -I.\Code\VS1003\INC -ID:\Keil\ARM\INC\ST\STM32F10x --omf_browse=.\Obj\usb_core.crf Code\USBMassStorage\SRC\usb_core.c]
                          THUMB

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

                  Standard_GetConfiguration PROC
;;;60     u8 *Standard_GetConfiguration(u16 Length)
;;;61     {
000000  b510              PUSH     {r4,lr}
000002  4c07              LDR      r4,|L1.32|
;;;62       if (Length == 0)
000004  b920              CBNZ     r0,|L1.16|
;;;63       {
;;;64         pInformation->Ctrl_Info.Usb_wLength =
000006  6821              LDR      r1,[r4,#0]  ; pInformation
000008  2001              MOVS     r0,#1
00000a  8208              STRH     r0,[r1,#0x10]
;;;65           sizeof(pInformation->Current_Configuration);
;;;66         return 0;
00000c  2000              MOVS     r0,#0
;;;67       }
;;;68       pUser_Standard_Requests->User_GetConfiguration();
;;;69       return (u8 *)&pInformation->Current_Configuration;
;;;70     }
00000e  bd10              POP      {r4,pc}
                  |L1.16|
000010  4804              LDR      r0,|L1.36|
000012  6800              LDR      r0,[r0,#0]            ;68  ; pUser_Standard_Requests
000014  6800              LDR      r0,[r0,#0]            ;68
000016  4780              BLX      r0                    ;68
000018  6820              LDR      r0,[r4,#0]            ;69  ; pInformation
00001a  300a              ADDS     r0,r0,#0xa            ;69
00001c  bd10              POP      {r4,pc}
;;;71     
                          ENDP

00001e  0000              DCW      0x0000
                  |L1.32|
000020  00000000          DCD      pInformation
                  |L1.36|
000024  00000000          DCD      pUser_Standard_Requests

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

                  Standard_SetConfiguration PROC
;;;81     RESULT Standard_SetConfiguration(void)
;;;82     {
000000  b510              PUSH     {r4,lr}
;;;83     
;;;84       if ((pInformation->USBwValue0 <=
000002  480a              LDR      r0,|L2.44|
000004  490a              LDR      r1,|L2.48|
000006  6800              LDR      r0,[r0,#0]  ; pInformation
000008  784a              LDRB     r2,[r1,#1]  ; Device_Table
00000a  78c1              LDRB     r1,[r0,#3]
00000c  4291              CMP      r1,r2
00000e  d80a              BHI      |L2.38|
;;;85           Device_Table.Total_Configuration) && (pInformation->USBwValue1 == 0)
000010  7882              LDRB     r2,[r0,#2]
000012  b942              CBNZ     r2,|L2.38|
;;;86           && (pInformation->USBwIndex == 0)) /*call Back usb spec 2.0*/
000014  8882              LDRH     r2,[r0,#4]
000016  b932              CBNZ     r2,|L2.38|
;;;87       {
;;;88         pInformation->Current_Configuration = pInformation->USBwValue0;
000018  7281              STRB     r1,[r0,#0xa]
;;;89         pUser_Standard_Requests->User_SetConfiguration();
00001a  4806              LDR      r0,|L2.52|
00001c  6800              LDR      r0,[r0,#0]  ; pUser_Standard_Requests
00001e  6840              LDR      r0,[r0,#4]
000020  4780              BLX      r0
;;;90         return USB_SUCCESS;
000022  2000              MOVS     r0,#0
;;;91       }
;;;92       else
;;;93       {
;;;94         return USB_UNSUPPORT;
;;;95       }
;;;96     }
000024  bd10              POP      {r4,pc}
                  |L2.38|
000026  2002              MOVS     r0,#2                 ;94
000028  bd10              POP      {r4,pc}
;;;97     
                          ENDP

00002a  0000              DCW      0x0000
                  |L2.44|
00002c  00000000          DCD      pInformation
                  |L2.48|
000030  00000000          DCD      Device_Table
                  |L2.52|
000034  00000000          DCD      pUser_Standard_Requests

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

                  Standard_GetInterface PROC
;;;106    u8 *Standard_GetInterface(u16 Length)
;;;107    {
000000  b510              PUSH     {r4,lr}
000002  4c07              LDR      r4,|L3.32|
;;;108      if (Length == 0)
000004  b920              CBNZ     r0,|L3.16|
;;;109      {
;;;110        pInformation->Ctrl_Info.Usb_wLength =
000006  6821              LDR      r1,[r4,#0]  ; pInformation
000008  2001              MOVS     r0,#1
00000a  8208              STRH     r0,[r1,#0x10]
;;;111          sizeof(pInformation->Current_AlternateSetting);
;;;112        return 0;
00000c  2000              MOVS     r0,#0
;;;113      }
;;;114      pUser_Standard_Requests->User_GetInterface();
;;;115      return (u8 *)&pInformation->Current_AlternateSetting;
;;;116    }
00000e  bd10              POP      {r4,pc}
                  |L3.16|
000010  4804              LDR      r0,|L3.36|
000012  6800              LDR      r0,[r0,#0]            ;114  ; pUser_Standard_Requests
000014  6880              LDR      r0,[r0,#8]            ;114
000016  4780              BLX      r0                    ;114
000018  6820              LDR      r0,[r4,#0]            ;115  ; pInformation
00001a  300c              ADDS     r0,r0,#0xc            ;115
00001c  bd10              POP      {r4,pc}
;;;117    
                          ENDP

00001e  0000              DCW      0x0000
                  |L3.32|
000020  00000000          DCD      pInformation
                  |L3.36|
000024  00000000          DCD      pUser_Standard_Requests

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

                  Standard_SetInterface PROC
;;;127    RESULT Standard_SetInterface(void)
;;;128    {
000000  b510              PUSH     {r4,lr}
;;;129      RESULT Re;
;;;130      /*Test if the specified Interface and Alternate Setting are supported by
;;;131        the application Firmware*/
;;;132      Re = (*pProperty->Class_Get_Interface_Setting)(pInformation->USBwIndex0, pInformation->USBwValue0);
000002  4c0e              LDR      r4,|L4.60|
000004  4a0e              LDR      r2,|L4.64|
000006  6820              LDR      r0,[r4,#0]  ; pInformation
000008  6812              LDR      r2,[r2,#0]  ; pProperty
00000a  78c1              LDRB     r1,[r0,#3]
00000c  6992              LDR      r2,[r2,#0x18]
00000e  7940              LDRB     r0,[r0,#5]
000010  4790              BLX      r2
;;;133    
;;;134      if (pInformation->Current_Configuration != 0)
000012  6821              LDR      r1,[r4,#0]  ; pInformation
000014  7a8a              LDRB     r2,[r1,#0xa]
000016  b17a              CBZ      r2,|L4.56|
;;;135      {
;;;136        if ((Re != USB_SUCCESS) || (pInformation->USBwIndex1 != 0)
000018  b970              CBNZ     r0,|L4.56|
00001a  7908              LDRB     r0,[r1,#4]
00001c  b960              CBNZ     r0,|L4.56|
;;;137            || (pInformation->USBwValue1 != 0))
00001e  7888              LDRB     r0,[r1,#2]
000020  b950              CBNZ     r0,|L4.56|
;;;138        {
;;;139          return  USB_UNSUPPORT;
;;;140        }
;;;141        else if (Re == USB_SUCCESS)
;;;142        {
;;;143          pUser_Standard_Requests->User_SetInterface();
000022  4808              LDR      r0,|L4.68|
000024  6800              LDR      r0,[r0,#0]  ; pUser_Standard_Requests
000026  68c0              LDR      r0,[r0,#0xc]
000028  4780              BLX      r0
;;;144          pInformation->Current_Interface = pInformation->USBwIndex0;
00002a  6820              LDR      r0,[r4,#0]  ; pInformation
00002c  7941              LDRB     r1,[r0,#5]
00002e  72c1              STRB     r1,[r0,#0xb]
;;;145          pInformation->Current_AlternateSetting = pInformation->USBwValue0;
000030  78c1              LDRB     r1,[r0,#3]
000032  7301              STRB     r1,[r0,#0xc]
;;;146          return USB_SUCCESS;
000034  2000              MOVS     r0,#0
;;;147        }
;;;148    
;;;149      }
;;;150    
;;;151      return USB_UNSUPPORT;
;;;152    }
000036  bd10              POP      {r4,pc}
                  |L4.56|
000038  2002              MOVS     r0,#2                 ;151
00003a  bd10              POP      {r4,pc}
;;;153    
                          ENDP

                  |L4.60|
00003c  00000000          DCD      pInformation
                  |L4.64|
000040  00000000          DCD      pProperty
                  |L4.68|
000044  00000000          DCD      pUser_Standard_Requests

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

                  Standard_GetStatus PROC
;;;162    u8 *Standard_GetStatus(u16 Length)
;;;163    {
000000  b510              PUSH     {r4,lr}
000002  491f              LDR      r1,|L5.128|
000004  6809              LDR      r1,[r1,#0]
;;;164      if (Length == 0)
000006  b910              CBNZ     r0,|L5.14|
;;;165      {
;;;166        pInformation->Ctrl_Info.Usb_wLength = 2;
000008  2002              MOVS     r0,#2
00000a  8208              STRH     r0,[r1,#0x10]
;;;167        return 0;
00000c  e035              B        |L5.122|
                  |L5.14|
;;;168      }
;;;169    
;;;170      StatusInfo.w = 0;
00000e  481d              LDR      r0,|L5.132|
000010  2200              MOVS     r2,#0
000012  8002              STRH     r2,[r0,#0]  ; StatusInfo
;;;171      /* Reset Status Information */
;;;172    
;;;173      if (Type_Recipient == (STANDARD_REQUEST | DEVICE_RECIPIENT))
000014  780a              LDRB     r2,[r1,#0]
000016  0653              LSLS     r3,r2,#25
000018  d10c              BNE      |L5.52|
;;;174      {
;;;175        /*Get Device Status */
;;;176        u8 Feature = pInformation->Current_Feature;
00001a  7a49              LDRB     r1,[r1,#9]
;;;177    
;;;178        /* Remote Wakeup enabled */
;;;179        if (ValBit(Feature, 5))
00001c  068a              LSLS     r2,r1,#26
00001e  d503              BPL      |L5.40|
;;;180        {
;;;181          SetBit(StatusInfo0, 1);
000020  7802              LDRB     r2,[r0,#0]  ; StatusInfo
000022  f0420202          ORR      r2,r2,#2
000026  7002              STRB     r2,[r0,#0]  ; StatusInfo
                  |L5.40|
;;;182        }
;;;183    
;;;184        /* Self-powered */
;;;185        if (ValBit(Feature, 6))
000028  0649              LSLS     r1,r1,#25
00002a  d418              BMI      |L5.94|
;;;186        {
;;;187          SetBit(StatusInfo0, 0);
;;;188        }
;;;189        else /* Bus-powered */
;;;190        {
;;;191          ClrBit(StatusInfo0, 0);
00002c  7801              LDRB     r1,[r0,#0]  ; StatusInfo
00002e  f00101fe          AND      r1,r1,#0xfe
000032  e017              B        |L5.100|
                  |L5.52|
;;;192        }
;;;193      }
;;;194      /*Interface Status*/
;;;195      else if (Type_Recipient == (STANDARD_REQUEST | INTERFACE_RECIPIENT))
000034  f002027f          AND      r2,r2,#0x7f
000038  2a01              CMP      r2,#1
00003a  d101              BNE      |L5.64|
                  |L5.60|
;;;196      {
;;;197        return (u8 *)&StatusInfo;
00003c  4811              LDR      r0,|L5.132|
;;;198      }
;;;199      /*Get EndPoint Status*/
;;;200      else if (Type_Recipient == (STANDARD_REQUEST | ENDPOINT_RECIPIENT))
;;;201      {
;;;202        u8 Related_Endpoint;
;;;203        u8 wIndex0 = pInformation->USBwIndex0;
;;;204    
;;;205        Related_Endpoint = (wIndex0 & 0x0f);
;;;206        if (ValBit(wIndex0, 7))
;;;207        {
;;;208          /* IN endpoint */
;;;209          if (_GetTxStallStatus(Related_Endpoint))
;;;210          {
;;;211            SetBit(StatusInfo0, 0); /* IN Endpoint stalled */
;;;212          }
;;;213        }
;;;214        else
;;;215        {
;;;216          /* OUT endpoint */
;;;217          if (_GetRxStallStatus(Related_Endpoint))
;;;218          {
;;;219            SetBit(StatusInfo0, 0); /* OUT Endpoint stalled */
;;;220          }
;;;221        }
;;;222    
;;;223      }
;;;224      else
;;;225      {
;;;226        return NULL;
;;;227      }
;;;228      pUser_Standard_Requests->User_GetStatus();
;;;229      return (u8 *)&StatusInfo;
;;;230    }
00003e  bd10              POP      {r4,pc}
                  |L5.64|
000040  2a02              CMP      r2,#2                 ;200
000042  d11a              BNE      |L5.122|
000044  794a              LDRB     r2,[r1,#5]            ;203
000046  f002010f          AND      r1,r2,#0xf            ;205
00004a  0613              LSLS     r3,r2,#24             ;206
00004c  4a0e              LDR      r2,|L5.136|
00004e  eb020181          ADD      r1,r2,r1,LSL #2       ;209
000052  f8d11c00          LDR      r1,[r1,#0xc00]        ;209
000056  d507              BPL      |L5.104|
000058  f3c11101          UBFX     r1,r1,#4,#2           ;209
00005c  e006              B        |L5.108|

⌨️ 快捷键说明

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