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

📄 usb_core.s79

📁 用于监视I2C通信总线
💻 S79
📖 第 1 页 / 共 5 页
字号:
//  578           && (ValBit(pInformation->Current_Feature, 5)))
        CMP      R2,#+1
        BNE.N    ??NoData_Setup0_7
        CBNZ     R1,??NoData_Setup0_7
        LSLS     R0,R0,#+26
        BPL.N    ??NoData_Setup0_7
//  579       {
//  580         Result = Standard_SetDeviceFeature();
        BL       Standard_SetDeviceFeature
        B.N      ??NoData_Setup0_2
//  581       }
//  582       else
//  583       {
//  584         Result = USB_UNSUPPORT;
//  585       }
//  586     }
//  587     /*Clear FEATURE for Device */
//  588     else if (RequestNo == CLEAR_FEATURE)
??NoData_Setup0_6:
        CMP      R6,#+1
        BNE.N    ??NoData_Setup0_7
//  589     {
//  590       if (pInformation->USBwValue0 == DEVICE_REMOTE_WAKEUP
//  591           && pInformation->USBwIndex == 0
//  592           && ValBit(pInformation->Current_Feature, 5))
        CMP      R2,#+1
        BNE.N    ??NoData_Setup0_7
        CBNZ     R1,??NoData_Setup0_7
        LSLS     R0,R0,#+26
        BPL.N    ??NoData_Setup0_7
//  593       {
//  594         Result = Standard_ClearFeature();
??NoData_Setup0_8:
        BL       Standard_ClearFeature
        B.N      ??NoData_Setup0_2
//  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))
??NoData_Setup0_0:
        LSLS     R0,R1,#+25
        LSRS     R0,R0,#+25
        CMP      R0,#+1
        BNE.N    ??NoData_Setup0_9
//  606   {
//  607     /*SET INTERFACE*/
//  608     if (RequestNo == SET_INTERFACE)
        CMP      R6,#+11
        BNE.N    ??NoData_Setup0_7
//  609     {
//  610       Result = Standard_SetInterface();
        BL       Standard_SetInterface
        B.N      ??NoData_Setup0_2
//  611     }
//  612   }
//  613 
//  614   /* EndPoint Request*/
//  615   else if (Type_Recipient == (STANDARD_REQUEST | ENDPOINT_RECIPIENT))
??NoData_Setup0_9:
        CMP      R0,#+2
        BNE.N    ??NoData_Setup0_7
//  616   {
//  617     /*CLEAR FEATURE for EndPoint*/
//  618     if (RequestNo == CLEAR_FEATURE)
        CMP      R6,#+1
        BEQ.N    ??NoData_Setup0_8
//  619     {
//  620       Result = Standard_ClearFeature();
//  621     }
//  622     /* SET FEATURE for EndPoint*/
//  623     else if (RequestNo == SET_FEATURE)
??NoData_Setup0_10:
        CMP      R6,#+3
        BNE.N    ??NoData_Setup0_7
//  624     {
//  625       Result = Standard_SetEndPointFeature();
        BL       Standard_SetEndPointFeature
//  626     }
//  627   }
//  628   else
//  629   {
//  630     Result = USB_UNSUPPORT;
//  631   }
//  632 
//  633 
//  634   if (Result != USB_SUCCESS)
??NoData_Setup0_2:
        CBZ      R0,??NoData_Setup0_11
//  635   {
//  636     Result = (*pProperty->Class_NoData_Setup)(RequestNo);
??NoData_Setup0_7:
        LDR.N    R1,??DataTable61  ;; pProperty
        MOVS     R0,R6
        LDR      R1,[R1, #+0]
        LDR      R1,[R1, #+20]
        BLX      R1
//  637     if (Result == USB_NOT_READY)
        CMP      R0,#+3
        BNE.N    ??NoData_Setup0_11
//  638     {
//  639       ControlState = PAUSE;
        MOVS     R4,#+9
//  640       goto exit_NoData_Setup0;
        B.N      ??NoData_Setup0_4
//  641     }
//  642   }
//  643 
//  644   if (Result != USB_SUCCESS)
??NoData_Setup0_11:
        CBNZ     R0,??NoData_Setup0_4
//  645   {
//  646     ControlState = STALLED;
//  647     goto exit_NoData_Setup0;
//  648   }
//  649 
//  650   ControlState = WAIT_STATUS_IN;/* After no data stage SETUP */
//  651 
//  652   USB_StatusIn();
??NoData_Setup0_5:
        LDR.N    R0,??DataTable45  ;; 0x40005c50
        LDR.N    R1,??DataTable46  ;; 0x40006004
        MOVS     R2,#+0
        LDR      R0,[R0, #+0]
        MOVS     R4,#+6
        UXTH     R0,R0
        STR      R2,[R1, R0, LSL #+1]
        LDR.N    R0,??DataTable47  ;; SaveTState
        MOVS     R1,#+48
        STRH     R1,[R0, #+0]
//  653 
//  654 exit_NoData_Setup0:
//  655   pInformation->ControlState = ControlState;
??NoData_Setup0_4:
        LDR      R0,[R5, #+0]
        STRB     R4,[R0, #+8]
//  656   return;
        POP      {R4-R6,PC}       ;; return
        CFI EndBlock cfiBlock12
//  657 }

        RSEG CODE:CODE:NOROOT(2)
        DATA
??DataTable43:
        DC32     pInformation

        RSEG CODE:CODE:NOROOT(2)
        DATA
??DataTable45:
        DC32     0x40005c50

        RSEG CODE:CODE:NOROOT(2)
        DATA
??DataTable46:
        DC32     0x40006004

        RSEG CODE:CODE:NOROOT(2)
        DATA
??DataTable47:
        DC32     SaveTState
//  658 
//  659 /*******************************************************************************
//  660 * Function Name  : Data_Setup0.
//  661 * Description    : Proceed the processing of setup request with data stage.
//  662 * Input          : None.
//  663 * Output         : None.
//  664 * Return         : None.
//  665 *******************************************************************************/

        RSEG CODE:CODE:NOROOT(2)
        CFI Block cfiBlock13 Using cfiCommon0
        CFI Function Data_Setup0
        THUMB
//  666 void Data_Setup0(void)
//  667 {
//  668   u8 *(*CopyRoutine)(u16);
//  669   RESULT Result;
//  670   u32 Request_No = pInformation->USBbRequest;
//  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)
Data_Setup0:
        LDR.N    R2,??DataTable61  ;; pProperty
        PUSH     {R0,R4-R9,LR}
        CFI ?RET Frame(CFA, -4)
        CFI R9 Frame(CFA, -8)
        CFI R8 Frame(CFA, -12)
        CFI R7 Frame(CFA, -16)
        CFI R6 Frame(CFA, -20)
        CFI R5 Frame(CFA, -24)
        CFI R4 Frame(CFA, -28)
        CFI CFA R13+32
        LDR.N    R5,??DataTable63  ;; pInformation
        MOV      R8,R2
        LDR      R2,[R8, #+0]
        LDR      R0,[R5, #+0]
        LDRB     R4,[R0, #+1]
        LDRB     R3,[R0, #+0]
        MOVS     R6,#+9
        MOV      R9,R6
        LSLS     R1,R3,#+25
        LSRS     R1,R1,#+25
        CMP      R4,#+6
        BNE.N    ??Data_Setup0_0
//  681   {
//  682     if (Type_Recipient == (STANDARD_REQUEST | DEVICE_RECIPIENT))
        CMP      R1,#+0
        BNE.N    ??Data_Setup0_1
//  683     {
//  684       u8 wValue1 = pInformation->USBwValue1;
        LDRB     R0,[R0, #+2]
//  685       if (wValue1 == DEVICE_DESCRIPTOR)
        CMP      R0,#+1
        BNE.N    ??Data_Setup0_2
//  686       {
//  687         CopyRoutine = pProperty->GetDeviceDescriptor;
        LDR      R4,[R2, #+28]
        B.N      ??Data_Setup0_3
//  688       }
//  689       else if (wValue1 == CONFIG_DESCRIPTOR)
??Data_Setup0_2:
        CMP      R0,#+2
        BNE.N    ??Data_Setup0_4
//  690       {
//  691         CopyRoutine = pProperty->GetConfigDescriptor;
        LDR      R4,[R2, #+32]
        B.N      ??Data_Setup0_3
//  692       }
//  693       else if (wValue1 == STRING_DESCRIPTOR)
??Data_Setup0_4:
        CMP      R0,#+3
        BNE.N    ??Data_Setup0_1
//  694       {
//  695         CopyRoutine = pProperty->GetStringDescriptor;
        LDR      R4,[R2, #+36]
        B.N      ??Data_Setup0_3
//  696       }  /* End of GET_DESCRIPTOR */
//  697     }
//  698   }
//  699 
//  700   /*GET STATUS*/
//  701   else if ((Request_No == GET_STATUS) && (pInformation->USBwValue == 0)
//  702            && (pInformation->USBwLength == 0x0002)
//  703            && (pInformation->USBwIndex1 == 0))
??Data_Setup0_0:
        LDR      R2,[R2, #+24]
        LDRH     R6,[R0, #+6]
        LDRH     R7,[R0, #+2]
        CMP      R4,#+0
        BNE.N    ??Data_Setup0_5
        CMP      R7,#+0
        BNE.N    ??Data_Setup0_1
        CMP      R6,#+2
        BNE.N    ??Data_Setup0_1
        LDRB     R4,[R0, #+4]
        CMP      R4,#+0
        BNE.N    ??Data_Setup0_1
//  704   {
//  705     /* GET STATUS for Device*/
//  706     if ((Type_Recipient == (STANDARD_REQUEST | DEVICE_RECIPIENT))
//  707         && (pInformation->USBwIndex == 0))
        LDR.N    R4,??Data_Setup0_6  ;; Standard_GetStatus
        CBNZ     R1,??Data_Setup0_7
        LDRH     R1,[R0, #+4]
        CMP      R1,#+0
        BEQ.N    ??Data_Setup0_3
//  708     {
//  709       CopyRoutine = Standard_GetStatus;
//  710     }
//  711 
//  712     /* GET STATUS for Interface*/
//  713     else if (Type_Recipient == (STANDARD_REQUEST | INTERFACE_RECIPIENT))
??Data_Setup0_7:
        LDRB     R0,[R0, #+5]
        LSLS     R1,R3,#+25
        LSRS     R1,R1,#+25
        CMP      R1,#+1
        BNE.N    ??Data_Setup0_8
//  714     {
//  715       if (((*pProperty->Class_Get_Interface_Setting)(pInformation->USBwIndex0, 0) == USB_SUCCESS)
//  716           && (pInformation->Current_Configuration != 0))
        MOVS     R1,#+0
        BLX      R2
        CMP      R0,#+0
        BNE.N    ??Data_Setup0_1
        LDR      R0,[R5, #+0]
        LDRB     R0,[R0, #+10]
        CMP      R0,#+0
        BEQ.N    ??Data_Setup0_1
//  717       {
//  718         CopyRoutine = Standard_GetStatus;
        B.N      ??Data_Setup0_3
//  719       }
//  720     }
//  721 
//  722     /* GET STATUS for EndPoint*/
//  723     else if (Type_Recipient == (STANDARD_REQUEST | ENDPOINT_RECIPIENT))
??Data_Setup0_8:
        CMP      R1,#+2
        BNE.N    ??Data_Setup0_1
//  724     {
//  725       Related_Endpoint = (pInformation->USBwIndex0 & 0x0f);
        LSLS     R1,R0,#+28
        LSRS     R1,R1,#+28
//  726       Reserved = pInformation->USBwIndex0 & 0x70;
        ANDS     R2,R0,#0x70
//  727 
//  728       if (ValBit(pInformation->USBwIndex0, 7))
        LSLS     R0,R0,#+24
        BPL.N    ??Data_Setup0_9
//  729       {
//  730         /*Get Status of endpoint & stall the request if the related_ENdpoint
//  731         is Disabled*/
//  732         Status = _GetEPTxStatus(Related_Endpoint);
        LDR.N    R0,??DataTable67  ;; 0x40005c00
        LDR      R0,[R0, R1, LSL #+2]
        ANDS     R0,R0,#0x30
        B.N      ??Data_Setup0_10
//  733       }
//  734       else
//  735       {
//  736         Status = _GetEPRxStatus(Related_Endpoint);
??Data_Setup0_9:
        LDR.N    R0,??DataTable67  ;; 0x40005c00
        LDR      R0,[R0, R1, LSL #+2]
        ANDS     R0,R0,#0x3000
//  737       }
//  738 
//  739       if ((Related_Endpoint < Device_Table.Total_Endpoint) && (Reserved == 0)
//  740           && (Status != 0))
??Data_Setup0_10:
        LDR.N    R3,??DataTable66  ;; Device_Table
        LDRB     R3,[R3, #+0]
        CMP      R1,R3
        BCS.N    ??Data_Setup0_1
        CBNZ     R2,??Data_Setup0_1
        CBZ      R0,??Data_Setup0_1
//  741       {
//  742         CopyRoutine = Standard_GetStatus;
        B.N      ??Data_Setup0_3
//  743       }
//  744     }
//  745 
//  746   }
//  747 
//  748   /*GET CONFIGURATION*/
//  749   else if (Request_No == GET_CONFIGURATION)
??Data_Setup0_5:
        CMP      R4,#+8
        BNE.N    ??Data_Setup0_11
//  750   {
//  751     if (Type_Recipient == (STANDARD_REQUEST | DEVICE_RECIPIENT))
        CBNZ     R1,??Data_Setup0_1
//  752     {
//  753       CopyRoutine = Standard_GetConfiguration;
        LDR.N    R4,??Data_Setup0_6+0x4  ;; Standard_GetConfiguration
 

⌨️ 快捷键说明

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