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

📄 usb_prop.txt

📁 STM32F103ZET6+UCOSII+UCGUI源码
💻 TXT
📖 第 1 页 / 共 2 页
字号:
; generated by ARM C/C++ Compiler with , RVCT4.0 [Build 524] for uVision
; commandline ArmCC [--split_sections --debug -c --asm --interleave -o.\Obj\usb_prop.o --depend=.\Obj\usb_prop.d --device=DARMSTM --apcs=interwork -O3 -I..\..\include -I..\..\..\FWLib\library\inc -I..\..\..\USBLib\library\inc -I..\..\Config -I..\..\GUI\Core -I..\..\GUI\Font -I..\..\GUI\ConvertColor -I..\..\GUI\AntiAlias -I..\..\GUI\ConvertMono -I..\..\GUI\JPEG -I..\..\GUI\MemDev -I..\..\GUI\MultiLayer -I..\..\GUI\Widget -I..\..\GUI\WM -IC:\Keil\ARM\INC\ST\STM32F10x ..\..\source\usb_prop.c]
                          THUMB

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

                  Get_Max_Lun PROC
;;;382    *******************************************************************************/
;;;383    u8 *Get_Max_Lun(u16 Length)
000000  b928              CBNZ     r0,|L1.14|
;;;384    {
;;;385      if (Length == 0)
;;;386      {
;;;387        pInformation->Ctrl_Info.Usb_wLength = LUN_DATA_LENGTH;
000002  4904              LDR      r1,|L1.20|
000004  2001              MOVS     r0,#1
000006  6809              LDR      r1,[r1,#0]  ; pInformation
000008  8208              STRH     r0,[r1,#0x10]
;;;388        return 0;
00000a  2000              MOVS     r0,#0
;;;389      }
;;;390      else
;;;391      {
;;;392        return((u8*)(&Max_Lun));
;;;393      }
;;;394    }
00000c  4770              BX       lr
                  |L1.14|
00000e  4802              LDR      r0,|L1.24|
000010  4770              BX       lr
;;;395    
                          ENDP

000012  0000              DCW      0x0000
                  |L1.20|
                          DCD      pInformation
                  |L1.24|
                          DCD      ||.data||

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

                  MASS_Data_Setup PROC
;;;252    *******************************************************************************/
;;;253    RESULT MASS_Data_Setup(u8 RequestNo)
000000  b500              PUSH     {lr}
;;;254    {
;;;255      u8    *(*CopyRoutine)(u16);
;;;256    
;;;257      CopyRoutine = NULL;
;;;258      if ((Type_Recipient == (CLASS_REQUEST | INTERFACE_RECIPIENT))
000002  490d              LDR      r1,|L2.56|
000004  6809              LDR      r1,[r1,#0]  ; pInformation
000006  780a              LDRB     r2,[r1,#0]
000008  f002027f          AND      r2,r2,#0x7f
00000c  2a21              CMP      r2,#0x21
00000e  d110              BNE      |L2.50|
;;;259          && (RequestNo == GET_MAX_LUN) && (pInformation->USBwValue == 0)
000010  28fe              CMP      r0,#0xfe
000012  d10e              BNE      |L2.50|
000014  8848              LDRH     r0,[r1,#2]
000016  b960              CBNZ     r0,|L2.50|
;;;260          && (pInformation->USBwIndex == 0) && (pInformation->USBwLength == 0x01))
000018  8888              LDRH     r0,[r1,#4]
00001a  b950              CBNZ     r0,|L2.50|
00001c  88c8              LDRH     r0,[r1,#6]
00001e  2801              CMP      r0,#1
000020  d107              BNE      |L2.50|
;;;261      {
;;;262        CopyRoutine = Get_Max_Lun;
000022  4806              LDR      r0,|L2.60|
;;;263      }
;;;264      else
;;;265      {
;;;266        return USB_UNSUPPORT;
;;;267      }
;;;268    
;;;269      if (CopyRoutine == NULL)
;;;270      {
;;;271        return USB_UNSUPPORT;
;;;272      }
;;;273    
;;;274      pInformation->Ctrl_Info.CopyData = CopyRoutine;
;;;275      pInformation->Ctrl_Info.Usb_wOffset = 0;
000024  6188              STR      r0,[r1,#0x18]
000026  2000              MOVS     r0,#0
000028  8248              STRH     r0,[r1,#0x12]
;;;276      (*CopyRoutine)(0);
00002a  f7fffffe          BL       Get_Max_Lun
;;;277    
;;;278      return USB_SUCCESS;
00002e  2000              MOVS     r0,#0
;;;279    
;;;280    }
000030  bd00              POP      {pc}
                  |L2.50|
000032  2002              MOVS     r0,#2                 ;266
000034  bd00              POP      {pc}
;;;281    
                          ENDP

000036  0000              DCW      0x0000
                  |L2.56|
                          DCD      pInformation
                  |L2.60|
                          DCD      Get_Max_Lun

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

                  MASS_GetConfigDescriptor PROC
;;;349    *******************************************************************************/
;;;350    u8 *MASS_GetConfigDescriptor(u16 Length)
000000  4901              LDR      r1,|L3.8|
;;;351    {
;;;352      return Standard_GetDescriptorData(Length, &Config_Descriptor );
000002  f7ffbffe          B.W      Standard_GetDescriptorData
;;;353    }
;;;354    
                          ENDP

000006  0000              DCW      0x0000
                  |L3.8|
                          DCD      ||.data||+0xc

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

                  MASS_GetDeviceDescriptor PROC
;;;337    *******************************************************************************/
;;;338    u8 *MASS_GetDeviceDescriptor(u16 Length)
000000  4901              LDR      r1,|L4.8|
;;;339    {
;;;340      return Standard_GetDescriptorData(Length, &Device_Descriptor );
000002  f7ffbffe          B.W      Standard_GetDescriptorData
;;;341    }
;;;342    
                          ENDP

000006  0000              DCW      0x0000
                  |L4.8|
                          DCD      ||.data||+0x4

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

                  MASS_GetStringDescriptor PROC
;;;361    *******************************************************************************/
;;;362    u8 *MASS_GetStringDescriptor(u16 Length)
000000  4905              LDR      r1,|L5.24|
;;;363    {
;;;364      u8 wValue0 = pInformation->USBwValue0;
000002  6809              LDR      r1,[r1,#0]  ; pInformation
000004  78c9              LDRB     r1,[r1,#3]
;;;365    
;;;366      if (wValue0 > 5)
000006  2905              CMP      r1,#5
000008  d901              BLS      |L5.14|
;;;367      {
;;;368        return NULL;
00000a  2000              MOVS     r0,#0
;;;369      }
;;;370      else
;;;371      {
;;;372        return Standard_GetDescriptorData(Length, &String_Descriptor[wValue0]);
;;;373      }
;;;374    }
00000c  4770              BX       lr
                  |L5.14|
00000e  4a03              LDR      r2,|L5.28|
000010  eb0201c1          ADD      r1,r2,r1,LSL #3       ;372
000014  f7ffbffe          B.W      Standard_GetDescriptorData
;;;375    
                          ENDP

                  |L5.24|
                          DCD      pInformation
                  |L5.28|
                          DCD      ||.data||+0x44

                          AREA ||i.MASS_Get_Interface_Setting||, CODE, READONLY, ALIGN=1

                  MASS_Get_Interface_Setting PROC
;;;317    *******************************************************************************/
;;;318    RESULT MASS_Get_Interface_Setting(u8 Interface, u8 AlternateSetting)
000000  b909              CBNZ     r1,|L6.6|
;;;319    {
;;;320      if (AlternateSetting > 0)
;;;321      {
;;;322        return USB_UNSUPPORT;/* in this application we don't have AlternateSetting*/
;;;323      }
;;;324      else if (Interface > 0)
000002  2800              CMP      r0,#0
000004  d000              BEQ      |L6.8|
                  |L6.6|
;;;325      {
;;;326        return USB_UNSUPPORT;/*in this application we have only 1 interfaces*/
000006  2002              MOVS     r0,#2
                  |L6.8|
;;;327      }
;;;328      return USB_SUCCESS;
;;;329    }
000008  4770              BX       lr
;;;330    
                          ENDP


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

                  MASS_NoData_Setup PROC
;;;288    *******************************************************************************/
;;;289    RESULT MASS_NoData_Setup(u8 RequestNo)
000000  b510              PUSH     {r4,lr}
;;;290    {
;;;291      if ((Type_Recipient == (CLASS_REQUEST | INTERFACE_RECIPIENT))
000002  490f              LDR      r1,|L7.64|
000004  6809              LDR      r1,[r1,#0]  ; pInformation
000006  780a              LDRB     r2,[r1,#0]
000008  f002027f          AND      r2,r2,#0x7f
00000c  2a21              CMP      r2,#0x21
00000e  d114              BNE      |L7.58|
;;;292          && (RequestNo == MASS_STORAGE_RESET) && (pInformation->USBwValue == 0)
000010  28ff              CMP      r0,#0xff
000012  d112              BNE      |L7.58|
000014  8848              LDRH     r0,[r1,#2]
000016  b980              CBNZ     r0,|L7.58|
;;;293          && (pInformation->USBwIndex == 0) && (pInformation->USBwLength == 0x00))
000018  8888              LDRH     r0,[r1,#4]
00001a  b970              CBNZ     r0,|L7.58|
00001c  88c8              LDRH     r0,[r1,#6]
00001e  b960              CBNZ     r0,|L7.58|
;;;294      {
;;;295        /* Initialize Endpoint 1 */
;;;296        ClearDTOG_TX(ENDP1);
000020  2001              MOVS     r0,#1
000022  f7fffffe          BL       ClearDTOG_TX
;;;297    
;;;298        /* Initialize Endpoint 2 */
;;;299        ClearDTOG_RX(ENDP2);
000026  2002              MOVS     r0,#2
000028  f7fffffe          BL       ClearDTOG_RX
;;;300    
;;;301        /*intialise the CBW signature to enable the clear feature*/
;;;302        CBW.dSignature = BOT_CBW_SIGNATURE;
00002c  4906              LDR      r1,|L7.72|
00002e  4805              LDR      r0,|L7.68|
;;;303        Bot_State = BOT_IDLE;
000030  6008              STR      r0,[r1,#0]  ; CBW
000032  4906              LDR      r1,|L7.76|
000034  2000              MOVS     r0,#0
000036  7008              STRB     r0,[r1,#0]
;;;304    
;;;305        return USB_SUCCESS;
;;;306      }
;;;307      return USB_UNSUPPORT;
;;;308    }
000038  bd10              POP      {r4,pc}
                  |L7.58|
00003a  2002              MOVS     r0,#2                 ;307
00003c  bd10              POP      {r4,pc}
;;;309    
                          ENDP

00003e  0000              DCW      0x0000
                  |L7.64|
                          DCD      pInformation
                  |L7.68|
                          DCD      0x43425355
                  |L7.72|
                          DCD      ||CBW||
                  |L7.76|
                          DCD      Bot_State

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

                  MASS_Reset PROC
;;;129    *******************************************************************************/
;;;130    void MASS_Reset()
000000  b570              PUSH     {r4-r6,lr}
;;;131    {
;;;132      /* Set the device as not configured */
;;;133      Device_Info.Current_Configuration = 0;
000002  4831              LDR      r0,|L8.200|
000004  2500              MOVS     r5,#0
000006  7285              STRB     r5,[r0,#0xa]
;;;134    
;;;135      /* Current Feature initialization */
;;;136      pInformation->Current_Feature = MASS_ConfigDescriptor[7];
000008  4931              LDR      r1,|L8.208|
00000a  4830              LDR      r0,|L8.204|
00000c  6809              LDR      r1,[r1,#0]  ; pInformation
00000e  79c0              LDRB     r0,[r0,#7]  ; MASS_ConfigDescriptor
000010  7248              STRB     r0,[r1,#9]
;;;137    
;;;138      SetBTABLE(BTABLE_ADDRESS);
000012  4628              MOV      r0,r5
000014  f7fffffe          BL       SetBTABLE
;;;139    
;;;140      /* Initialize Endpoint 0 */
;;;141      SetEPType(ENDP0, EP_CONTROL);
000018  f44f7100          MOV      r1,#0x200
00001c  2000              MOVS     r0,#0
00001e  f7fffffe          BL       SetEPType
;;;142      SetEPTxStatus(ENDP0, EP_TX_NAK);
000022  2120              MOVS     r1,#0x20
000024  2000              MOVS     r0,#0
000026  f7fffffe          BL       SetEPTxStatus
;;;143      SetEPRxAddr(ENDP0, ENDP0_RXADDR);
00002a  2118              MOVS     r1,#0x18
00002c  2000              MOVS     r0,#0
00002e  f7fffffe          BL       SetEPRxAddr
;;;144      SetEPRxCount(ENDP0, Device_Property.MaxPacketSize);
000032  4c28              LDR      r4,|L8.212|
000034  2000              MOVS     r0,#0
000036  7821              LDRB     r1,[r4,#0]  ; Device_Property
000038  f7fffffe          BL       SetEPRxCount
;;;145      SetEPTxAddr(ENDP0, ENDP0_TXADDR);
00003c  2158              MOVS     r1,#0x58
00003e  2000              MOVS     r0,#0
000040  f7fffffe          BL       SetEPTxAddr
;;;146      Clear_Status_Out(ENDP0);
000044  2000              MOVS     r0,#0
000046  f7fffffe          BL       Clear_Status_Out
;;;147      SetEPRxValid(ENDP0);
00004a  2000              MOVS     r0,#0
00004c  f7fffffe          BL       SetEPRxValid
;;;148    
;;;149      /* Initialize Endpoint 1 */

⌨️ 快捷键说明

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