📄 usbddriver.lst
字号:
286
287 // Check if descriptor exists
288 if (index > numStrings) {
\ 00000238 0000DDE5 LDRB R0,[SP, #+0]
\ 0000023C FF5015E2 ANDS R5,R5,#0xFF ;; Zero extend
\ 00000240 050050E1 CMP R0,R5
\ 00000244 0200002A BCS ??GetDescriptor_17
289
290 USBD_Stall(0);
\ 00000248 0000A0E3 MOV R0,#+0
\ 0000024C ........ BL USBD_Stall
\ 00000250 1C0000EA B ??GetDescriptor_7
291 }
292 else {
293 pString = pStrings[index];
\ ??GetDescriptor_17:
\ 00000254 0500B0E1 MOVS R0,R5
\ 00000258 FF0010E2 ANDS R0,R0,#0xFF ;; Zero extend
\ 0000025C 0410A0E3 MOV R1,#+4
\ 00000260 04209DE5 LDR R2,[SP, #+4]
\ 00000264 912020E0 MLA R0,R1,R0,R2
\ 00000268 000090E5 LDR R0,[R0, #+0]
\ 0000026C 00B0B0E1 MOVS R11,R0
294
295 // Adjust length and send descriptor
296 if (length > USBGenericDescriptor_GetLength(pString)) {
\ 00000270 0B00B0E1 MOVS R0,R11
\ 00000274 ........ BL USBGenericDescriptor_GetLength
\ 00000278 060050E1 CMP R0,R6
\ 0000027C 0200002A BCS ??GetDescriptor_18
297 length = USBGenericDescriptor_GetLength(pString);
\ 00000280 0B00B0E1 MOVS R0,R11
\ 00000284 ........ BL USBGenericDescriptor_GetLength
\ 00000288 0060B0E1 MOVS R6,R0
298 }
299
300 USBD_Write(0, pString, length, 0, 0);
\ ??GetDescriptor_18:
\ 0000028C 08D04DE2 SUB SP,SP,#+8
\ 00000290 0000A0E3 MOV R0,#+0
\ 00000294 00008DE5 STR R0,[SP, #+0]
\ 00000298 0030A0E3 MOV R3,#+0
\ 0000029C 0620B0E1 MOVS R2,R6
\ 000002A0 0B10B0E1 MOVS R1,R11
\ 000002A4 0000A0E3 MOV R0,#+0
\ 000002A8 ........ BL USBD_Write
\ 000002AC 08D08DE2 ADD SP,SP,#+8 ;; stack cleaning
\ 000002B0 040000EA B ??GetDescriptor_7
301 }
302 break;
303
304 default:
305 trace_LOG(trace_WARNING,
306 "USBDDriver_GetDescriptor: Unknown descriptor type (%d)\n\r",
307 type);
\ ??GetDescriptor_4:
\ 000002B4 0810DDE5 LDRB R1,[SP, #+8]
\ 000002B8 2C009FE5 LDR R0,??GetDescriptor_2+0x1C ;; `?<Constant "USBDDriver_GetDescrip...">`
\ 000002BC ........ BL printf
308 USBD_Stall(0);
\ 000002C0 0000A0E3 MOV R0,#+0
\ 000002C4 ........ BL USBD_Stall
309 }
310 }
\ ??GetDescriptor_7:
\ 000002C8 FE4FBDE8 POP {R1-R11,LR}
\ 000002CC 1EFF2FE1 BX LR ;; return
\ ??GetDescriptor_2:
\ 000002D0 48532000 DC8 "HS "
\ 000002D4 46532000 DC8 "FS "
\ 000002D8 ........ DC32 `?<Constant "Dev ">`
\ 000002DC ........ DC32 `?<Constant "Cfg ">`
\ 000002E0 ........ DC32 `?<Constant "Qua ">`
\ 000002E4 ........ DC32 `?<Constant "OSC ">`
\ 000002E8 ........ DC32 `?<Constant "Str%d ">`
\ 000002EC ........ DC32 `?<Constant "USBDDriver_GetDescrip...">`
311
312 //------------------------------------------------------------------------------
313 /// Sets the active setting of the given interface if the configuration supports
314 /// it; otherwise, the control pipe is STALLed. If the setting of an interface
315 /// changes.
316 /// \parma pDriver Pointer to a USBDDriver instance.
317 /// \parma infnum Interface number.
318 /// \parma setting New active setting for the interface.
319 //------------------------------------------------------------------------------
\ In section .text, align 4, keep-with-next
320 static void SetInterface(
321 USBDDriver *pDriver,
322 unsigned char infnum,
323 unsigned char setting)
324 {
\ SetInterface:
\ 00000000 70402DE9 PUSH {R4-R6,LR}
\ 00000004 0040B0E1 MOVS R4,R0
\ 00000008 0150B0E1 MOVS R5,R1
\ 0000000C 0260B0E1 MOVS R6,R2
325 // Make sure alternate settings are supported
326 if (!pDriver->pInterfaces) {
\ 00000010 040094E5 LDR R0,[R4, #+4]
\ 00000014 000050E3 CMP R0,#+0
\ 00000018 0200001A BNE ??SetInterface_0
327
328 USBD_Stall(0);
\ 0000001C 0000A0E3 MOV R0,#+0
\ 00000020 ........ BL USBD_Stall
\ 00000024 180000EA B ??SetInterface_1
329 }
330 else {
331
332 // Change the current setting of the interface and trigger the callback
333 // if necessary
334 if (pDriver->pInterfaces[infnum] != setting) {
\ ??SetInterface_0:
\ 00000028 0500B0E1 MOVS R0,R5
\ 0000002C FF0010E2 ANDS R0,R0,#0xFF ;; Zero extend
\ 00000030 041094E5 LDR R1,[R4, #+4]
\ 00000034 0100D0E7 LDRB R0,[R0, +R1]
\ 00000038 FF6016E2 ANDS R6,R6,#0xFF ;; Zero extend
\ 0000003C 060050E1 CMP R0,R6
\ 00000040 0800000A BEQ ??SetInterface_2
335
336 pDriver->pInterfaces[infnum] = setting;
\ 00000044 0500B0E1 MOVS R0,R5
\ 00000048 FF0010E2 ANDS R0,R0,#0xFF ;; Zero extend
\ 0000004C 041094E5 LDR R1,[R4, #+4]
\ 00000050 0160C0E7 STRB R6,[R0, +R1]
337 USBDDriverCallbacks_InterfaceSettingChanged(infnum, setting);
\ 00000054 0610B0E1 MOVS R1,R6
\ 00000058 FF1011E2 ANDS R1,R1,#0xFF ;; Zero extend
\ 0000005C 0500B0E1 MOVS R0,R5
\ 00000060 FF0010E2 ANDS R0,R0,#0xFF ;; Zero extend
\ 00000064 ........ BL USBDDriverCallbacks_InterfaceSettingChanged
338 }
339
340 // Acknowledge the request
341 USBD_Write(0, 0, 0, 0, 0);
\ ??SetInterface_2:
\ 00000068 08D04DE2 SUB SP,SP,#+8
\ 0000006C 0000A0E3 MOV R0,#+0
\ 00000070 00008DE5 STR R0,[SP, #+0]
\ 00000074 0030A0E3 MOV R3,#+0
\ 00000078 0020A0E3 MOV R2,#+0
\ 0000007C 0010A0E3 MOV R1,#+0
\ 00000080 0000A0E3 MOV R0,#+0
\ 00000084 ........ BL USBD_Write
\ 00000088 08D08DE2 ADD SP,SP,#+8 ;; stack cleaning
342 }
343 }
\ ??SetInterface_1:
\ 0000008C 7040BDE8 POP {R4-R6,LR}
\ 00000090 1EFF2FE1 BX LR ;; return
344
345 //------------------------------------------------------------------------------
346 /// Sends the currently active setting of the given interface to the USB
347 /// host. If alternate settings are not supported, this function STALLs the
348 /// control pipe.
349 /// \param pDriver Pointer to a USBDDriver instance.
350 /// \param infnum Interface number.
351 //------------------------------------------------------------------------------
\ In section .text, align 4, keep-with-next
352 static void GetInterface(
353 const USBDDriver *pDriver,
354 unsigned char infnum)
355 {
\ GetInterface:
\ 00000000 31402DE9 PUSH {R0,R4,R5,LR}
\ 00000004 0040B0E1 MOVS R4,R0
\ 00000008 0150B0E1 MOVS R5,R1
356 // Make sure alternate settings are supported, or STALL the control pipe
357 if (!pDriver->pInterfaces) {
\ 0000000C 040094E5 LDR R0,[R4, #+4]
\ 00000010 000050E3 CMP R0,#+0
\ 00000014 0200001A BNE ??GetInterface_0
358
359 USBD_Stall(0);
\ 00000018 0000A0E3 MOV R0,#+0
\ 0000001C ........ BL USBD_Stall
\ 00000020 0B0000EA B ??GetInterface_1
360 }
361 else {
362
363 // Sends the current interface setting to the host
364 USBD_Write(0, &(pDriver->pInterfaces[infnum]), 1, 0, 0);
\ ??GetInterface_0:
\ 00000024 08D04DE2 SUB SP,SP,#+8
\ 00000028 0000A0E3 MOV R0,#+0
\ 0000002C 00008DE5 STR R0,[SP, #+0]
\ 00000030 0030A0E3 MOV R3,#+0
\ 00000034 0120A0E3 MOV R2,#+1
\ 00000038 0500B0E1 MOVS R0,R5
\ 0000003C FF0010E2 ANDS R0,R0,#0xFF ;; Zero extend
\ 00000040 041094E5 LDR R1,[R4, #+4]
\ 00000044 011090E0 ADDS R1,R0,R1
\ 00000048 0000A0E3 MOV R0,#+0
\ 0000004C ........ BL USBD_Write
\ 00000050 08D08DE2 ADD SP,SP,#+8 ;; stack cleaning
365 }
366 }
\ ??GetInterface_1:
\ 00000054 3840BDE8 POP {R3-R5,LR}
\ 00000058 1EFF2FE1 BX LR ;; return
367
368 #ifdef BOARD_USB_UDPHS
369 //------------------------------------------------------------------------------
370 // Performs the selected test on the USB device (high-speed only).
371 // \param test Test selector value.
372 //------------------------------------------------------------------------------
373 static void USBDDriver_Test(unsigned char test)
374 {
375 trace_LOG(trace_DEBUG, "UDPHS_Test\n\r");
376
377 // the lower byte of wIndex must be zero
378 // the most significant byte of wIndex is used to specify the specific test mode
379 switch (test) {
380 case USBFeatureRequest_TESTPACKET:
381 //Test mode Test_Packet:
382 //Upon command, a port must repetitively transmit the following test packet until
383 //the exit action is taken. This enables the testing of rise and fall times, eye
384 //patterns, jitter, and any other dynamic waveform specifications.
385 //The test packet is made up by concatenating the following strings.
386 //(Note: For J/K NRZI data, and for NRZ data, the bit on the left is the first one
387 //transmitted. 揝?indicates that a bit stuff occurs, which inserts an 揺xtra?NRZI data bit.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -