📄 usb_core.txt
字号:
;;;611 if (RequestNo == CLEAR_FEATURE)
000076 2c01 CMP r4,#1
000078 d102 BNE |L11.128|
|L11.122|
;;;612 {
;;;613 Result = Standard_ClearFeature();
00007a f7fffffe BL Standard_ClearFeature
00007e e003 B |L11.136|
|L11.128|
;;;614 }
;;;615 /* SET FEATURE for EndPoint*/
;;;616 else if (RequestNo == SET_FEATURE)
000080 2c03 CMP r4,#3
000082 d102 BNE |L11.138|
;;;617 {
;;;618 Result = Standard_SetEndPointFeature();
000084 f7fffffe BL Standard_SetEndPointFeature
|L11.136|
;;;619 }
;;;620 }
;;;621 else
;;;622 {
;;;623 Result = USB_UNSUPPORT;
;;;624 }
;;;625
;;;626
;;;627 if (Result != USB_SUCCESS)
000088 b160 CBZ r0,|L11.164|
|L11.138|
;;;628 {
;;;629 Result = (*pProperty->Class_NoData_Setup)(RequestNo);
00008a 480f LDR r0,|L11.200|
00008c 6800 LDR r0,[r0,#0] ; pProperty
00008e 6941 LDR r1,[r0,#0x14]
000090 b2e0 UXTB r0,r4
000092 4788 BLX r1
;;;630 if (Result == USB_NOT_READY)
000094 2803 CMP r0,#3
000096 d102 BNE |L11.158|
;;;631 {
;;;632 ControlState = PAUSE;
000098 2009 MOVS r0,#9
;;;633 goto exit_NoData_Setup0;
00009a e00f B |L11.188|
|L11.156|
00009c e000 B |L11.160|
|L11.158|
;;;634 }
;;;635 }
;;;636
;;;637 if (Result != USB_SUCCESS)
00009e b108 CBZ r0,|L11.164|
|L11.160|
;;;638 {
;;;639 ControlState = STALLED;
0000a0 2008 MOVS r0,#8
;;;640 goto exit_NoData_Setup0;
0000a2 e00b B |L11.188|
|L11.164|
;;;641 }
;;;642
;;;643 ControlState = WAIT_STATUS_IN;/* After no data stage SETUP */
;;;644
;;;645 USB_StatusIn();
0000a4 4a09 LDR r2,|L11.204|
0000a6 2006 MOVS r0,#6 ;643
0000a8 6813 LDR r3,[r2,#0]
0000aa 2100 MOVS r1,#0
0000ac 4a08 LDR r2,|L11.208|
0000ae b29b UXTH r3,r3
0000b0 eb020243 ADD r2,r2,r3,LSL #1
0000b4 6051 STR r1,[r2,#4]
0000b6 4a07 LDR r2,|L11.212|
0000b8 2130 MOVS r1,#0x30
0000ba 8011 STRH r1,[r2,#0] ; SaveTState
|L11.188|
;;;646
;;;647 exit_NoData_Setup0:
;;;648 pInformation->ControlState = ControlState;
0000bc 6829 LDR r1,[r5,#0] ; pInformation
0000be 7208 STRB r0,[r1,#8]
;;;649 return;
;;;650 }
0000c0 bd70 POP {r4-r6,pc}
;;;651
ENDP
0000c2 0000 DCW 0x0000
|L11.196|
0000c4 00000000 DCD pInformation
|L11.200|
0000c8 00000000 DCD pProperty
|L11.204|
0000cc 40005c50 DCD 0x40005c50
|L11.208|
0000d0 40006000 DCD 0x40006000
|L11.212|
0000d4 00000000 DCD SaveTState
AREA ||i.Data_Setup0||, CODE, READONLY, ALIGN=2
Data_Setup0 PROC
;;;659 void Data_Setup0(void)
;;;660 {
000000 b570 PUSH {r4-r6,lr}
;;;661 u8 *(*CopyRoutine)(u16);
;;;662 RESULT Result;
;;;663 u32 Request_No = pInformation->USBbRequest;
000002 4e54 LDR r6,|L12.340|
000004 4c54 LDR r4,|L12.344|
000006 6830 LDR r0,[r6,#0] ; pInformation
000008 2509 MOVS r5,#9
00000a 7842 LDRB r2,[r0,#1]
;;;664
;;;665 u32 Related_Endpoint, Reserved;
;;;666 u32 wOffset, Status;
;;;667
;;;668
;;;669
;;;670 CopyRoutine = NULL;
;;;671 wOffset = 0;
;;;672
;;;673 if (Request_No == GET_DESCRIPTOR)
00000c 6821 LDR r1,[r4,#0]
00000e 2a06 CMP r2,#6
000010 d10f BNE |L12.50|
;;;674 {
;;;675 if (Type_Recipient == (STANDARD_REQUEST | DEVICE_RECIPIENT))
000012 7802 LDRB r2,[r0,#0]
000014 0652 LSLS r2,r2,#25
000016 d170 BNE |L12.250|
;;;676 {
;;;677 u8 wValue1 = pInformation->USBwValue1;
000018 7880 LDRB r0,[r0,#2]
;;;678 if (wValue1 == DEVICE_DESCRIPTOR)
00001a 2801 CMP r0,#1
00001c d101 BNE |L12.34|
;;;679 {
;;;680 CopyRoutine = pProperty->GetDeviceDescriptor;
00001e 69c9 LDR r1,[r1,#0x1c]
000020 e062 B |L12.232|
|L12.34|
;;;681 }
;;;682 else if (wValue1 == CONFIG_DESCRIPTOR)
000022 2802 CMP r0,#2
000024 d101 BNE |L12.42|
;;;683 {
;;;684 CopyRoutine = pProperty->GetConfigDescriptor;
000026 6a09 LDR r1,[r1,#0x20]
000028 e05e B |L12.232|
|L12.42|
;;;685 }
;;;686 else if (wValue1 == STRING_DESCRIPTOR)
00002a 2803 CMP r0,#3
00002c d165 BNE |L12.250|
;;;687 {
;;;688 CopyRoutine = pProperty->GetStringDescriptor;
00002e 6a49 LDR r1,[r1,#0x24]
000030 e05a B |L12.232|
|L12.50|
;;;689 } /* End of GET_DESCRIPTOR */
;;;690 }
;;;691 }
;;;692
;;;693 /*GET STATUS*/
;;;694 else if ((Request_No == GET_STATUS) && (pInformation->USBwValue == 0)
000032 bb82 CBNZ r2,|L12.150|
000034 8842 LDRH r2,[r0,#2]
000036 2a00 CMP r2,#0
000038 d15f BNE |L12.250|
;;;695 && (pInformation->USBwLength == 0x0002)
00003a 88c2 LDRH r2,[r0,#6]
00003c 2a02 CMP r2,#2
00003e d15c BNE |L12.250|
;;;696 && (pInformation->USBwIndex1 == 0))
000040 7902 LDRB r2,[r0,#4]
000042 2a00 CMP r2,#0
000044 d159 BNE |L12.250|
;;;697 {
;;;698 /* GET STATUS for Device*/
;;;699 if ((Type_Recipient == (STANDARD_REQUEST | DEVICE_RECIPIENT))
000046 7802 LDRB r2,[r0,#0]
000048 0653 LSLS r3,r2,#25
00004a d103 BNE |L12.84|
;;;700 && (pInformation->USBwIndex == 0))
00004c 8883 LDRH r3,[r0,#4]
00004e b90b CBNZ r3,|L12.84|
|L12.80|
;;;701 {
;;;702 CopyRoutine = Standard_GetStatus;
000050 4942 LDR r1,|L12.348|
000052 e049 B |L12.232|
|L12.84|
;;;703 }
;;;704
;;;705 /* GET STATUS for Interface*/
;;;706 else if (Type_Recipient == (STANDARD_REQUEST | INTERFACE_RECIPIENT))
000054 f002027f AND r2,r2,#0x7f
000058 2a01 CMP r2,#1
00005a d10a BNE |L12.114|
;;;707 {
;;;708 if (((*pProperty->Class_Get_Interface_Setting)(pInformation->USBwIndex0, 0) == USB_SUCCESS)
00005c 698a LDR r2,[r1,#0x18]
00005e 7940 LDRB r0,[r0,#5]
000060 2100 MOVS r1,#0
000062 4790 BLX r2
000064 2800 CMP r0,#0
000066 d148 BNE |L12.250|
;;;709 && (pInformation->Current_Configuration != 0))
000068 6830 LDR r0,[r6,#0] ; pInformation
00006a 7a80 LDRB r0,[r0,#0xa]
00006c 2800 CMP r0,#0
00006e d1ef BNE |L12.80|
000070 e043 B |L12.250|
|L12.114|
;;;710 {
;;;711 CopyRoutine = Standard_GetStatus;
;;;712 }
;;;713 }
;;;714
;;;715 /* GET STATUS for EndPoint*/
;;;716 else if (Type_Recipient == (STANDARD_REQUEST | ENDPOINT_RECIPIENT))
000072 2a02 CMP r2,#2
000074 d141 BNE |L12.250|
;;;717 {
;;;718 Related_Endpoint = (pInformation->USBwIndex0 & 0x0f);
000076 7940 LDRB r0,[r0,#5]
;;;719 Reserved = pInformation->USBwIndex0 & 0x70;
;;;720
;;;721 if (ValBit(pInformation->USBwIndex0, 7))
000078 4939 LDR r1,|L12.352|
00007a f0000270 AND r2,r0,#0x70 ;719
00007e 0603 LSLS r3,r0,#24
000080 f000000f AND r0,r0,#0xf ;718
;;;722 {
;;;723 /*Get Status of endpoint & stall the request if the related_ENdpoint
;;;724 is Disabled*/
;;;725 Status = _GetEPTxStatus(Related_Endpoint);
000084 eb010180 ADD r1,r1,r0,LSL #2
000088 f8d11c00 LDR r1,[r1,#0xc00]
00008c d504 BPL |L12.152|
00008e f3c11101 UBFX r1,r1,#4,#2
000092 0109 LSLS r1,r1,#4
000094 e003 B |L12.158|
|L12.150|
000096 e00a B |L12.174|
|L12.152|
;;;726 }
;;;727 else
;;;728 {
;;;729 Status = _GetEPRxStatus(Related_Endpoint);
000098 f3c13101 UBFX r1,r1,#12,#2
00009c 0309 LSLS r1,r1,#12
|L12.158|
;;;730 }
;;;731
;;;732 if ((Related_Endpoint < Device_Table.Total_Endpoint) && (Reserved == 0)
00009e 4b31 LDR r3,|L12.356|
0000a0 781b LDRB r3,[r3,#0] ; Device_Table
0000a2 4283 CMP r3,r0
0000a4 d929 BLS |L12.250|
0000a6 bb42 CBNZ r2,|L12.250|
;;;733 && (Status != 0))
0000a8 2900 CMP r1,#0
0000aa d1d1 BNE |L12.80|
0000ac e025 B |L12.250|
|L12.174|
;;;734 {
;;;735 CopyRoutine = Standard_GetStatus;
;;;736 }
;;;737 }
;;;738
;;;739 }
;;;740
;;;741 /*GET CONFIGURATION*/
;;;742 else if (Request_No == GET_CONFIGURATION)
0000ae 2a08 CMP r2,#8
0000b0 d104 BNE |L12.188|
;;;743 {
;;;744 if (Type_Recipient == (STANDARD_REQUEST | DEVICE_RECIPIENT))
0000b2 7800 LDRB r0,[r0,#0]
0000b4 0640 LSLS r0,r0,#25
0000b6 d120 BNE |L12.250|
;;;745 {
;;;746 CopyRoutine = Standard_GetConfiguration;
0000b8 492b LDR r1,|L12.360|
0000ba e015 B |L12.232|
|L12.188|
;;;747 }
;;;748 }
;;;749 /*GET INTERFACE*/
;;;750 else if (Request_No == GET_INTERFACE)
0000bc 2a0a CMP r2,#0xa
0000be d11c BNE |L12.250|
;;;751 {
;;;752 if ((Type_Recipient == (STANDARD_REQUEST | INTERFACE_RECIPIENT))
0000c0 7802 LDRB r2,[r0,#0]
0000c2 f002027f AND r2,r2,#0x7f
0000c6 2a01 CMP r2,#1
0000c8 d117 BNE |L12.250|
;;;753 && (pInformation->Current_Configuration != 0) && (pInformation->USBwValue == 0)
0000ca 7a82 LDRB r2,[r0,#0xa]
0000cc b1aa CBZ r2,|L12.250|
0000ce 8842 LDRH r2,[r0,#2]
0000d0 b99a CBNZ r2,|L12.250|
;;;754 && (pInformation->USBwIndex1 == 0) && (pInformation->USBwLength == 0x0001)
0000d2 7902 LDRB r2,[r0,#4]
0000d4 b98a CBNZ r2,|L12.250|
0000d6 88c2 LDRH r2,[r0,#6]
0000d8 2a01 CMP r2,#1
0000da d10e BNE |L12.250|
;;;755 && ((*pProperty->Class_Get_Interface_Setting)(pInformation->USBwIndex0, 0) == USB_SUCCESS))
0000dc 698a LDR r2,[r1,#0x18]
0000de 7940 LDRB r0,[r0,#5]
0000e0 2100 MOVS r1,#0
0000e2 4790 BLX r2
0000e4 b948 CBNZ r0,|L12.250|
;;;756 {
;;;757 CopyRoutine = Standard_GetInterface;
0000e6 4921 LDR r1,|L12.364|
|L12.232|
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -