📄 usb_core.txt
字号:
;;;872 }
;;;873 else
;;;874 {
;;;875 /* Setup with data stage */
;;;876 Data_Setup0();
000054 f7fffffe BL Data_Setup0
|L10.88|
;;;877 }
;;;878 return Post0_Process();
000058 e8bd4070 POP {r4-r6,lr}
00005c f7ffbffe B.W Post0_Process
;;;879 }
;;;880
ENDP
|L10.96|
DCD 0x40005c50
|L10.100|
DCD 0x40006000
|L10.104|
DCD pInformation
AREA ||i.Standard_ClearFeature||, CODE, READONLY, ALIGN=2
Standard_ClearFeature PROC
;;;235 *******************************************************************************/
;;;236 RESULT Standard_ClearFeature(void)
000000 b570 PUSH {r4-r6,lr}
;;;237 {
;;;238 u32 Type_Rec = Type_Recipient;
000002 4837 LDR r0,|L11.224|
000004 6801 LDR r1,[r0,#0] ; pInformation
000006 7808 LDRB r0,[r1,#0]
000008 f010007f ANDS r0,r0,#0x7f
;;;239 u32 Status;
;;;240
;;;241
;;;242 if (Type_Rec == (STANDARD_REQUEST | DEVICE_RECIPIENT))
00000c d104 BNE |L11.24|
;;;243 {/*Device Clear Feature*/
;;;244 ClrBit(pInformation->Current_Feature, 5);
00000e 7a48 LDRB r0,[r1,#9]
000010 f00000df AND r0,r0,#0xdf
000014 7248 STRB r0,[r1,#9]
;;;245 return USB_SUCCESS;
000016 e05c B |L11.210|
|L11.24|
;;;246 }
;;;247 else if (Type_Rec == (STANDARD_REQUEST | ENDPOINT_RECIPIENT))
000018 2802 CMP r0,#2
00001a d15e BNE |L11.218|
;;;248 {/*EndPoint Clear Feature*/
;;;249 DEVICE* pDev;
;;;250 u32 Related_Endpoint;
;;;251 u32 wIndex0;
;;;252 u32 rEP;
;;;253
;;;254 if ((pInformation->USBwValue != ENDPOINT_STALL)
00001c 8848 LDRH r0,[r1,#2]
00001e 2800 CMP r0,#0
000020 d15b BNE |L11.218|
;;;255 || (pInformation->USBwIndex1 != 0))
000022 7908 LDRB r0,[r1,#4]
000024 2800 CMP r0,#0
000026 d158 BNE |L11.218|
;;;256 {
;;;257 return USB_UNSUPPORT;
;;;258 }
;;;259
;;;260 pDev = &Device_Table;
;;;261 wIndex0 = pInformation->USBwIndex0;
000028 794a LDRB r2,[r1,#5]
;;;262 rEP = wIndex0 & ~0x80;
;;;263 Related_Endpoint = ENDP0 + rEP;
;;;264
;;;265 if (ValBit(pInformation->USBwIndex0, 7))
;;;266 {
;;;267 /*Get Status of endpoint & stall the request if the related_ENdpoint
;;;268 is Disabled*/
;;;269 Status = _GetEPTxStatus(Related_Endpoint);
00002a 4c2f LDR r4,|L11.232|
00002c 0613 LSLS r3,r2,#24 ;265
00002e f0220080 BIC r0,r2,#0x80 ;262
000032 2b00 CMP r3,#0 ;265
000034 eb040380 ADD r3,r4,r0,LSL #2
000038 4d2a LDR r5,|L11.228|
00003a f8d33c00 LDR r3,[r3,#0xc00]
00003e da03 BGE |L11.72|
000040 f3c31301 UBFX r3,r3,#4,#2
000044 011b LSLS r3,r3,#4
000046 e002 B |L11.78|
|L11.72|
;;;270 }
;;;271 else
;;;272 {
;;;273 Status = _GetEPRxStatus(Related_Endpoint);
000048 f3c33301 UBFX r3,r3,#12,#2
00004c 031b LSLS r3,r3,#12
|L11.78|
;;;274 }
;;;275
;;;276 if ((rEP >= pDev->Total_Endpoint) || (Status == 0)
00004e 782e LDRB r6,[r5,#0]
000050 4286 CMP r6,r0
000052 d942 BLS |L11.218|
000054 b3f3 CBZ r3,|L11.212|
;;;277 || (pInformation->Current_Configuration == 0))
000056 7a89 LDRB r1,[r1,#0xa]
000058 b3e1 CBZ r1,|L11.212|
;;;278 {
;;;279 return USB_UNSUPPORT;
;;;280 }
;;;281
;;;282
;;;283 if (wIndex0 & 0x80)
00005a 0611 LSLS r1,r2,#24
00005c d510 BPL |L11.128|
;;;284 {
;;;285 /* IN endpoint */
;;;286 if (_GetTxStallStatus(Related_Endpoint ))
00005e eb040180 ADD r1,r4,r0,LSL #2
000062 f8d11c00 LDR r1,[r1,#0xc00]
000066 f3c11101 UBFX r1,r1,#4,#2
00006a 2901 CMP r1,#1
00006c d12d BNE |L11.202|
;;;287 {
;;;288 ClearDTOG_TX(Related_Endpoint);
00006e b2c0 UXTB r0,r0
000070 4604 MOV r4,r0
000072 f7fffffe BL ClearDTOG_TX
;;;289 SetEPTxStatus(Related_Endpoint, EP_TX_VALID);
000076 2130 MOVS r1,#0x30
000078 4620 MOV r0,r4
00007a f7fffffe BL SetEPTxStatus
00007e e024 B |L11.202|
|L11.128|
;;;290 }
;;;291 }
;;;292 else
;;;293 {
;;;294 /* OUT endpoint */
;;;295 if (_GetRxStallStatus(Related_Endpoint))
000080 eb040580 ADD r5,r4,r0,LSL #2
000084 f8d51c00 LDR r1,[r5,#0xc00]
000088 f3c13101 UBFX r1,r1,#12,#2
00008c 2901 CMP r1,#1
00008e d11c BNE |L11.202|
;;;296 {
;;;297 if (Related_Endpoint == ENDP0)
;;;298 {
;;;299 /* After clear the STALL, enable the default endpoint receiver */
;;;300 SetEPRxCount(Related_Endpoint, Device_Property.MaxPacketSize);
;;;301 _SetEPRxStatus(Related_Endpoint, EP_RX_VALID);
000090 f64b768f MOV r6,#0xbf8f
000094 b970 CBNZ r0,|L11.180|
000096 4815 LDR r0,|L11.236|
000098 f890102c LDRB r1,[r0,#0x2c] ;300 ; Device_Property
00009c 2000 MOVS r0,#0 ;300
00009e f7fffffe BL SetEPRxCount
0000a2 f8d40c00 LDR r0,[r4,#0xc00]
0000a6 b280 UXTH r0,r0
0000a8 4030 ANDS r0,r0,r6
0000aa f4805040 EOR r0,r0,#0x3000
0000ae f8c40c00 STR r0,[r4,#0xc00]
0000b2 e00a B |L11.202|
|L11.180|
;;;302 }
;;;303 else
;;;304 {
;;;305 ClearDTOG_RX(Related_Endpoint);
0000b4 b2c0 UXTB r0,r0
0000b6 f7fffffe BL ClearDTOG_RX
;;;306 _SetEPRxStatus(Related_Endpoint, EP_RX_VALID);
0000ba f8d50c00 LDR r0,[r5,#0xc00]
0000be b280 UXTH r0,r0
0000c0 4030 ANDS r0,r0,r6
0000c2 f4805040 EOR r0,r0,#0x3000
0000c6 f8c50c00 STR r0,[r5,#0xc00]
|L11.202|
;;;307 }
;;;308 }
;;;309 }
;;;310 pUser_Standard_Requests->User_ClearFeature();
0000ca 4809 LDR r0,|L11.240|
0000cc 6800 LDR r0,[r0,#0] ; pUser_Standard_Requests
0000ce 6940 LDR r0,[r0,#0x14]
0000d0 4780 BLX r0
|L11.210|
;;;311 return USB_SUCCESS;
0000d2 e000 B |L11.214|
|L11.212|
0000d4 e001 B |L11.218|
|L11.214|
0000d6 2000 MOVS r0,#0
;;;312 }
;;;313
;;;314 return USB_UNSUPPORT;
;;;315 }
0000d8 bd70 POP {r4-r6,pc}
|L11.218|
0000da 2002 MOVS r0,#2 ;314
0000dc bd70 POP {r4-r6,pc}
;;;316
ENDP
0000de 0000 DCW 0x0000
|L11.224|
DCD pInformation
|L11.228|
DCD Device_Table
|L11.232|
DCD 0x40005000
|L11.236|
DCD Device_Property
|L11.240|
DCD pUser_Standard_Requests
AREA ||i.Standard_GetConfiguration||, CODE, READONLY, ALIGN=2
Standard_GetConfiguration PROC
;;;55 *******************************************************************************/
;;;56 u8 *Standard_GetConfiguration(u16 Length)
000000 b510 PUSH {r4,lr}
;;;57 {
;;;58 if (Length == 0)
;;;59 {
;;;60 pInformation->Ctrl_Info.Usb_wLength =
000002 4c07 LDR r4,|L12.32|
000004 b920 CBNZ r0,|L12.16|
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}
|L12.16|
000010 4804 LDR r0,|L12.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
|L12.32|
DCD pInformation
|L12.36|
DCD pUser_Standard_Requests
AREA ||i.Standard_GetDescriptorData||, CODE, READONLY, ALIGN=2
Standard_GetDescriptorData PROC
;;;404 *******************************************************************************/
;;;405 u8 *Standard_GetDescriptorData(u16 Length, ONE_DESCRIPTOR *pDesc)
000000 4a06 LDR r2,|L13.28|
;;;406 {
;;;407 u32 wOffset;
;;;408
;;;409 wOffset = pInformation->Ctrl_Info.Usb_wOffset;
;;;410 if (Length == 0)
000002 2800 CMP r0,#0
000004 6812 LDR r2,[r2,#0] ;409 ; pInformation
000006 8a50 LDRH r0,[r2,#0x12] ;409
000008 d104 BNE |L13.20|
;;;411 {
;;;412 pInformation->Ctrl_Info.Usb_wLength = pDesc->Descriptor_Size - wOffset;
00000a 8889 LDRH r1,[r1,#4]
00000c 1a08 SUBS r0,r1,r0
00000e 8210 STRH r0,[r2,#0x10]
;;;413 return 0;
000010 2000 MOVS r0,#0
;;;414 }
;;;415
;;;416 return pDesc->Descriptor + wOffset;
;;;417 }
000012 4770 BX lr
|L13.20|
000014 6809 LDR r1,[r1,#0] ;416
000016 4408 ADD r0,r0,r1 ;416
000018 4770 BX lr
;;;418
ENDP
00001a 0000 DCW 0x0000
|L13.28|
DCD pInformation
AREA ||i.Standard_GetInterface||, CODE, READONLY, ALIGN=2
Standard_GetInterface PROC
;;;101 *******************************************************************************/
;;;102 u8 *Standard_GetInterface(u16 Length)
000000 b510 PUSH {r4,lr}
;;;103 {
;;;104 if (Length == 0)
;;;105 {
;;;106 pInformation->Ctrl_Info.Usb_wLength =
000002 4c07 LDR r4,|L14.32|
000004 b920 CBNZ r0,|L14.16|
000006 6821 LDR r1,[r4,#0] ; pInformati
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -