📄 usb_core.txt
字号:
000050 f002f002 AND r1,r2,#0xf ;201
000054 0613 LSLS r3,r2,#24 ;202
000056 4a0c LDR r2,|L5.136|
000058 eb02eb02 ADD r1,r2,r1,LSL #2 ;205
00005c f8d1f8d1 LDR r1,[r1,#0xc00] ;205
000060 d502 BPL |L5.104|
000062 f3c1f3c1 UBFX r1,r1,#4,#2 ;205
000066 e001 B |L5.108|
|L5.104|
000068 f3c1f3c1 UBFX r1,r1,#12,#2 ;213
|L5.108|
00006c 2901 CMP r1,#1 ;205
00006e d0e1 BEQ |L5.52|
|L5.112|
000070 4806 LDR r0,|L5.140|
000072 6800 LDR r0,[r0,#0] ;224 ; pUser_Standard_Requests
000074 6900 LDR r0,[r0,#0x10] ;224
000076 4780 BLX r0 ;224
000078 e7e5 B |L5.70|
|L5.122|
00007a 2000 MOVS r0,#0 ;222
00007c bd10 POP {r4,pc}
;;;227
ENDP
00007e 0000 DCW 0x0000
|L5.128|
000080 00000000 DCD pInformation
|L5.132|
000084 00000002 DCD ||.data||+0x2
|L5.136|
000088 40005000 DCD 0x40005000
|L5.140|
00008c 00000000 DCD pUser_Standard_Requests
AREA ||i.Standard_ClearFeature||, CODE, READONLY, ALIGN=2
Standard_ClearFeature PROC
;;;236 RESULT Standard_ClearFeature(void)
;;;237 {
000000 b570 PUSH {r4-r6,lr}
;;;238 u32 Type_Rec = Type_Recipient;
000002 4837 LDR r0,|L6.224|
000004 6801 LDR r1,[r0,#0] ; pInformation
000006 7808 LDRB r0,[r1,#0]
000008 f010f010 ANDS r0,r0,#0x7f
;;;239 u32 Status;
;;;240
;;;241
;;;242 if (Type_Rec == (STANDARD_REQUEST | DEVICE_RECIPIENT))
00000c d104 BNE |L6.24|
;;;243 {/*Device Clear Feature*/
;;;244 ClrBit(pInformation->Current_Feature, 5);
00000e 7a48 LDRB r0,[r1,#9]
000010 f000f000 AND r0,r0,#0xdf
000014 7248 STRB r0,[r1,#9]
;;;245 return USB_SUCCESS;
000016 e05c B |L6.210|
|L6.24|
;;;246 }
;;;247 else if (Type_Rec == (STANDARD_REQUEST | ENDPOINT_RECIPIENT))
000018 2802 CMP r0,#2
00001a d15e BNE |L6.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 |L6.218|
;;;255 || (pInformation->USBwIndex1 != 0))
000022 7908 LDRB r0,[r1,#4]
000024 2800 CMP r0,#0
000026 d158 BNE |L6.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))
00002a 4d2f LDR r5,|L6.232|
00002c 0613 LSLS r3,r2,#24
00002e f022f022 BIC r0,r2,#0x80 ;262
000032 2b00 CMP r3,#0
;;;266 {
;;;267 /*Get Status of endpoint & stall the request if the related_ENdpoint
;;;268 is Disabled*/
;;;269 Status = _GetEPTxStatus(Related_Endpoint);
000034 eb05eb05 ADD r3,r5,r0,LSL #2
000038 4c2a LDR r4,|L6.228|
00003a f8d3f8d3 LDR r3,[r3,#0xc00]
00003e da03 BGE |L6.72|
000040 f3c3f3c3 UBFX r3,r3,#4,#2
000044 011b LSLS r3,r3,#4
000046 e002 B |L6.78|
|L6.72|
;;;270 }
;;;271 else
;;;272 {
;;;273 Status = _GetEPRxStatus(Related_Endpoint);
000048 f3c3f3c3 UBFX r3,r3,#12,#2
00004c 031b LSLS r3,r3,#12
|L6.78|
;;;274 }
;;;275
;;;276 if ((rEP >= pDev->Total_Endpoint) || (Status == 0)
00004e 7826 LDRB r6,[r4,#0]
000050 4286 CMP r6,r0
000052 d942 BLS |L6.218|
000054 b3f3 CBZ r3,|L6.212|
;;;277 || (pInformation->Current_Configuration == 0))
000056 7a89 LDRB r1,[r1,#0xa]
000058 b3e1 CBZ r1,|L6.212|
;;;278 {
;;;279 return USB_UNSUPPORT;
;;;280 }
;;;281
;;;282
;;;283 if (wIndex0 & 0x80)
00005a 0611 LSLS r1,r2,#24
00005c d510 BPL |L6.128|
;;;284 {
;;;285 /* IN endpoint */
;;;286 if (_GetTxStallStatus(Related_Endpoint ))
00005e eb05eb05 ADD r1,r5,r0,LSL #2
000062 f8d1f8d1 LDR r1,[r1,#0xc00]
000066 f3c1f3c1 UBFX r1,r1,#4,#2
00006a 2901 CMP r1,#1
00006c d12d BNE |L6.202|
;;;287 {
;;;288 ClearDTOG_TX(Related_Endpoint);
00006e b2c0 UXTB r0,r0
000070 4604 MOV r4,r0
000072 f7fff7ff BL ClearDTOG_TX
;;;289 SetEPTxStatus(Related_Endpoint, EP_TX_VALID);
000076 2130 MOVS r1,#0x30
000078 4620 MOV r0,r4
00007a f7fff7ff BL SetEPTxStatus
00007e e024 B |L6.202|
|L6.128|
;;;290 }
;;;291 }
;;;292 else
;;;293 {
;;;294 /* OUT endpoint */
;;;295 if (_GetRxStallStatus(Related_Endpoint))
000080 eb05eb05 ADD r4,r5,r0,LSL #2
000084 f8d4f8d4 LDR r1,[r4,#0xc00]
000088 f3c1f3c1 UBFX r1,r1,#12,#2
00008c 2901 CMP r1,#1
00008e d11c BNE |L6.202|
000090 f64bf64b MOV r6,#0xbf8f
;;;296 {
;;;297 if (Related_Endpoint == ENDP0)
000094 b970 CBNZ r0,|L6.180|
;;;298 {
;;;299 /* After clear the STALL, enable the default endpoint receiver */
;;;300 SetEPRxCount(Related_Endpoint, Device_Property.MaxPacketSize);
000096 4815 LDR r0,|L6.236|
000098 f890f890 LDRB r1,[r0,#0x2c] ; Device_Property
00009c 2000 MOVS r0,#0
00009e f7fff7ff BL SetEPRxCount
;;;301 _SetEPRxStatus(Related_Endpoint, EP_RX_VALID);
0000a2 f8d5f8d5 LDR r0,[r5,#0xc00]
0000a6 b280 UXTH r0,r0
0000a8 4030 ANDS r0,r0,r6
0000aa f480f480 EOR r0,r0,#0x3000
0000ae f8c5f8c5 STR r0,[r5,#0xc00]
0000b2 e00a B |L6.202|
|L6.180|
;;;302 }
;;;303 else
;;;304 {
;;;305 ClearDTOG_RX(Related_Endpoint);
0000b4 b2c0 UXTB r0,r0
0000b6 f7fff7ff BL ClearDTOG_RX
;;;306 _SetEPRxStatus(Related_Endpoint, EP_RX_VALID);
0000ba f8d4f8d4 LDR r0,[r4,#0xc00]
0000be b280 UXTH r0,r0
0000c0 4030 ANDS r0,r0,r6
0000c2 f480f480 EOR r0,r0,#0x3000
0000c6 f8c4f8c4 STR r0,[r4,#0xc00]
|L6.202|
;;;307 }
;;;308 }
;;;309 }
;;;310 pUser_Standard_Requests->User_ClearFeature();
0000ca 4809 LDR r0,|L6.240|
0000cc 6800 LDR r0,[r0,#0] ; pUser_Standard_Requests
0000ce 6940 LDR r0,[r0,#0x14]
0000d0 4780 BLX r0
|L6.210|
;;;311 return USB_SUCCESS;
0000d2 e000 B |L6.214|
|L6.212|
0000d4 e001 B |L6.218|
|L6.214|
0000d6 2000 MOVS r0,#0
;;;312 }
;;;313
;;;314 return USB_UNSUPPORT;
;;;315 }
0000d8 bd70 POP {r4-r6,pc}
|L6.218|
0000da 2002 MOVS r0,#2 ;314
0000dc bd70 POP {r4-r6,pc}
;;;316
ENDP
0000de 0000 DCW 0x0000
|L6.224|
0000e0 00000000 DCD pInformation
|L6.228|
0000e4 00000000 DCD Device_Table
|L6.232|
0000e8 40005000 DCD 0x40005000
|L6.236|
0000ec 00000000 DCD Device_Property
|L6.240|
0000f0 00000000 DCD pUser_Standard_Requests
AREA ||i.Standard_SetEndPointFeature||, CODE, READONLY, ALIGN=2
Standard_SetEndPointFeature PROC
;;;325 RESULT Standard_SetEndPointFeature(void)
;;;326 {
000000 b570 PUSH {r4-r6,lr}
;;;327 u32 wIndex0;
;;;328 u32 Related_Endpoint;
;;;329 u32 rEP;
;;;330 u32 Status;
;;;331
;;;332 wIndex0 = pInformation->USBwIndex0;
000002 481c LDR r0,|L7.116|
000004 6802 LDR r2,[r0,#0] ; pInformation
;;;333 rEP = wIndex0 & ~0x80;
;;;334 Related_Endpoint = ENDP0 + rEP;
;;;335
;;;336 if (ValBit(pInformation->USBwIndex0, 7))
000006 481c LDR r0,|L7.120|
000008 7951 LDRB r1,[r2,#5] ;332
00000a f021f021 BIC r5,r1,#0x80
00000e 060b LSLS r3,r1,#24
000010 eb00eb00 ADD r0,r0,r5,LSL #2
;;;337 {
;;;338 /* get Status of endpoint & stall the request if the related_ENdpoint
;;;339 is Disabled*/
;;;340 Status = _GetEPTxStatus(Related_Endpoint);
000014 f8d0f8d0 LDR r3,[r0,#0xc00]
000018 f021f021 BIC r4,r1,#0x80 ;333
00001c d503 BPL |L7.38|
00001e f3c3f3c3 UBFX r3,r3,#4,#2
000022 011b LSLS r3,r3,#4
000024 e002 B |L7.44|
|L7.38|
;;;341 }
;;;342 else
;;;343 {
;;;344 Status = _GetEPRxStatus(Related_Endpoint);
000026 f3c3f3c3 UBFX r3,r3,#12,#2
00002a 031b LSLS r3,r3,#12
|L7.44|
;;;345 }
;;;346
;;;347 if (Related_Endpoint >= Device_Table.Total_Endpoint
00002c 4d13 LDR r5,|L7.124|
00002e 782d LDRB r5,[r5,#0] ; Device_Table
000030 42a5 CMP r5,r4
000032 d904 BLS |L7.62|
;;;348 || pInformation->USBwValue != 0 || Status == 0
000034 8854 LDRH r4,[r2,#2]
000036 b914 CBNZ r4,|L7.62|
000038 b10b CBZ r3,|L7.62|
;;;349 || pInformation->Current_Configuration == 0)
00003a 7a92 LDRB r2,[r2,#0xa]
00003c b90a CBNZ r2,|L7.66|
|L7.62|
;;;350 {
;;;351 return USB_UNSUPPORT;
00003e 2002 MOVS r0,#2
;;;352 }
;;;353 else
;;;354 {
;;;355 if (wIndex0 & 0x80)
;;;356 {
;;;357 /* IN endpoint */
;;;358 _SetEPTxStatus(Related_Endpoint, EP_TX_STALL);
;;;359 }
;;;360
;;;361 else
;;;362 {
;;;363 /* OUT endpoint */
;;;364 _SetEPRxStatus(Related_Endpoint, EP_RX_STALL);
;;;365 }
;;;366 }
;;;367 pUser_Standard_Requests->User_SetEndPointFeature();
;;;368 return USB_SUCCESS;
;;;369 }
000040 bd70 POP {r4-r6,pc}
|L7.66|
000042 0609 LSLS r1,r1,#24 ;355
000044 f8d0f8d0 LDR r1,[r0,#0xc00] ;358
000048 d506 BPL |L7.88|
00004a f648f648 MOV r2,#0x8fbf ;358
00004e b289 UXTH r1,r1 ;358
000050 4011 ANDS r1,r1,r2 ;358
000052 f081f081 EOR r1,r1,#0x10 ;358
000056 e005 B |L7.100|
|L7.88|
000058 f64bf64b MOV r2,#0xbf8f ;364
00005c b289 UXTH r1,r1 ;364
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -