📄 usb_core.txt
字号:
000144 4b14 LDR r3,|L3.408|
000146 f890002c LDRB r0,[r0,#0x2c] ;815
00014a 4282 CMP r2,r0 ;815
00014c d201 BCS |L3.338|
00014e 701f STRB r7,[r3,#0] ;817
000150 e006 B |L3.352|
|L3.338|
000152 fbb2f4f0 UDIV r4,r2,r0 ;819
000156 fb002014 MLS r0,r0,r4,r2 ;819
00015a b908 CBNZ r0,|L3.352|
00015c 2001 MOVS r0,#1 ;821
00015e 7018 STRB r0,[r3,#0] ;821
|L3.352|
000160 6828 LDR r0,[r5,#0] ;825 ; pProperty
000162 f890002c LDRB r0,[r0,#0x2c] ;825
000166 8288 STRH r0,[r1,#0x14] ;825
000168 e8bd41f0 POP {r4-r8,lr} ;826
00016c f7ffbffe B.W DataStageIn
|L3.368|
000170 2003 MOVS r0,#3 ;830
000172 7208 STRB r0,[r1,#8] ;830
000174 4909 LDR r1,|L3.412|
000176 0300 LSLS r0,r0,#12 ;831
000178 8008 STRH r0,[r1,#0] ;831
00017a e7c9 B |L3.272|
;;;836
ENDP
|L3.380|
DCD pInformation
|L3.384|
DCD pProperty
|L3.388|
DCD Standard_GetStatus
|L3.392|
DCD 0x40005000
|L3.396|
DCD Device_Table
|L3.400|
DCD Standard_GetConfiguration
|L3.404|
DCD Standard_GetInterface
|L3.408|
DCD ||.data||
|L3.412|
DCD SaveRState
AREA ||i.In0_Process||, CODE, READONLY, ALIGN=2
In0_Process PROC
;;;887 *******************************************************************************/
;;;888 u8 In0_Process(void)
000000 b510 PUSH {r4,lr}
;;;889 {
;;;890 u32 ControlState = pInformation->ControlState;
000002 4c13 LDR r4,|L4.80|
000004 6820 LDR r0,[r4,#0] ; pInformation
000006 7a01 LDRB r1,[r0,#8]
;;;891
;;;892 if ((ControlState == IN_DATA) || (ControlState == LAST_IN_DATA))
000008 2902 CMP r1,#2
00000a d001 BEQ |L4.16|
00000c 2904 CMP r1,#4
00000e d104 BNE |L4.26|
|L4.16|
;;;893 {
;;;894 DataStageIn();
000010 f7fffffe BL DataStageIn
;;;895 /* ControlState may be changed outside the function */
;;;896 ControlState = pInformation->ControlState;
000014 6820 LDR r0,[r4,#0] ; pInformation
000016 7a00 LDRB r0,[r0,#8]
000018 e013 B |L4.66|
|L4.26|
;;;897 }
;;;898
;;;899 else if (ControlState == WAIT_STATUS_IN)
00001a 2906 CMP r1,#6
00001c d110 BNE |L4.64|
;;;900 {
;;;901 if ((pInformation->USBbRequest == SET_ADDRESS) &&
00001e 7841 LDRB r1,[r0,#1]
000020 2905 CMP r1,#5
000022 d109 BNE |L4.56|
;;;902 (Type_Recipient == (STANDARD_REQUEST | DEVICE_RECIPIENT)))
000024 7801 LDRB r1,[r0,#0]
000026 0649 LSLS r1,r1,#25
000028 d106 BNE |L4.56|
;;;903 {
;;;904 SetDeviceAddress(pInformation->USBwValue0);
00002a 78c0 LDRB r0,[r0,#3]
00002c f7fffffe BL SetDeviceAddress
;;;905 pUser_Standard_Requests->User_SetDeviceAddress();
000030 4808 LDR r0,|L4.84|
000032 6800 LDR r0,[r0,#0] ; pUser_Standard_Requests
000034 6a00 LDR r0,[r0,#0x20]
000036 4780 BLX r0
|L4.56|
;;;906 }
;;;907 (*pProperty->Process_Status_IN)();
000038 4807 LDR r0,|L4.88|
00003a 6800 LDR r0,[r0,#0] ; pProperty
00003c 6880 LDR r0,[r0,#8]
00003e 4780 BLX r0
|L4.64|
;;;908 ControlState = STALLED;
;;;909 }
;;;910
;;;911 else
;;;912 {
;;;913 ControlState = STALLED;
000040 2008 MOVS r0,#8
|L4.66|
;;;914 }
;;;915
;;;916 pInformation->ControlState = ControlState;
000042 6821 LDR r1,[r4,#0] ; pInformation
000044 7208 STRB r0,[r1,#8]
;;;917
;;;918 return Post0_Process();
000046 e8bd4010 POP {r4,lr}
00004a f7ffbffe B.W Post0_Process
;;;919 }
;;;920
ENDP
00004e 0000 DCW 0x0000
|L4.80|
DCD pInformation
|L4.84|
DCD pUser_Standard_Requests
|L4.88|
DCD pProperty
AREA ||i.NOP_Process||, CODE, READONLY, ALIGN=1
NOP_Process PROC
;;;1008 *******************************************************************************/
;;;1009 void NOP_Process(void)
000000 4770 BX lr
;;;1010 {
;;;1011 }
;;;1012
ENDP
AREA ||i.NoData_Setup0||, CODE, READONLY, ALIGN=2
NoData_Setup0 PROC
;;;541 *******************************************************************************/
;;;542 void NoData_Setup0(void)
000000 b570 PUSH {r4-r6,lr}
;;;543 {
;;;544 RESULT Result = USB_UNSUPPORT;
;;;545 u32 RequestNo = pInformation->USBbRequest;
000002 4d30 LDR r5,|L6.196|
;;;546 u32 ControlState;
;;;547
;;;548 if (Type_Recipient == (STANDARD_REQUEST | DEVICE_RECIPIENT))
000004 6828 LDR r0,[r5,#0] ; pInformation
000006 7801 LDRB r1,[r0,#0]
000008 7844 LDRB r4,[r0,#1] ;545
00000a 064a LSLS r2,r1,#25
00000c d128 BNE |L6.96|
;;;549 {
;;;550 /* Device Request*/
;;;551 /* SET_CONFIGURATION*/
;;;552 if (RequestNo == SET_CONFIGURATION)
00000e 2c09 CMP r4,#9
000010 d102 BNE |L6.24|
;;;553 {
;;;554 Result = Standard_SetConfiguration();
000012 f7fffffe BL Standard_SetConfiguration
000016 e037 B |L6.136|
|L6.24|
;;;555 }
;;;556
;;;557 /*SET ADDRESS*/
;;;558 else if (RequestNo == SET_ADDRESS)
000018 2c05 CMP r4,#5
00001a d109 BNE |L6.48|
;;;559 {
;;;560 if ((pInformation->USBwValue0 > 127) || (pInformation->USBwValue1 != 0)
00001c 78c1 LDRB r1,[r0,#3]
00001e 297f CMP r1,#0x7f
000020 d83e BHI |L6.160|
000022 7881 LDRB r1,[r0,#2]
000024 2900 CMP r1,#0
000026 d13b BNE |L6.160|
;;;561 || (pInformation->USBwIndex != 0)
000028 8881 LDRH r1,[r0,#4]
00002a bbb9 CBNZ r1,|L6.156|
;;;562 || (pInformation->Current_Configuration != 0))
00002c 7a80 LDRB r0,[r0,#0xa]
00002e e036 B |L6.158|
|L6.48|
;;;563 /* Device Address should be 127 or less*/
;;;564 {
;;;565 ControlState = STALLED;
;;;566 goto exit_NoData_Setup0;
;;;567 }
;;;568 else
;;;569 {
;;;570 Result = USB_SUCCESS;
;;;571 }
;;;572 }
;;;573 /*SET FEATURE for Device*/
;;;574 else if (RequestNo == SET_FEATURE)
000030 2c03 CMP r4,#3
000032 d10a BNE |L6.74|
;;;575 {
;;;576 if ((pInformation->USBwValue0 == DEVICE_REMOTE_WAKEUP)
000034 78c1 LDRB r1,[r0,#3]
000036 2901 CMP r1,#1
000038 d127 BNE |L6.138|
;;;577 && (pInformation->USBwIndex == 0)
00003a 8881 LDRH r1,[r0,#4]
00003c bb29 CBNZ r1,|L6.138|
;;;578 && (ValBit(pInformation->Current_Feature, 5)))
00003e 7a40 LDRB r0,[r0,#9]
000040 0680 LSLS r0,r0,#26
000042 d522 BPL |L6.138|
;;;579 {
;;;580 Result = Standard_SetDeviceFeature();
000044 f7fffffe BL Standard_SetDeviceFeature
000048 e01e B |L6.136|
|L6.74|
;;;581 }
;;;582 else
;;;583 {
;;;584 Result = USB_UNSUPPORT;
;;;585 }
;;;586 }
;;;587 /*Clear FEATURE for Device */
;;;588 else if (RequestNo == CLEAR_FEATURE)
00004a 2c01 CMP r4,#1
00004c d11d BNE |L6.138|
;;;589 {
;;;590 if (pInformation->USBwValue0 == DEVICE_REMOTE_WAKEUP
00004e 78c1 LDRB r1,[r0,#3]
000050 2901 CMP r1,#1
000052 d11a BNE |L6.138|
;;;591 && pInformation->USBwIndex == 0
000054 8881 LDRH r1,[r0,#4]
000056 b9c1 CBNZ r1,|L6.138|
;;;592 && ValBit(pInformation->Current_Feature, 5))
000058 7a40 LDRB r0,[r0,#9]
00005a 0680 LSLS r0,r0,#26
00005c d515 BPL |L6.138|
00005e e00c B |L6.122|
|L6.96|
;;;593 {
;;;594 Result = Standard_ClearFeature();
;;;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))
000060 f001007f AND r0,r1,#0x7f
000064 2801 CMP r0,#1
000066 d104 BNE |L6.114|
;;;606 {
;;;607 /*SET INTERFACE*/
;;;608 if (RequestNo == SET_INTERFACE)
000068 2c0b CMP r4,#0xb
00006a d10e BNE |L6.138|
;;;609 {
;;;610 Result = Standard_SetInterface();
00006c f7fffffe BL Standard_SetInterface
000070 e00a B |L6.136|
|L6.114|
;;;611 }
;;;612 }
;;;613
;;;614 /* EndPoint Request*/
;;;615 else if (Type_Recipient == (STANDARD_REQUEST | ENDPOINT_RECIPIENT))
000072 2802 CMP r0,#2
000074 d109 BNE |L6.138|
;;;616 {
;;;617 /*CLEAR FEATURE for EndPoint*/
;;;618 if (RequestNo == CLEAR_FEATURE)
000076 2c01 CMP r4,#1
000078 d102 BNE |L6.128|
|L6.122|
;;;619 {
;;;620 Result = Standard_ClearFeature();
00007a f7fffffe BL Standard_ClearFeature
00007e e003 B |L6.136|
|L6.128|
;;;621 }
;;;622 /* SET FEATURE for EndPoint*/
;;;623 else if (RequestNo == SET_FEATURE)
000080 2c03 CMP r4,#3
000082 d102 BNE |L6.138|
;;;624 {
;;;625 Result = Standard_SetEndPointFeature();
000084 f7fffffe BL Standard_SetEndPointFeature
|L6.136|
;;;626 }
;;;627 }
;;;628 else
;;;629 {
;;;630 Result = USB_UNSUPPORT;
;;;631 }
;;;632
;;;633
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -