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

📄 usb_core.txt

📁 stm32.rar
💻 TXT
📖 第 1 页 / 共 5 页
字号:
; generated by ARM/Thumb C/C++ Compiler with , RVCT3.1 [Build 942] for uVision
; commandline ArmCC [--split_sections --debug -c --asm --interleave -o.\Int_Flash\usb_core.o --depend=.\Int_Flash\usb_core.d --device=DARMSTM --apcs=interwork -O3 -I..\include -I..\..\..\..\..\INC\ST\STM32F10x\USB -Id:\Keil\ARM\INC\ST\STM32F10x -D__MICROLIB --omf_browse=.\Int_Flash\usb_core.crf ..\..\..\..\..\RV31\LIB\ST\STM32F10x\USB\usb_core.c]
                          THUMB

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

                  Standard_GetConfiguration PROC
;;;56     u8 *Standard_GetConfiguration(u16 Length)
;;;57     {
000000  b510              PUSH     {r4,lr}
000002  4c07              LDR      r4,|L1.32|
;;;58       if (Length == 0)
000004  b920              CBNZ     r0,|L1.16|
;;;59       {
;;;60         pInformation->Ctrl_Info.Usb_wLength =
000006  6821              LDR      r1,[r4,#0]  ; pInformation
000008  2001              MOVS     r0,#1
00000a  8208              STRH     r0,[r1,#0x10]
;;;61           sizeof(pInformation->Current_Configuration);
;;;62         return 0;
00000c  2000              MOVS     r0,#0
;;;63       }
;;;64       pUser_Standard_Requests->User_GetConfiguration();
;;;65       return (u8 *)&pInformation->Current_Configuration;
;;;66     }
00000e  bd10              POP      {r4,pc}
                  |L1.16|
000010  4804              LDR      r0,|L1.36|
000012  6800              LDR      r0,[r0,#0]            ;64  ; pUser_Standard_Requests
000014  6800              LDR      r0,[r0,#0]            ;64
000016  4780              BLX      r0                    ;64
000018  6820              LDR      r0,[r4,#0]            ;65  ; pInformation
00001a  300a              ADDS     r0,r0,#0xa            ;65
00001c  bd10              POP      {r4,pc}
;;;67     
                          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
;;;77     RESULT Standard_SetConfiguration(void)
;;;78     {
000000  b510              PUSH     {r4,lr}
;;;79     
;;;80       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|
;;;81           Device_Table.Total_Configuration) && (pInformation->USBwValue1 == 0)
000010  7882              LDRB     r2,[r0,#2]
000012  b942              CBNZ     r2,|L2.38|
;;;82           && (pInformation->USBwIndex == 0)) /*call Back usb spec 2.0*/
000014  8882              LDRH     r2,[r0,#4]
000016  b932              CBNZ     r2,|L2.38|
;;;83       {
;;;84         pInformation->Current_Configuration = pInformation->USBwValue0;
000018  7281              STRB     r1,[r0,#0xa]
;;;85         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
;;;86         return USB_SUCCESS;
000022  2000              MOVS     r0,#0
;;;87       }
;;;88       else
;;;89       {
;;;90         return USB_UNSUPPORT;
;;;91       }
;;;92     }
000024  bd10              POP      {r4,pc}
                  |L2.38|
000026  2002              MOVS     r0,#2                 ;90
000028  bd10              POP      {r4,pc}
;;;93     
                          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
;;;102    u8 *Standard_GetInterface(u16 Length)
;;;103    {
000000  b510              PUSH     {r4,lr}
000002  4c07              LDR      r4,|L3.32|
;;;104      if (Length == 0)
000004  b920              CBNZ     r0,|L3.16|
;;;105      {
;;;106        pInformation->Ctrl_Info.Usb_wLength =
000006  6821              LDR      r1,[r4,#0]  ; pInformation
000008  2001              MOVS     r0,#1
00000a  8208              STRH     r0,[r1,#0x10]
;;;107          sizeof(pInformation->Current_AlternateSetting);
;;;108        return 0;
00000c  2000              MOVS     r0,#0
;;;109      }
;;;110      pUser_Standard_Requests->User_GetInterface();
;;;111      return (u8 *)&pInformation->Current_AlternateSetting;
;;;112    }
00000e  bd10              POP      {r4,pc}
                  |L3.16|
000010  4804              LDR      r0,|L3.36|
000012  6800              LDR      r0,[r0,#0]            ;110  ; pUser_Standard_Requests
000014  6880              LDR      r0,[r0,#8]            ;110
000016  4780              BLX      r0                    ;110
000018  6820              LDR      r0,[r4,#0]            ;111  ; pInformation
00001a  300c              ADDS     r0,r0,#0xc            ;111
00001c  bd10              POP      {r4,pc}
;;;113    
                          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
;;;123    RESULT Standard_SetInterface(void)
;;;124    {
000000  b510              PUSH     {r4,lr}
;;;125      RESULT Re;
;;;126      /*Test if the specified Interface and Alternate Setting are supported by
;;;127        the application Firmware*/
;;;128      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
;;;129    
;;;130      if (pInformation->Current_Configuration != 0)
000012  6821              LDR      r1,[r4,#0]  ; pInformation
000014  7a8a              LDRB     r2,[r1,#0xa]
000016  b17a              CBZ      r2,|L4.56|
;;;131      {
;;;132        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|
;;;133            || (pInformation->USBwValue1 != 0))
00001e  7888              LDRB     r0,[r1,#2]
000020  b950              CBNZ     r0,|L4.56|
;;;134        {
;;;135          return  USB_UNSUPPORT;
;;;136        }
;;;137        else if (Re == USB_SUCCESS)
;;;138        {
;;;139          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
;;;140          pInformation->Current_Interface = pInformation->USBwIndex0;
00002a  6820              LDR      r0,[r4,#0]  ; pInformation
00002c  7941              LDRB     r1,[r0,#5]
00002e  72c1              STRB     r1,[r0,#0xb]
;;;141          pInformation->Current_AlternateSetting = pInformation->USBwValue0;
000030  78c1              LDRB     r1,[r0,#3]
000032  7301              STRB     r1,[r0,#0xc]
;;;142          return USB_SUCCESS;
000034  2000              MOVS     r0,#0
;;;143        }
;;;144    
;;;145      }
;;;146    
;;;147      return USB_UNSUPPORT;
;;;148    }
000036  bd10              POP      {r4,pc}
                  |L4.56|
000038  2002              MOVS     r0,#2                 ;147
00003a  bd10              POP      {r4,pc}
;;;149    
                          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
;;;158    u8 *Standard_GetStatus(u16 Length)
;;;159    {
000000  b510              PUSH     {r4,lr}
000002  491f              LDR      r1,|L5.128|
000004  6809              LDR      r1,[r1,#0]
;;;160      if (Length == 0)
000006  b910              CBNZ     r0,|L5.14|
;;;161      {
;;;162        pInformation->Ctrl_Info.Usb_wLength = 2;
000008  2002              MOVS     r0,#2
00000a  8208              STRH     r0,[r1,#0x10]
;;;163        return 0;
00000c  e035              B        |L5.122|
                  |L5.14|
;;;164      }
;;;165    
;;;166      StatusInfo.w = 0;
00000e  481d              LDR      r0,|L5.132|
000010  2200              MOVS     r2,#0
000012  8002              STRH     r2,[r0,#0]  ; StatusInfo
;;;167      /* Reset Status Information */
;;;168    
;;;169      if (Type_Recipient == (STANDARD_REQUEST | DEVICE_RECIPIENT))
000014  780a              LDRB     r2,[r1,#0]
000016  0653              LSLS     r3,r2,#25
000018  d111              BNE      |L5.62|
;;;170      {
;;;171        /*Get Device Status */
;;;172        u8 Feature = pInformation->Current_Feature;
00001a  7a49              LDRB     r1,[r1,#9]
;;;173    
;;;174        /* Remote Wakeup enabled */
;;;175        if (ValBit(Feature, 5))
00001c  068a              LSLS     r2,r1,#26
00001e  d503              BPL      |L5.40|
;;;176        {
;;;177          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|
;;;178        }
;;;179    
;;;180        /* Bus-powered */
;;;181        if (ValBit(Feature, 6))
000028  0649              LSLS     r1,r1,#25
00002a  d503              BPL      |L5.52|
;;;182        {
;;;183          ClrBit(StatusInfo0, 0);
00002c  7801              LDRB     r1,[r0,#0]  ; StatusInfo
00002e  f00101fe          AND      r1,r1,#0xfe
000032  e002              B        |L5.58|
                  |L5.52|
;;;184        }
;;;185        else /* Self-powered */
;;;186        {
;;;187          SetBit(StatusInfo0, 0);
000034  7801              LDRB     r1,[r0,#0]  ; StatusInfo
000036  f0410101          ORR      r1,r1,#1
                  |L5.58|
;;;188        }
;;;189      }
;;;190      /*Interface Status*/
;;;191      else if (Type_Recipient == (STANDARD_REQUEST | INTERFACE_RECIPIENT))
;;;192      {
;;;193        return (u8 *)&StatusInfo;
;;;194      }
;;;195      /*Get EndPoint Status*/
;;;196      else if (Type_Recipient == (STANDARD_REQUEST | ENDPOINT_RECIPIENT))
;;;197      {
;;;198        u8 Related_Endpoint;
;;;199        u8 wIndex0 = pInformation->USBwIndex0;
;;;200    
;;;201        Related_Endpoint = (wIndex0 & 0x0f);
;;;202        if (ValBit(wIndex0, 7))
;;;203        {
;;;204          /* IN endpoint */
;;;205          if (_GetTxStallStatus(Related_Endpoint))
;;;206          {
;;;207            SetBit(StatusInfo0, 0); /* IN Endpoint stalled */
00003a  7001              STRB     r1,[r0,#0]  ; StatusInfo
00003c  e018              B        |L5.112|
                  |L5.62|
00003e  f002027f          AND      r2,r2,#0x7f           ;191
000042  2a01              CMP      r2,#1                 ;191
000044  d101              BNE      |L5.74|
                  |L5.70|
000046  480f              LDR      r0,|L5.132|
;;;208          }
;;;209        }
;;;210        else
;;;211        {
;;;212          /* OUT endpoint */
;;;213          if (_GetRxStallStatus(Related_Endpoint))
;;;214          {
;;;215            SetBit(StatusInfo0, 0); /* OUT Endpoint stalled */
;;;216          }
;;;217        }
;;;218    
;;;219      }
;;;220      else
;;;221      {
;;;222        return NULL;
;;;223      }
;;;224      pUser_Standard_Requests->User_GetStatus();
;;;225      return (u8 *)&StatusInfo;
;;;226    }
000048  bd10              POP      {r4,pc}
                  |L5.74|
00004a  2a02              CMP      r2,#2                 ;196
00004c  d115              BNE      |L5.122|
00004e  794a              LDRB     r2,[r1,#5]            ;199

⌨️ 快捷键说明

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