77 #elif (USB_USE_PDL == 1)
80 #elif defined(FM4_USB0)
82 #elif defined(FM3_USB0)
85 #error Not supported configuration
143 #if !defined(USB_USE_PDL)
144 #define USB_USE_PDL 0
147 #if !defined(USB_USE_L3)
151 #if !defined(USB_USES_DMA)
152 #define USB_USES_DMA OFF
155 #if !defined(USB_USE_STANDALONE)
156 #if (USB_USE_PDL == OFF) && (USB_USE_L3 == OFF)
157 #define USB_USE_STANDALONE ON
159 #define USB_USE_STANDALONE OFF
164 #if (USB_USE_STANDALONE == ON)
165 #if defined(FM4_USB0_BASE)
166 #define USB0 (*((volatile stc_usbn_t *) FM4_USB0_BASE))
168 #if defined(FM4_USB0_BASE)
169 #define USB1 (*((volatile stc_usbn_t *) FM4_USB1_BASE))
171 #if defined(FM3_USB_BASE)
172 #define USB0 (*((volatile stc_usbn_t *) FM3_USB_BASE))
174 #if defined(FM3_USB0_BASE)
175 #define USB0 (*((volatile stc_usbn_t *) FM3_USB0_BASE))
177 #if defined(FM3_USB0_BASE)
178 #define USB1 (*((volatile stc_usbn_t *) FM3_USB1_BASE))
181 #ifndef USB0_DEVICE_IRQ_ENABLED
182 #define USB0_DEVICE_IRQ_ENABLED 1
184 #ifndef USB0_HOST_IRQ_ENABLED
185 #define USB0_HOST_IRQ_ENABLED 1
187 #ifndef USB1_DEVICE_IRQ_ENABLED
188 #define USB1_DEVICE_IRQ_ENABLED 1
190 #ifndef USB1_HOST_IRQ_ENABLED
191 #define USB1_HOST_IRQ_ENABLED 1
194 #define FM_PERIPHERAL_ENABLE_USB0_HOST USB0_HOST_ENABLED
195 #define FM_PERIPHERAL_ENABLE_USB1_HOST USB1_HOST_ENABLED
196 #define FM_PERIPHERAL_ENABLE_USB0_DEVICE USB0_DEVICE_ENABLED
197 #define FM_PERIPHERAL_ENABLE_USB1_DEVICE USB1_DEVICE_ENABLED
198 #elif (USB_USE_L3 == ON)
199 #if defined(FM4_USB0)
200 #error L3 library is not available for FM4!
202 #define USB0 (*((volatile stc_usbn_t *) L3_USB0_BASE))
203 #define USB1 (*((volatile stc_usbn_t *) L3_USB1_BASE))
204 #if USB_USES_DMA != OFF
206 #define USB_USES_DMA OFF
208 #if defined(L3_IRQ_LEVEL_USB0)
209 #undef IRQ_LEVEL_USB0
210 #define IRQ_LEVEL_USB0 L3_IRQ_LEVEL_USB0
212 #if defined(L3_IRQ_LEVEL_USB1)
213 #undef IRQ_LEVEL_USB1
214 #define IRQ_LEVEL_USB1 L3_IRQ_LEVEL_USB1
216 #ifndef USB0_DEVICE_IRQ_ENABLED
217 #define USB0_DEVICE_IRQ_ENABLED 1
219 #ifndef USB0_HOST_IRQ_ENABLED
220 #define USB0_HOST_IRQ_ENABLED 1
222 #ifndef USB1_DEVICE_IRQ_ENABLED
223 #define USB1_DEVICE_IRQ_ENABLED 1
225 #ifndef USB1_HOST_IRQ_ENABLED
226 #define USB1_HOST_IRQ_ENABLED 1
228 #define FM_PERIPHERAL_ENABLE_USB0_HOST L3_PERIPHERAL_ENABLE_USB0_HOST
229 #define FM_PERIPHERAL_ENABLE_USB0_DEVICE L3_PERIPHERAL_ENABLE_USB0_DEVICE
230 #define FM_PERIPHERAL_ENABLE_USB1_HOST L3_PERIPHERAL_ENABLE_USB1_HOST
231 #define FM_PERIPHERAL_ENABLE_USB1_DEVICE L3_PERIPHERAL_ENABLE_USB1_DEVICE
232 #elif (USB_USE_PDL == ON)
233 #if defined(FM3_USB0) || defined(FM3_USB)
234 #error PDL library is not available for FM3!
236 #if defined(FM4_USB0_BASE)
237 #define USB0 (*((volatile stc_usbn_t *) FM4_USB0_BASE))
239 #if defined(FM4_USB0_BASE)
240 #define USB1 (*((volatile stc_usbn_t *) FM4_USB1_BASE))
242 #if USB_USES_DMA != OFF
244 #define USB_USES_DMA OFF
247 #if defined(PDL_IRQ_LEVEL_USB0)
248 #undef IRQ_LEVEL_USB0
249 #define IRQ_LEVEL_USB0 PDL_IRQ_LEVEL_USB0
251 #if defined(PDL_IRQ_LEVEL_USB1)
252 #undef IRQ_LEVEL_USB1
253 #define IRQ_LEVEL_USB1 PDL_IRQ_LEVEL_USB1
255 #if defined(USB0_DEVICE_IRQ_ENABLED)
256 #undef USB0_DEVICE_IRQ_ENABLED
258 #if defined(USB0_HOST_IRQ_ENABLED)
259 #undef USB0_HOST_IRQ_ENABLED
261 #if defined(USB1_DEVICE_IRQ_ENABLED)
262 #undef USB1_DEVICE_IRQ_ENABLED
264 #if defined(USB1_HOST_IRQ_ENABLED)
265 #undef USB1_HOST_IRQ_ENABLED
268 #define USB0_DEVICE_IRQ_ENABLED PDL_INTERRUPT_ENABLE_USB0_DEVICE
269 #define USB0_HOST_IRQ_ENABLED PDL_INTERRUPT_ENABLE_USB0_HOST
270 #define USB1_DEVICE_IRQ_ENABLED PDL_INTERRUPT_ENABLE_USB1_DEVICE
271 #define USB1_HOST_IRQ_ENABLED PDL_INTERRUPT_ENABLE_USB1_HOST
273 #define FM_PERIPHERAL_ENABLE_USB0_HOST PDL_PERIPHERAL_ENABLE_USB0_HOST
274 #define FM_PERIPHERAL_ENABLE_USB0_DEVICE PDL_PERIPHERAL_ENABLE_USB0_DEVICE
275 #define FM_PERIPHERAL_ENABLE_USB1_HOST PDL_PERIPHERAL_ENABLE_USB1_HOST
276 #define FM_PERIPHERAL_ENABLE_USB1_DEVICE PDL_PERIPHERAL_ENABLE_USB1_DEVICE
278 #ifdef USBDEVICECDCCOM_ENABLED
279 #undef USBDEVICECDCCOM_ENABLED
281 #ifdef USBDEVICEHIDJOYSTICK_ENABLED
282 #undef USBDEVICEHIDJOYSTICK_ENABLED
284 #ifdef USBDEVICEHIDKEYBOARD_ENABLED
285 #undef USBDEVICEHIDKEYBOARD_ENABLED
287 #ifdef USBDEVICEHIDMOUSE_ENABLED
288 #undef USBDEVICEHIDMOUSE_ENABLED
290 #ifdef USBDEVICELIBUSB_ENABLED
291 #undef USBDEVICELIBUSB_ENABLED
293 #ifdef USBDEVICEPRINTER_ENABLED
294 #undef USBDEVICEPRINTER_ENABLED
298 #ifdef USBHOSTHIDCOM_ENABLED
299 #undef USBHOSTHIDCOM_ENABLED
301 #ifdef USBHOSTHIDKEYBOARD_ENABLED
302 #undef USBHOSTHIDKEYBOARD_ENABLED
304 #ifdef USBHOSTHIDMOUSE_ENABLED
305 #undef USBHOSTHIDMOUSE_ENABLED
307 #ifdef USBHOSTMASSSTORAGE_ENABLED
308 #undef USBHOSTMASSSTORAGE_ENABLED
311 #define USBDEVICECDCCOM_ENABLED PDL_USBDEVICECDCCOM_ENABLED
312 #define USBDEVICEHIDCOM_ENABLED PDL_USBDEVICEHIDCOM_ENABLED
313 #define USBDEVICEHIDJOYSTICK_ENABLED PDL_USBDEVICEHIDJOYSTICK_ENABLED
314 #define USBDEVICEHIDKEYBOARD_ENABLED PDL_USBDEVICEHIDKEYBOARD_ENABLED
315 #define USBDEVICEHIDMOUSE_ENABLED PDL_USBDEVICEHIDMOUSE_ENABLED
316 #define USBDEVICELIBUSB_ENABLED PDL_USBDEVICELIBUSB_ENABLED
317 #define USBDEVICEPRINTER_ENABLED PDL_USBDEVICEPRINTER_ENABLED
319 #define USBHOSTHIDCOM_ENABLED PDL_USBHOSTHIDCOM_ENABLED
320 #define USBHOSTHIDKEYBOARD_ENABLED PDL_USBHOSTHIDKEYBOARD_ENABLED
321 #define USBHOSTHIDMOUSE_ENABLED PDL_USBHOSTHIDMOUSE_ENABLED
322 #define USBHOSTMASSSTORAGE_ENABLED PDL_USBHOSTMASSSTORAGE_ENABLED
325 #error USB low level driver must be used standalone, with L3 or with PDL
328 #if !defined(FM_PERIPHERAL_ENABLE_USB0_DEVICE)
329 #define FM_PERIPHERAL_ENABLE_USB0_DEVICE OFF
332 #if !defined(FM_PERIPHERAL_ENABLE_USB1_DEVICE)
333 #define FM_PERIPHERAL_ENABLE_USB1_DEVICE OFF
336 #if !defined(FM_PERIPHERAL_ENABLE_USB0_HOST)
337 #define FM_PERIPHERAL_ENABLE_USB0_HOST OFF
340 #if !defined(FM_PERIPHERAL_ENABLE_USB1_HOST)
341 #define FM_PERIPHERAL_ENABLE_USB1_HOST OFF
344 #if (FM_PERIPHERAL_ENABLE_USB0_DEVICE == ON) || (FM_PERIPHERAL_ENABLE_USB0_HOST == ON)
345 #define FM_PERIPHERAL_ENABLE_USB0 ON
347 #define FM_PERIPHERAL_ENABLE_USB0 OFF
350 #if (FM_PERIPHERAL_ENABLE_USB1_DEVICE == ON) || (FM_PERIPHERAL_ENABLE_USB1_HOST == ON)
351 #define FM_PERIPHERAL_ENABLE_USB1 ON
353 #define FM_PERIPHERAL_ENABLE_USB1 OFF
356 #if (FM_PERIPHERAL_ENABLE_USB0_HOST == ON) || (FM_PERIPHERAL_ENABLE_USB1_HOST == ON)
357 #define FM_PERIPHERAL_USB_HOST_ENABLED ON
359 #define FM_PERIPHERAL_USB_HOST_ENABLED OFF
360 #define USB_DISBALE_HOST_FUNCTIONALITY OFF
363 #if (FM_PERIPHERAL_ENABLE_USB0_DEVICE == ON) || (FM_PERIPHERAL_ENABLE_USB1_DEVICE == ON)
364 #define FM_PERIPHERAL_USB_DEVICE_ENABLED ON
366 #define FM_PERIPHERAL_USB_DEVICE_ENABLED OFF
367 #define USB_DISBALE_DEVICE_FUNCTIONALITY OFF
370 #define USB_ENABLED ((FM_PERIPHERAL_ENABLE_USB0 == ON) || (FM_PERIPHERAL_ENABLE_USB1 == ON))
371 #define USB_INTERFACES_COUNT ((FM_PERIPHERAL_ENABLE_USB0) + (FM_PERIPHERAL_ENABLE_USB1))
372 #define USB_INSTANCE_COUNT ((FM_PERIPHERAL_ENABLE_USB0) + (FM_PERIPHERAL_ENABLE_USB1))
373 #define USB_DEVICE_INTERFACES_COUNT ((FM_PERIPHERAL_ENABLE_USB0_DEVICE) + (FM_PERIPHERAL_ENABLE_USB1_DEVICE))
374 #define USB_HOST_INTERFACES_COUNT ((FM_PERIPHERAL_ENABLE_USB0_HOST) + (FM_PERIPHERAL_ENABLE_USB1_HOST))
379 #define USBDBG(x) DBGSPACES(u8DebugDepth); puts(x)
380 #define USBDBGVAL8(x,y) DBGSPACES(u8DebugDepth); puts(x); puthex((uint32_t)y,2); puts("\n")
381 #define USBDBGVAL16(x,y) DBGSPACES(u8DebugDepth); puts(x); puthex((uint32_t)y,4); puts("\n")
382 #define USBDBGVAL32(x,y) DBGSPACES(u8DebugDepth); puts(x); puthex((uint32_t)y,8); puts("\n")
383 #define DBGPROCENTER(x) DBGSPACES(u8DebugDepth); u8DebugDepth++; puts(">"); puts(x);puts("\n");
384 #define DBGPROCRETURN(x) if (u8DebugDepth > 0) u8DebugDepth--;DBGSPACES(u8DebugDepth);puts("<"); puts(x);puts("\n");
385 #define DBGSPACES(x) for(u8Dbgi = 0;u8Dbgi < x*2;u8Dbgi++) putch(' ')
386 volatile extern uint8_t u8DebugDepth;
387 volatile extern uint8_t u8Dbgi;
390 #define USBDBGVAL8(x,y)
391 #define USBDBGVAL16(x,y)
392 #define USBDBGVAL32(x,y)
393 #define DBGPROCENTER(x)
394 #define DBGPROCRETURN(x)
398 #define SETACTIVEFLAG(x) while((x) == FALSE) (x) = TRUE;
399 #define CLEARACTIVEFLAG(x) while((x) == TRUE) (x) = FALSE;
401 #define USB_ZERO_STRUCT(x) memset(&x,0,sizeof(x))
402 #define ZERO_STRUCT(x) memset(&x,0,sizeof(x))
404 #if defined(__USB_C__)
406 volatile uint8_t u8DebugDepth = 0;
407 volatile uint8_t u8Dbgi = 0;
408 #warning USB DEBUG ENABLED
410 #if (USBWARNLEVEL == 2)
412 #warning *************** Library Usage **************************
413 #if (USB_USE_STANDALONE == ON)
414 #warning Info: USB_USE_STANDALONE == ON
416 #warning Info: USB_USE_STANDALONE == OFF
419 #if (USB_USE_L3 == ON)
420 #warning Info: USB_USE_L3 == ON
422 #warning Info: USB_USE_L3 == OFF
425 #if (USB_USE_PDL == ON)
426 #warning Info: USB_USE_PDL == ON
428 #warning Info: USB_USE_PDL == OFF
431 #warning *************** USB Enabled Interfaces *****************
432 #if USB_INTERFACES_COUNT == 0
433 #warning Info: USB_INTERFACES_COUNT == 0
434 #elif USB_INTERFACES_COUNT == 2
435 #warning Info: USB_INTERFACES_COUNT == 2
436 #elif USB_INTERFACES_COUNT == 3
437 #warning Info: USB_INTERFACES_COUNT == 3
438 #elif USB_INTERFACES_COUNT == 4
439 #warning Info: USB_INTERFACES_COUNT == 4
440 #elif USB_INTERFACES_COUNT == 5
441 #warning Info: USB_INTERFACES_COUNT == 5
442 #elif USB_INTERFACES_COUNT == 6
443 #warning Info: USB_INTERFACES_COUNT == 6
446 #if (FM_PERIPHERAL_USB_HOST_ENABLED == OFF)
447 #warning Info: HOST EXCLUDED
450 #if (FM_PERIPHERAL_USB_DEVICE_ENABLED == OFF)
451 #warning Info: DEVICE EXCLUDED
454 #if (FM_PERIPHERAL_ENABLE_USB0_HOST == ON)
455 #warning Info: FM_PERIPHERAL_ENABLE_USB0_HOST == ON
457 #warning Info: FM_PERIPHERAL_ENABLE_USB0_HOST == OFF
460 #if (FM_PERIPHERAL_ENABLE_USB1_HOST == ON)
461 #warning Info: FM_PERIPHERAL_ENABLE_USB1_HOST == ON
463 #warning Info: FM_PERIPHERAL_ENABLE_USB1_HOST == OFF
466 #if (FM_PERIPHERAL_ENABLE_USB0_DEVICE == ON)
467 #warning Info: FM_PERIPHERAL_ENABLE_USB0_DEVICE == ON
469 #warning Info: FM_PERIPHERAL_ENABLE_USB0_DEVICE == OFF
472 #if (FM_PERIPHERAL_ENABLE_USB1_DEVICE == ON)
473 #warning Info: FM_PERIPHERAL_ENABLE_USB1_DEVICE == ON
475 #warning Info: FM_PERIPHERAL_ENABLE_USB1_DEVICE == OFF
478 #warning *************** USB Middleware *************************
479 #if USBDEVICECDCCOM_ENABLED == ON
480 #warning Info: USBDEVICECDCCOM_ENABLED == ON
482 #warning Info: USBDEVICECDCCOM_ENABLED == OFF
485 #if USBDEVICEHIDJOYSTICK == ON
486 #warning Info: USBDEVICEHIDJOYSTICK == ON
488 #warning Info: USBDEVICEHIDJOYSTICK == OFF
491 #if USBDEVICEHIDKEYBOARD_ENABLED == ON
492 #warning Info: USBDEVICEHIDKEYBOARD_ENABLED == ON
494 #warning Info: USBDEVICEHIDKEYBOARD_ENABLED == OFF
497 #if USBDEVICEMOUSE_ENABLED == ON
498 #warning Info: USBDEVICEMOUSE_ENABLED == ON
500 #warning Info: USBDEVICEMOUSE_ENABLED == OFF
503 #if USBDEVICELIBUSB_ENABLED == ON
504 #warning Info: USBDEVICELIBUSB_ENABLED == ON
506 #warning Info: USBDEVICELIBUSB_ENABLED == OFF
509 #if USBDEVICEPRINTER_ENABLED == ON
510 #warning Info: USBDEVICEPRINTER_ENABLED == ON
512 #warning Info: USBDEVICEPRINTER_ENABLED == OFF
516 #if USBHOSTHIDCOM_ENABLED == ON
517 #warning Info: USBHOSTHIDCOM_ENABLED == ON
519 #warning Info: USBHOSTHIDCOM_ENABLED == OFF
522 #if USBHOSTHIDKEYBOARD_ENABLED == ON
523 #warning Info: USBHOSTHIDKEYBOARD_ENABLED == ON
525 #warning Info: USBHOSTHIDKEYBOARD_ENABLED == OFF
528 #if USBHOSTHIDMOUSE_ENABLED == ON
529 #warning Info: USBHOSTHIDMOUSE_ENABLED == ON
531 #warning Info: USBHOSTHIDMOUSE_ENABLED == OFF
534 #if USBHOSTMASSSTORAGE_ENABLED == ON
535 #warning Info: USBHOSTMASSSTORAGE_ENABLED == ON
537 #warning Info: USBHOSTMASSSTORAGE_ENABLED == OFF
540 #warning *************** USB IRQ Settings ***********************
541 #if USB0_DEVICE_IRQ_ENABLED == ON
542 #warning Info: USB0_DEVICE_IRQ_ENABLED == ON
544 #warning Info: USB0_DEVICE_IRQ_ENABLED == OFF
546 #if USB0_HOST_IRQ_ENABLED == ON
547 #warning Info: USB0_HOST_IRQ_ENABLED == ON
549 #warning Info: USB0_HOST_IRQ_ENABLED == OFF
551 #if USB1_DEVICE_IRQ_ENABLED == ON
552 #warning Info: USB1_DEVICE_IRQ_ENABLED == ON
554 #warning Info: USB1_DEVICE_IRQ_ENABLED == OFF
556 #if USB1_HOST_IRQ_ENABLED == ON
557 #warning Info: USB1_HOST_IRQ_ENABLED == ON
559 #warning Info: USB1_HOST_IRQ_ENABLED == OFF
561 #if IRQ_LEVEL_USB0 == 0
562 #warning Info: IRQ_LEVEL_USB0 == 0
563 #elif IRQ_LEVEL_USB0 == 1
564 #warning Info: IRQ_LEVEL_USB0 == 1
565 #elif IRQ_LEVEL_USB0 == 2
566 #warning Info: IRQ_LEVEL_USB0 == 2
567 #elif IRQ_LEVEL_USB0 == 3
568 #warning Info: IRQ_LEVEL_USB0 == 3
569 #elif IRQ_LEVEL_USB0 == 4
570 #warning Info: IRQ_LEVEL_USB0 == 4
571 #elif IRQ_LEVEL_USB0 == 5
572 #warning Info: IRQ_LEVEL_USB0 == 5
573 #elif IRQ_LEVEL_USB0 == 6
574 #warning Info: IRQ_LEVEL_USB0 == 6
575 #elif IRQ_LEVEL_USB0 == 7
576 #warning Info: IRQ_LEVEL_USB0 == 7
577 #elif IRQ_LEVEL_USB0 == 8
578 #warning Info: IRQ_LEVEL_USB0 == 8
579 #elif IRQ_LEVEL_USB0 == 9
580 #warning Info: IRQ_LEVEL_USB0 == 9
581 #elif IRQ_LEVEL_USB0 == 10
582 #warning Info: IRQ_LEVEL_USB0 == 10
583 #elif IRQ_LEVEL_USB0 == 11
584 #warning Info: IRQ_LEVEL_USB0 == 11
585 #elif IRQ_LEVEL_USB0 == 12
586 #warning Info: IRQ_LEVEL_USB0 == 12
587 #elif IRQ_LEVEL_USB0 == 13
588 #warning Info: IRQ_LEVEL_USB0 == 13
589 #elif IRQ_LEVEL_USB0 == 14
590 #warning Info: IRQ_LEVEL_USB0 == 14
591 #elif IRQ_LEVEL_USB0 == 15
592 #warning Info: IRQ_LEVEL_USB0 == 15
595 #if IRQ_LEVEL_USB1 == 0
596 #warning Info: IRQ_LEVEL_USB1 == 0
597 #elif IRQ_LEVEL_USB1 == 1
598 #warning Info: IRQ_LEVEL_USB1 == 1
599 #elif IRQ_LEVEL_USB1 == 2
600 #warning Info: IRQ_LEVEL_USB1 == 2
601 #elif IRQ_LEVEL_USB1 == 3
602 #warning Info: IRQ_LEVEL_USB1 == 3
603 #elif IRQ_LEVEL_USB1 == 4
604 #warning Info: IRQ_LEVEL_USB1 == 4
605 #elif IRQ_LEVEL_USB1 == 5
606 #warning Info: IRQ_LEVEL_USB1 == 5
607 #elif IRQ_LEVEL_USB1 == 6
608 #warning Info: IRQ_LEVEL_USB1 == 6
609 #elif IRQ_LEVEL_USB1 == 7
610 #warning Info: IRQ_LEVEL_USB1 == 7
611 #elif IRQ_LEVEL_USB1 == 8
612 #warning Info: IRQ_LEVEL_USB1 == 8
613 #elif IRQ_LEVEL_USB1 == 9
614 #warning Info: IRQ_LEVEL_USB1 == 9
615 #elif IRQ_LEVEL_USB1 == 10
616 #warning Info: IRQ_LEVEL_USB1 == 10
617 #elif IRQ_LEVEL_USB1 == 11
618 #warning Info: IRQ_LEVEL_USB1 == 11
619 #elif IRQ_LEVEL_USB1 == 12
620 #warning Info: IRQ_LEVEL_USB1 == 12
621 #elif IRQ_LEVEL_USB1 == 13
622 #warning Info: IRQ_LEVEL_USB1 == 13
623 #elif IRQ_LEVEL_USB1 == 14
624 #warning Info: IRQ_LEVEL_USB1 == 14
625 #elif IRQ_LEVEL_USB1 == 15
626 #warning Info: IRQ_LEVEL_USB1 == 15
630 #if IRQ_LEVEL_USB0 > 15
631 #error IRQ_LEVEL_USB0 must be <= 15
634 #if IRQ_LEVEL_USB1 > 15
635 #error IRQ_LEVEL_USB1 must be <= 15
646 #ifndef FM3MCUTYPE_TYPE0
647 #define FM3MCUTYPE_TYPE0 0
649 #ifndef FM3MCUTYPE_TYPE1
650 #define FM3MCUTYPE_TYPE1 1
652 #ifndef FM3MCUTYPE_TYPE2
653 #define FM3MCUTYPE_TYPE2 2
655 #ifndef FM3MCUTYPE_TYPE3
656 #define FM3MCUTYPE_TYPE3 3
658 #ifndef FM3MCUTYPE_TYPE4
659 #define FM3MCUTYPE_TYPE4 4
661 #ifndef FM3MCUTYPE_TYPE5
662 #define FM3MCUTYPE_TYPE5 5
664 #ifndef FM3MCUTYPE_TYPE6
665 #define FM3MCUTYPE_TYPE6 6
667 #ifndef FM3MCUTYPE_TYPE7
668 #define FM3MCUTYPE_TYPE7 7
672 #ifndef FM4MCUTYPE_TYPE0
673 #define FM4MCUTYPE_TYPE0 0
677 #ifdef FM3_DEVICE_TYPE
679 #define FM3MCUTYPE FM3_DEVICE_TYPE
683 #ifdef FM4_DEVICE_TYPE
685 #define FM4MCUTYPE FM4_DEVICE_TYPE
689 #if (0 == USB_USE_L3)
692 #define FM4MCUTYPE FM4MCUTYPE_TYPE0
695 #define FM4MCUTYPE FM4MCUTYPE_TYPE0
701 #define FM3MCUTYPE FM3MCUTYPE_TYPE9
704 #define FM3MCUTYPE FM3MCUTYPE_TYPE9
707 #define FM3MCUTYPE FM3MCUTYPE_TYPE9
710 #define FM3MCUTYPE FM3MCUTYPE_TYPE9
713 #define FM3MCUTYPE FM3MCUTYPE_TYPE9
716 #define FM3MCUTYPE FM3MCUTYPE_TYPE9
719 #define FM3MCUTYPE FM3MCUTYPE_TYPE9
722 #define FM3MCUTYPE FM3MCUTYPE_TYPE9
725 #define FM3MCUTYPE FM3MCUTYPE_TYPE9
728 #define FM3MCUTYPE FM3MCUTYPE_TYPE9
731 #define FM3MCUTYPE FM3MCUTYPE_TYPE9
734 #define FM3MCUTYPE FM3MCUTYPE_TYPE9
737 #define FM3MCUTYPE FM3MCUTYPE_TYPE0
740 #define FM3MCUTYPE FM3MCUTYPE_TYPE0
743 #define FM3MCUTYPE FM3MCUTYPE_TYPE0
746 #define FM3MCUTYPE FM3MCUTYPE_TYPE0
749 #define FM3MCUTYPE FM3MCUTYPE_TYPE0
752 #define FM3MCUTYPE FM3MCUTYPE_TYPE0
755 #define FM3MCUTYPE FM3MCUTYPE_TYPE0
758 #define FM3MCUTYPE FM3MCUTYPE_TYPE0
761 #define FM3MCUTYPE FM3MCUTYPE_TYPE2
764 #define FM3MCUTYPE FM3MCUTYPE_TYPE2
767 #define FM3MCUTYPE FM3MCUTYPE_TYPE2
770 #define FM3MCUTYPE FM3MCUTYPE_TYPE2
773 #define FM3MCUTYPE FM3MCUTYPE_TYPE2
776 #define FM3MCUTYPE FM3MCUTYPE_TYPE2
779 #define FM3MCUTYPE FM3MCUTYPE_TYPE2
782 #define FM3MCUTYPE FM3MCUTYPE_TYPE2
785 #define FM3MCUTYPE FM3MCUTYPE_TYPE2
788 #define FM3MCUTYPE FM3MCUTYPE_TYPE2
791 #define FM3MCUTYPE FM3MCUTYPE_TYPE2
794 #define FM3MCUTYPE FM3MCUTYPE_TYPE2
797 #define FM3MCUTYPE FM3MCUTYPE_TYPE2
800 #define FM3MCUTYPE FM3MCUTYPE_TYPE2
803 #define FM3MCUTYPE FM3MCUTYPE_TYPE4
806 #define FM3MCUTYPE FM3MCUTYPE_TYPE4
809 #define FM3MCUTYPE FM3MCUTYPE_TYPE4
812 #define FM3MCUTYPE FM3MCUTYPE_TYPE4
815 #define FM3MCUTYPE FM3MCUTYPE_TYPE4
818 #define FM3MCUTYPE FM3MCUTYPE_TYPE4
821 #define FM3MCUTYPE FM3MCUTYPE_TYPE4
824 #define FM3MCUTYPE FM3MCUTYPE_TYPE4
827 #define FM3MCUTYPE FM3MCUTYPE_TYPE5
830 #define FM3MCUTYPE FM3MCUTYPE_TYPE5
833 #define FM3MCUTYPE FM3MCUTYPE_TYPE1
836 #define FM3MCUTYPE FM3MCUTYPE_TYPE1
839 #define FM3MCUTYPE FM3MCUTYPE_TYPE1
842 #define FM3MCUTYPE FM3MCUTYPE_TYPE1
845 #define FM3MCUTYPE FM3MCUTYPE_TYPE1
848 #define FM3MCUTYPE FM3MCUTYPE_TYPE0
851 #define FM3MCUTYPE FM3MCUTYPE_TYPE1
854 #define FM3MCUTYPE FM3MCUTYPE_TYPE0
857 #define FM3MCUTYPE FM3MCUTYPE_TYPE6
860 #define FM3MCUTYPE FM3MCUTYPE_TYPE6
863 #define FM3MCUTYPE FM3MCUTYPE_TYPE6
866 #define FM3MCUTYPE FM3MCUTYPE_TYPE6
869 #define FM3MCUTYPE FM3MCUTYPE_TYPE6
872 #define FM3MCUTYPE FM3MCUTYPE_TYPE6
875 #define FM3MCUTYPE FM3MCUTYPE_TYPE6
878 #define FM3MCUTYPE FM3MCUTYPE_TYPE6
881 #define FM3MCUTYPE FM3MCUTYPE_TYPE6
884 #define FM3MCUTYPE FM3MCUTYPE_TYPE6
887 #define FM3MCUTYPE FM3MCUTYPE_TYPE6
890 #define FM3MCUTYPE FM3MCUTYPE_TYPE6
893 #define FM3MCUTYPE FM3MCUTYPE_TYPE8
896 #define FM3MCUTYPE FM3MCUTYPE_TYPE8
899 #define FM3MCUTYPE FM3MCUTYPE_TYPE8
902 #define FM3MCUTYPE FM3MCUTYPE_TYPE3
905 #define FM3MCUTYPE FM3MCUTYPE_TYPE3
908 #define FM3MCUTYPE FM3MCUTYPE_TYPE7
911 #define FM3MCUTYPE FM3MCUTYPE_TYPE7
914 #define FM3MCUTYPE FM3MCUTYPE_TYPE7
917 #define FM3MCUTYPE FM3MCUTYPE_TYPE7
920 #define FM3MCUTYPE FM3MCUTYPE_TYPE7
923 #else // (0 == USB_USE_L3)
925 #if (L3_DEVICE_TYPE == L3_TYPE0)
926 #define FM3MCUTYPE FM3MCUTYPE_TYPE0
927 #elif (L3_DEVICE_TYPE == L3_TYPE1)
928 #define FM3MCUTYPE FM3MCUTYPE_TYPE1
929 #elif (L3_DEVICE_TYPE == L3_TYPE2)
930 #define FM3MCUTYPE FM3MCUTYPE_TYPE2
931 #elif (L3_DEVICE_TYPE == L3_TYPE3)
932 #define FM3MCUTYPE FM3MCUTYPE_TYPE3
933 #elif (L3_DEVICE_TYPE == L3_TYPE4)
934 #define FM3MCUTYPE FM3MCUTYPE_TYPE4
935 #elif (L3_DEVICE_TYPE == L3_TYPE5)
936 #define FM3MCUTYPE FM3MCUTYPE_TYPE5
937 #elif (L3_DEVICE_TYPE == L3_TYPE6)
938 #define FM3MCUTYPE FM3MCUTYPE_TYPE6
939 #elif (L3_DEVICE_TYPE == L3_TYPE7)
940 #define FM3MCUTYPE FM3MCUTYPE_TYPE7
943 #endif // (0 == USB_USE_L3)
956 #define USBDESCR_DEVICE 1
957 #define USBDESCR_CONFIG 2
958 #define USBDESCR_STRING 3
959 #define USBDESCR_INTERFACE 4
960 #define USBDESCR_ENDPOINT 5
962 #define USB_DEVREQ_STDTYPE 0x00
963 #define USB_DEVREQ_CLSTYPE 0x20
964 #define USB_DEVREQ_VNDTYPE 0x40
966 #define USB_DEVREQ_GET_DESC 0x06
967 #define USB_DEVREQ_SET_DESC 0x07
968 #define USB_DEVREQ_SET_IDLE 0x0A
970 #define USB_GET_STATUS 0x00
971 #define USB_CLEAR_FEATURE 0x01
972 #define USB_SET_FEATURE 0x03
973 #define USB_SET_ADDRESS 0x05
974 #define USB_GET_DESCRIPTOR 0x06
975 #define USB_SET_DESCRIPTOR 0x07
976 #define USB_GET_CONFIGURATION 0x08
977 #define USB_SET_CONFIGURATION 0x09
978 #define USB_GET_INTERFACE 0x0A
979 #define USB_SET_INTERFACE 0x0B
980 #define USB_SYNCH_FRAME 0x0C
982 #define USBATTR_BUSPOWER 0x80
983 #define USBATTR_SELFPOWER 0xC0
984 #define USBATTR_REMOTEWAKE 0x20
986 #define USB_FUNC_INTR_IN 0xF000
987 #define USB_FUNC_INTR_OUT 0xE000
988 #define USB_FUNC_BULK_IN 0xD000
989 #define USB_FUNC_BULK_OUT 0xC000
991 #define USB_MASK_EPC_PKS 0x007F
992 #define USB_MASK_EPC_PKS1 0x01FF
993 #define USB_MASK_EPC_STAL 0x0200
994 #define USB_MASK_EPC_NULE 0x0400
995 #define USB_MASK_EPC_DMAE 0x0800
996 #define USB_MASK_EPC_DIR 0x1000
997 #define USB_MASK_EPC_TYPE 0x6000
998 #define USB_MASK_EPC_EPEN 0x8000
1000 #define USB_MASK_EPS_DRQIIE 0x4000
1001 #define USB_MASK_EPS_BFINI 0x8000
1002 #define USB_MASK_EPS_SIZE1 0x01FF
1003 #define USB_MASK_EPS_SIZE 0x007F
1004 #define USB_MASK_EPS_SPK 0x0200
1005 #define USB_MASK_EPS_DRQI 0x0400
1006 #define USB_MASK_EPS_DRQO 0x0400
1007 #define USB_MASK_EPS_DRQ 0x0400
1008 #define USB_MASK_EPS_BUSY 0x0800
1009 #define USB_MASK_EPS_SPKIE 0x2000
1010 #define USB_MASK_EPS_DRQIE 0x4000
1011 #define USB_MASK_EPS_DRQOIE 0x4000
1012 #define USB_MASK_EPS_BFINI 0x8000
1014 #ifndef BITMASK_ISSET
1015 #define BITMASK_ISSET(x,y) ((x & y) > 0)
1018 #ifndef BITMASK_ISCLEARED
1019 #define BITMASK_ISCLEARED(x,y) ((x & y) == 0)
1023 #define BITMASK_SET(x,y) x |= y
1026 #ifndef BITMASK_CLEAR
1027 #define BITMASK_CLEAR(x,y) x &= ~y
1030 #ifndef __USBBITDEFINITIONS_H__
1031 #define __USBBITDEFINITIONS_H__
1032 #define _UDCC_RST (1 << 7)
1033 #define _UDCC_RESUM (1 << 6)
1034 #define _UDCC_HCONX (1 << 5)
1035 #define _UDCC_USTP (1 << 4)
1036 #define _UDCC_RFBK (1 << 1)
1037 #define _UDCC_PWC (1 << 0)
1039 #define _EP0C_PKS0 0x7F
1040 #define _EP0C_STAL (1 << 9)
1043 #define _EPNC_STAL (1 << 9)
1044 #define _EPNC_NULE (1 << 10)
1045 #define _EPNC_DMAE (1 << 11)
1046 #define _EPNC_DIR (1 << 12)
1047 #define _EPNC_TYPE 0x6000
1048 #define _EPNC_EPEN (1 << 15)
1050 #define _EP1C_PKS1 0x1FF
1051 #define _EP1C_STAL (1 << 9)
1052 #define _EP1C_NULE (1 << 10)
1053 #define _EP1C_DMAE (1 << 11)
1054 #define _EP1C_DIR (1 << 12)
1055 #define _EP1C_TYPE 0x6000
1056 #define _EP1C_EPEN (1 << 15)
1058 #define _EP2C_PKS2 0xFF
1059 #define _EP2C_STAL (1 << 9)
1060 #define _EP2C_NULE (1 << 10)
1061 #define _EP2C_DMAE (1 << 11)
1062 #define _EP2C_DIR (1 << 12)
1063 #define _EP2C_TYPE 0x6000
1064 #define _EP2C_EPEN (1 << 15)
1066 #define _EP3C_PKS3 0xFF
1067 #define _EP3C_STAL (1 << 9)
1068 #define _EP3C_NULE (1 << 10)
1069 #define _EP3C_DMAE (1 << 11)
1070 #define _EP3C_DIR (1 << 12)
1071 #define _EP3C_TYPE 0x6000
1072 #define _EP3C_EPEN (1 << 15)
1074 #define _EP4C_PKS4 0xFF
1075 #define _EP4C_STAL (1 << 9)
1076 #define _EP4C_NULE (1 << 10)
1077 #define _EP4C_DMAE (1 << 11)
1078 #define _EP4C_DIR (1 << 12)
1079 #define _EP4C_TYPE 0x6000
1080 #define _EP4C_EPEN (1 << 15)
1082 #define _EP5C_PKS5 0xFF
1083 #define _EP5C_STAL (1 << 9)
1084 #define _EP5C_NULE (1 << 10)
1085 #define _EP5C_DMAE (1 << 11)
1086 #define _EP5C_DIR (1 << 12)
1087 #define _EP5C_TYPE 0x6000
1088 #define _EP5C_EPEN (1 << 15)
1090 #define _EPC_TYPE_BULK 0x4000
1091 #define _EPC_TYPE_INTERRUPT 0x6000
1093 #define _UDCS_CONF (1 << 0)
1094 #define _UDCS_SETP (1 << 1)
1095 #define _UDCS_WKUP (1 << 2)
1096 #define _UDCS_BRST (1 << 3)
1097 #define _UDCS_SOF (1 << 4)
1098 #define _UDCS_SUSP (1 << 5)
1100 #define _UDCIE_CONFIE (1 << 0)
1101 #define _UDCIE_CONFN (1 << 1)
1102 #define _UDCIE_WKUPIE (1 << 2)
1103 #define _UDCIE_BRSTIE (1 << 3)
1104 #define _UDCIE_SOFIE (1 << 4)
1105 #define _UDCIE_SUSPIE (1 << 5)
1107 #define _EPNS_SPK (1 << 9)
1108 #define _EPNS_DRQ (1 << 10)
1109 #define _EPNS_BUSY (1 << 11)
1110 #define _EPNS_SPKIE (1 << 13)
1111 #define _EPNS_DRQIE (1 << 14)
1112 #define _EPNS_BFINI (1 << 15)
1114 #define _EP0IS_DRQI (1 << 10)
1115 #define _EP0IS_DRQIIE (1 << 14)
1116 #define _EP0IS_BFINI (1 << 15)
1118 #define _EP0OS_SIZE 0x7F
1119 #define _EP0OS_SPK (1 << 9)
1120 #define _EP0OS_DRQO (1 << 10)
1121 #define _EP0OS_SPKIE (1 << 13)
1122 #define _EP0OS_DRQOIE (1 << 14)
1123 #define _EP0OS_BFINI (1 << 15)
1125 #define _EP1S_SIZE 0x1FF
1126 #define _EP1S_SPK (1 << 9)
1127 #define _EP1S_DRQ (1 << 10)
1128 #define _EP1S_BUSY (1 << 11)
1129 #define _EP1S_SPKIE (1 << 13)
1130 #define _EP1S_DRQIE (1 << 14)
1131 #define _EP1S_BFINI (1 << 15)
1133 #define _EP2S_SIZE 0xFF
1134 #define _EP2S_SPK (1 << 9)
1135 #define _EP2S_DRQ (1 << 10)
1136 #define _EP2S_BUSY (1 << 11)
1137 #define _EP2S_SPKIE (1 << 13)
1138 #define _EP2S_DRQIE (1 << 14)
1139 #define _EP2S_BFINI (1 << 15)
1141 #define _EP3S_SIZE 0xFF
1142 #define _EP3S_SPK (1 << 9)
1143 #define _EP3S_DRQ (1 << 10)
1144 #define _EP3S_BUSY (1 << 11)
1145 #define _EP3S_SPKIE (1 << 13)
1146 #define _EP3S_DRQIE (1 << 14)
1147 #define _EP3S_BFINI (1 << 15)
1149 #define _EP4S_SIZE 0xFF
1150 #define _EP4S_SPK (1 << 9)
1151 #define _EP4S_DRQ (1 << 10)
1152 #define _EP4S_BUSY (1 << 11)
1153 #define _EP4S_SPKIE (1 << 13)
1154 #define _EP4S_DRQIE (1 << 14)
1155 #define _EP4S_BFINI (1 << 15)
1157 #define _EP5S_SIZE 0xFF
1158 #define _EP5S_SPK (1 << 9)
1159 #define _EP5S_DRQ (1 << 10)
1160 #define _EP5S_BUSY (1 << 11)
1161 #define _EP5S_SPKIE (1 << 13)
1162 #define _EP5S_DRQIE (1 << 14)
1163 #define _EP5S_BFINI (1 << 15)
1165 #define _HCNT_HOST (1 << 0)
1166 #define _HCNT_URST (1 << 1)
1167 #define _HCNT_SOFIRE (1 << 2)
1168 #define _HCNT_DIRE (1 << 3)
1169 #define _HCNT_CNNIRE (1 << 4)
1170 #define _HCNT_CMPIRE (1 << 5)
1171 #define _HCNT_URIRE (1 << 6)
1172 #define _HCNT_RWKIRE (1 << 7)
1173 #define _HCNT_RETRY (1 << 8)
1174 #define _HCNT_CANCEL (1 << 9)
1175 #define _HCNT_SOFSTEP (1 << 10)
1177 #define _HIRQ_SOFIRQ (1 << 0)
1178 #define _HIRQ_DIRQ (1 << 1)
1179 #define _HIRQ_CNNIRQ (1 << 2)
1180 #define _HIRQ_CMPIRQ (1 << 3)
1181 #define _HIRQ_URIRQ (1 << 4)
1182 #define _HIRQ_RWKIRQ (1 << 5)
1183 #define _HIRQ_TCAN (1 << 7)
1185 #define _HERR_HS 0x03
1186 #define _HERR_STUFF (1 << 2)
1187 #define _HERR_TGERR (1 << 3)
1188 #define _HERR_CRC (1 << 4)
1189 #define _HERR_TOUT (1 << 5)
1190 #define _HERR_RERR (1 << 6)
1191 #define _HERR_LSTSOF (1 << 7)
1193 #define _HSTATE_CSTAT (1 << 0)
1194 #define _HSTATE_TMODE (1 << 1)
1195 #define _HSTATE_SUSP (1 << 2)
1196 #define _HSTATE_SOFBUSY (1 << 3)
1197 #define _HSTATE_CLKSEL (1 << 4)
1198 #define _HSTATE_ALIVE (1 << 5)
1199 #endif // __USBBITDEFINITIONS_H__
1202 #define __IO volatile
1205 #ifndef __USBSPEC_H__
1206 #define __USBSPEC_H__
1209 #define GET_DESCRIPTOR 0x06
1210 #define USB_DEVICE_DESCRIPTOR_TYPE 0x01
1211 #define USB_CONFIGURATION_DESCRIPTOR_TYPE 0x02
1212 #define USB_STRING_DESCRIPTOR_TYPE 0x03
1213 #define USB_INTERFACE_DESCRIPTOR_TYPE 0x04
1214 #define USB_ENDPOINT_DESCRIPTOR_TYPE 0x05
1215 #define USB_DEVICE_QUALIFIER_DESCRIPTOR_TYPE 0x06
1216 #define USB_OTHER_SPEED_CONFIGURATION_DESCRIPTOR_TYPE 0x07
1217 #define USB_HID_DESCRIPTOR_TYPE 0x21
1219 #define USB_IN_DIRECTION 0x80
1220 #define USB_OUT_DIRECTION 0x00
1222 #define USB_EP_TYPE_CONTROL 0x00
1223 #define USB_EP_TYPE_ISO 0x01
1224 #define USB_EP_TYPE_BULK 0x02
1225 #define USB_EP_TYPE_INT 0x03
1228 #define bL3_FM3_GPIO_EPFR00_USB0PE *((volatile unsigned int*)(0x4266C024UL))
1229 #define bL3_FM3_GPIO_PFR6_P1 *((volatile unsigned int*)(0x42660304UL))
1230 #define bL3_FM3_GPIO_SPSR_USB0C *((volatile unsigned int*)(0x4266B010UL))
1231 #define bL3_FM3_GPIO_EPFR00_USB1PE *((volatile unsigned int*)(0x4266C034UL))
1232 #define bL3_FM3_GPIO_PFR2_P0 *((volatile unsigned int*)(0x42660100UL))
1233 #define bL3_FM3_GPIO_SPSR_USB1C *((volatile unsigned int*)(0x4266B014UL))
1274 #endif // __USBSPEC_H__
1288 typedef struct stc_usbn_hcnt_field
1290 __IO uint16_t HOST : 1;
1291 __IO uint16_t URST : 1;
1292 __IO uint16_t SOFIRE : 1;
1293 __IO uint16_t DIRE : 1;
1294 __IO uint16_t CNNIRE : 1;
1295 __IO uint16_t CMPIRE : 1;
1296 __IO uint16_t URIRE : 1;
1297 __IO uint16_t RWKIRE : 1;
1298 __IO uint16_t RETRY : 1;
1299 __IO uint16_t CANCEL : 1;
1300 __IO uint16_t SOFSTEP : 1;
1301 } stc_usbn_hcnt_field_t;
1303 typedef struct stc_usbn_hcnt0_field
1305 __IO uint8_t HOST : 1;
1306 __IO uint8_t URST : 1;
1307 __IO uint8_t SOFIRE : 1;
1308 __IO uint8_t DIRE : 1;
1309 __IO uint8_t CNNIRE : 1;
1310 __IO uint8_t CMPIRE : 1;
1311 __IO uint8_t URIRE : 1;
1312 __IO uint8_t RWKIRE : 1;
1313 } stc_usbn_hcnt0_field_t;
1315 typedef struct stc_usbn_hcnt1_field
1317 __IO uint8_t RETRY : 1;
1318 __IO uint8_t CANCEL : 1;
1319 __IO uint8_t SOFSTEP : 1;
1320 } stc_usbn_hcnt1_field_t;
1322 typedef struct stc_usbn_hirq_field
1324 __IO uint8_t SOFIRQ : 1;
1325 __IO uint8_t DIRQ : 1;
1326 __IO uint8_t CNNIRQ : 1;
1327 __IO uint8_t CMPIRQ : 1;
1328 __IO uint8_t URIRQ : 1;
1329 __IO uint8_t RWKIRQ : 1;
1330 uint8_t RESERVED1 : 1;
1331 __IO uint8_t TCAN : 1;
1332 } stc_usbn_hirq_field_t;
1334 typedef struct stc_usbn_herr_field
1336 __IO uint8_t HS0 : 1;
1337 __IO uint8_t HS1 : 1;
1338 __IO uint8_t STUFF : 1;
1339 __IO uint8_t TGERR : 1;
1340 __IO uint8_t CRC : 1;
1341 __IO uint8_t TOUT : 1;
1342 __IO uint8_t RERR : 1;
1343 __IO uint8_t LSTOF : 1;
1344 } stc_usbn_herr_field_t;
1346 typedef struct stc_usbn_hstate_field
1348 __IO uint8_t CSTAT : 1;
1349 __IO uint8_t TMODE : 1;
1350 __IO uint8_t SUSP : 1;
1351 __IO uint8_t SOFBUSY : 1;
1352 __IO uint8_t CLKSEL : 1;
1353 __IO uint8_t ALIVE : 1;
1354 } stc_usbn_hstate_field_t;
1356 typedef struct stc_usbn_hfcomp_field
1358 __IO uint8_t FRAMECOMP0 : 1;
1359 __IO uint8_t FRAMECOMP1 : 1;
1360 __IO uint8_t FRAMECOMP2 : 1;
1361 __IO uint8_t FRAMECOMP3 : 1;
1362 __IO uint8_t FRAMECOMP4 : 1;
1363 __IO uint8_t FRAMECOMP5 : 1;
1364 __IO uint8_t FRAMECOMP6 : 1;
1365 __IO uint8_t FRAMECOMP7 : 1;
1366 } stc_usbn_hfcomp_field_t;
1368 typedef struct stc_usbn_hrtimer_field
1370 __IO uint16_t RTIMER0 : 1;
1371 __IO uint16_t RTIMER1 : 1;
1372 __IO uint16_t RTIMER2 : 1;
1373 __IO uint16_t RTIMER3 : 1;
1374 __IO uint16_t RTIMER4 : 1;
1375 __IO uint16_t RTIMER5 : 1;
1376 __IO uint16_t RTIMER6 : 1;
1377 __IO uint16_t RTIMER7 : 1;
1378 __IO uint16_t RTIMER8 : 1;
1379 __IO uint16_t RTIMER9 : 1;
1380 __IO uint16_t RTIMER10 : 1;
1381 __IO uint16_t RTIMER11 : 1;
1382 __IO uint16_t RTIMER12 : 1;
1383 __IO uint16_t RTIMER13 : 1;
1384 __IO uint16_t RTIMER14 : 1;
1385 __IO uint16_t RTIMER15 : 1;
1386 } stc_usbn_hrtimer_field_t;
1388 typedef struct stc_usbn_hrtimer0_field
1390 __IO uint8_t RTIMER00 : 1;
1391 __IO uint8_t RTIMER01 : 1;
1392 __IO uint8_t RTIMER02 : 1;
1393 __IO uint8_t RTIMER03 : 1;
1394 __IO uint8_t RTIMER04 : 1;
1395 __IO uint8_t RTIMER05 : 1;
1396 __IO uint8_t RTIMER06 : 1;
1397 __IO uint8_t RTIMER07 : 1;
1398 } stc_usbn_hrtimer0_field_t;
1400 typedef struct stc_usbn_hrtimer1_field
1402 __IO uint8_t RTIMER10 : 1;
1403 __IO uint8_t RTIMER11 : 1;
1404 __IO uint8_t RTIMER12 : 1;
1405 __IO uint8_t RTIMER13 : 1;
1406 __IO uint8_t RTIMER14 : 1;
1407 __IO uint8_t RTIMER15 : 1;
1408 __IO uint8_t RTIMER16 : 1;
1409 __IO uint8_t RTIMER17 : 1;
1410 } stc_usbn_hrtimer1_field_t;
1412 typedef struct stc_usbn_hrtimer2_field
1414 __IO uint8_t RTIMER20 : 1;
1415 __IO uint8_t RTIMER21 : 1;
1416 __IO uint8_t RTIMER22 : 1;
1417 } stc_usbn_hrtimer2_field_t;
1419 typedef struct stc_usbn_hadr_field
1421 __IO uint8_t ADDRESS0 : 1;
1422 __IO uint8_t ADDRESS1 : 1;
1423 __IO uint8_t ADDRESS2 : 1;
1424 __IO uint8_t ADDRESS3 : 1;
1425 __IO uint8_t ADDRESS4 : 1;
1426 __IO uint8_t ADDRESS5 : 1;
1427 __IO uint8_t ADDRESS6 : 1;
1428 } stc_usbn_hadr_field_t;
1430 typedef struct stc_usbn_heof_field
1432 __IO uint16_t EOF0 : 1;
1433 __IO uint16_t EOF1 : 1;
1434 __IO uint16_t EOF2 : 1;
1435 __IO uint16_t EOF3 : 1;
1436 __IO uint16_t EOF4 : 1;
1437 __IO uint16_t EOF5 : 1;
1438 __IO uint16_t EOF6 : 1;
1439 __IO uint16_t EOF7 : 1;
1440 __IO uint16_t EOF8 : 1;
1441 __IO uint16_t EOF9 : 1;
1442 __IO uint16_t EOF10 : 1;
1443 __IO uint16_t EOF11 : 1;
1444 __IO uint16_t EOF12 : 1;
1445 __IO uint16_t EOF13 : 1;
1446 __IO uint16_t EOF14 : 1;
1447 __IO uint16_t EOF15 : 1;
1448 } stc_usbn_heof_field_t;
1450 typedef struct stc_usbn_heof0_field
1452 __IO uint8_t EOF00 : 1;
1453 __IO uint8_t EOF01 : 1;
1454 __IO uint8_t EOF02 : 1;
1455 __IO uint8_t EOF03 : 1;
1456 __IO uint8_t EOF04 : 1;
1457 __IO uint8_t EOF05 : 1;
1458 __IO uint8_t EOF06 : 1;
1459 __IO uint8_t EOF07 : 1;
1460 } stc_usbn_heof0_field_t;
1462 typedef struct stc_usbn_heof1_field
1464 __IO uint8_t EOF10 : 1;
1465 __IO uint8_t EOF11 : 1;
1466 __IO uint8_t EOF12 : 1;
1467 __IO uint8_t EOF13 : 1;
1468 __IO uint8_t EOF14 : 1;
1469 __IO uint8_t EOF15 : 1;
1470 } stc_usbn_heof1_field_t;
1472 typedef struct stc_usbn_hframe_field
1474 __IO uint16_t FRAME0 : 1;
1475 __IO uint16_t FRAME1 : 1;
1476 __IO uint16_t FRAME2 : 1;
1477 __IO uint16_t FRAME3 : 1;
1478 __IO uint16_t FRAME4 : 1;
1479 __IO uint16_t FRAME5 : 1;
1480 __IO uint16_t FRAME6 : 1;
1481 __IO uint16_t FRAME7 : 1;
1482 __IO uint16_t FRAME8 : 1;
1483 __IO uint16_t FRAME9 : 1;
1484 __IO uint16_t FRAME10 : 1;
1485 } stc_usbn_hframe_field_t;
1487 typedef struct stc_usbn_hframe0_field
1489 __IO uint8_t FRAME00 : 1;
1490 __IO uint8_t FRAME01 : 1;
1491 __IO uint8_t FRAME02 : 1;
1492 __IO uint8_t FRAME03 : 1;
1493 __IO uint8_t FRAME04 : 1;
1494 __IO uint8_t FRAME05 : 1;
1495 __IO uint8_t FRAME06 : 1;
1496 __IO uint8_t FRAME07 : 1;
1497 } stc_usbn_hframe0_field_t;
1499 typedef struct stc_usbn_hframe1_field
1501 __IO uint8_t FRAME10 : 1;
1502 __IO uint8_t FRAME11 : 1;
1503 __IO uint8_t FRAME12 : 1;
1504 __IO uint8_t FRAME13 : 1;
1505 } stc_usbn_hframe1_field_t;
1507 typedef struct stc_usbn_htoken_field
1509 __IO uint8_t ENDPT0 : 1;
1510 __IO uint8_t ENDPT1 : 1;
1511 __IO uint8_t ENDPT2 : 1;
1512 __IO uint8_t ENDPT3 : 1;
1513 __IO uint8_t TKNEN0 : 1;
1514 __IO uint8_t TKNEN1 : 1;
1515 __IO uint8_t TKNEN2 : 1;
1516 __IO uint8_t TGGL : 1;
1517 } stc_usbn_htoken_field_t;
1519 typedef struct stc_usbn_udcc_field
1521 __IO uint16_t PWC : 1;
1522 __IO uint16_t RFBK : 1;
1523 uint16_t RESERVED1 : 1;
1524 __IO uint16_t STALCLREN : 1;
1525 __IO uint16_t USTP : 1;
1526 __IO uint16_t HCONX : 1;
1527 __IO uint16_t RESUM : 1;
1528 __IO uint16_t RST : 1;
1529 } stc_usbn_udcc_field_t;
1531 typedef struct stc_usbn_ep0c_field
1533 __IO uint16_t PKS00 : 1;
1534 __IO uint16_t PKS01 : 1;
1535 __IO uint16_t PKS02 : 1;
1536 __IO uint16_t PKS03 : 1;
1537 __IO uint16_t PKS04 : 1;
1538 __IO uint16_t PKS05 : 1;
1539 __IO uint16_t PKS06 : 1;
1540 uint16_t RESERVED1 : 2;
1541 __IO uint16_t STAL : 1;
1542 } stc_usbn_ep0c_field_t;
1544 typedef struct stc_usbn_ep1c_field
1546 __IO uint16_t PKS10 : 1;
1547 __IO uint16_t PKS11 : 1;
1548 __IO uint16_t PKS12 : 1;
1549 __IO uint16_t PKS13 : 1;
1550 __IO uint16_t PKS14 : 1;
1551 __IO uint16_t PKS15 : 1;
1552 __IO uint16_t PKS16 : 1;
1553 __IO uint16_t PKS17 : 1;
1554 __IO uint16_t PKS18 : 1;
1555 __IO uint16_t STAL : 1;
1556 __IO uint16_t NULE : 1;
1557 __IO uint16_t DMAE : 1;
1558 __IO uint16_t DIR : 1;
1559 __IO uint16_t TYPE0 : 1;
1560 __IO uint16_t TYPE1 : 1;
1561 __IO uint16_t EPEN : 1;
1562 } stc_usbn_ep1c_field_t;
1564 typedef struct stc_usbn_ep2c_field
1566 __IO uint16_t PKS20 : 1;
1567 __IO uint16_t PKS21 : 1;
1568 __IO uint16_t PKS22 : 1;
1569 __IO uint16_t PKS23 : 1;
1570 __IO uint16_t PKS24 : 1;
1571 __IO uint16_t PKS25 : 1;
1572 __IO uint16_t PKS26 : 1;
1573 uint16_t RESERVED1 : 2;
1574 __IO uint16_t STAL : 1;
1575 __IO uint16_t NULE : 1;
1576 __IO uint16_t DMAE : 1;
1577 __IO uint16_t DIR : 1;
1578 __IO uint16_t TYPE0 : 1;
1579 __IO uint16_t TYPE1 : 1;
1580 __IO uint16_t EPEN : 1;
1581 } stc_usbn_ep2c_field_t;
1583 typedef struct stc_usbn_ep3c_field
1585 __IO uint16_t PKS30 : 1;
1586 __IO uint16_t PKS31 : 1;
1587 __IO uint16_t PKS32 : 1;
1588 __IO uint16_t PKS33 : 1;
1589 __IO uint16_t PKS34 : 1;
1590 __IO uint16_t PKS35 : 1;
1591 __IO uint16_t PKS36 : 1;
1592 uint16_t RESERVED1 : 2;
1593 __IO uint16_t STAL : 1;
1594 __IO uint16_t NULE : 1;
1595 __IO uint16_t DMAE : 1;
1596 __IO uint16_t DIR : 1;
1597 __IO uint16_t TYPE0 : 1;
1598 __IO uint16_t TYPE1 : 1;
1599 __IO uint16_t EPEN : 1;
1600 } stc_usbn_ep3c_field_t;
1602 typedef struct stc_usbn_ep4c_field
1604 __IO uint16_t PKS40 : 1;
1605 __IO uint16_t PKS41 : 1;
1606 __IO uint16_t PKS42 : 1;
1607 __IO uint16_t PKS43 : 1;
1608 __IO uint16_t PKS44 : 1;
1609 __IO uint16_t PKS45 : 1;
1610 __IO uint16_t PKS46 : 1;
1611 uint16_t RESERVED1 : 2;
1612 __IO uint16_t STAL : 1;
1613 __IO uint16_t NULE : 1;
1614 __IO uint16_t DMAE : 1;
1615 __IO uint16_t DIR : 1;
1616 __IO uint16_t TYPE0 : 1;
1617 __IO uint16_t TYPE1 : 1;
1618 __IO uint16_t EPEN : 1;
1619 } stc_usbn_ep4c_field_t;
1621 typedef struct stc_usbn_ep5c_field
1623 __IO uint16_t PKS50 : 1;
1624 __IO uint16_t PKS51 : 1;
1625 __IO uint16_t PKS52 : 1;
1626 __IO uint16_t PKS53 : 1;
1627 __IO uint16_t PKS54 : 1;
1628 __IO uint16_t PKS55 : 1;
1629 __IO uint16_t PKS56 : 1;
1630 uint16_t RESERVED1 : 2;
1631 __IO uint16_t STAL : 1;
1632 __IO uint16_t NULE : 1;
1633 __IO uint16_t DMAE : 1;
1634 __IO uint16_t DIR : 1;
1635 __IO uint16_t TYPE0 : 1;
1636 __IO uint16_t TYPE1 : 1;
1637 __IO uint16_t EPEN : 1;
1638 } stc_usbn_ep5c_field_t;
1640 typedef struct stc_usbn_tmsp_field
1642 __IO uint16_t TMSP0 : 1;
1643 __IO uint16_t TMSP1 : 1;
1644 __IO uint16_t TMSP2 : 1;
1645 __IO uint16_t TMSP3 : 1;
1646 __IO uint16_t TMSP4 : 1;
1647 __IO uint16_t TMSP5 : 1;
1648 __IO uint16_t TMSP6 : 1;
1649 __IO uint16_t TMSP7 : 1;
1650 __IO uint16_t TMSP8 : 1;
1651 __IO uint16_t TMSP9 : 1;
1652 __IO uint16_t TMSP10 : 1;
1653 } stc_usbn_tmsp_field_t;
1655 typedef struct stc_usbn_udcs_field
1657 __IO uint8_t CONF : 1;
1658 __IO uint8_t SETP : 1;
1659 __IO uint8_t WKUP : 1;
1660 __IO uint8_t BRST : 1;
1661 __IO uint8_t SOF : 1;
1662 __IO uint8_t SUSP : 1;
1663 } stc_usbn_udcs_field_t;
1665 typedef struct stc_usbn_udcie_field
1667 __IO uint8_t CONFIE : 1;
1668 __IO uint8_t CONFN : 1;
1669 __IO uint8_t WKUPIE : 1;
1670 __IO uint8_t BRSTIE : 1;
1671 __IO uint8_t SOFIE : 1;
1672 __IO uint8_t SUSPIE : 1;
1673 } stc_usbn_udcie_field_t;
1675 typedef struct stc_usbn_ep0is_field
1677 uint16_t RESERVED1 : 10;
1678 __IO uint16_t DRQI : 1;
1679 uint16_t RESERVED2 : 3;
1680 __IO uint16_t DRQIIE : 1;
1681 __IO uint16_t BFINI : 1;
1682 } stc_usbn_ep0is_field_t;
1684 typedef struct stc_usbn_ep0os_field
1686 __IO uint16_t SIZE0 : 1;
1687 __IO uint16_t SIZE1 : 1;
1688 __IO uint16_t SIZE2 : 1;
1689 __IO uint16_t SIZE3 : 1;
1690 __IO uint16_t SIZE4 : 1;
1691 __IO uint16_t SIZE5 : 1;
1692 __IO uint16_t SIZE6 : 1;
1693 uint16_t RESERVED1 : 2;
1694 __IO uint16_t SPK : 1;
1695 __IO uint16_t DRQO : 1;
1696 uint16_t RESERVED2 : 2;
1697 __IO uint16_t SPKIE : 1;
1698 __IO uint16_t DRQOIE : 1;
1699 __IO uint16_t BFINI : 1;
1700 } stc_usbn_ep0os_field_t;
1702 typedef struct stc_usbn_ep1s_field
1704 __IO uint16_t SIZE10 : 1;
1705 __IO uint16_t SIZE11 : 1;
1706 __IO uint16_t SIZE12 : 1;
1707 __IO uint16_t SIZE13 : 1;
1708 __IO uint16_t SIZE14 : 1;
1709 __IO uint16_t SIZE15 : 1;
1710 __IO uint16_t SIZE16 : 1;
1711 __IO uint16_t SIZE17 : 1;
1712 __IO uint16_t SIZE18 : 1;
1713 __IO uint16_t SPK : 1;
1714 __IO uint16_t DRQ : 1;
1715 __IO uint16_t BUSY : 1;
1716 uint16_t RESERVED1 : 1;
1717 __IO uint16_t SPKIE : 1;
1718 __IO uint16_t DRQIE : 1;
1719 __IO uint16_t BFINI : 1;
1720 } stc_usbn_ep1s_field_t;
1722 typedef struct stc_usbn_ep2s_field
1724 __IO uint16_t SIZE20 : 1;
1725 __IO uint16_t SIZE21 : 1;
1726 __IO uint16_t SIZE22 : 1;
1727 __IO uint16_t SIZE23 : 1;
1728 __IO uint16_t SIZE24 : 1;
1729 __IO uint16_t SIZE25 : 1;
1730 __IO uint16_t SIZE26 : 1;
1731 uint16_t RESERVED1 : 2;
1732 __IO uint16_t SPK : 1;
1733 __IO uint16_t DRQ : 1;
1734 __IO uint16_t BUSY : 1;
1735 uint16_t RESERVED2 : 1;
1736 __IO uint16_t SPKIE : 1;
1737 __IO uint16_t DRQIE : 1;
1738 __IO uint16_t BFINI : 1;
1739 } stc_usbn_ep2s_field_t;
1741 typedef struct stc_usbn_ep4s_field
1743 __IO uint16_t SIZE40 : 1;
1744 __IO uint16_t SIZE41 : 1;
1745 __IO uint16_t SIZE42 : 1;
1746 __IO uint16_t SIZE43 : 1;
1747 __IO uint16_t SIZE44 : 1;
1748 __IO uint16_t SIZE45 : 1;
1749 __IO uint16_t SIZE46 : 1;
1750 uint16_t RESERVED1 : 2;
1751 __IO uint16_t SPK : 1;
1752 __IO uint16_t DRQ : 1;
1753 __IO uint16_t BUSY : 1;
1754 uint16_t RESERVED2 : 1;
1755 __IO uint16_t SPKIE : 1;
1756 __IO uint16_t DRQIE : 1;
1757 __IO uint16_t BFINI : 1;
1758 } stc_usbn_ep4s_field_t;
1760 typedef struct stc_usbn_ep5s_field
1762 __IO uint16_t SIZE50 : 1;
1763 __IO uint16_t SIZE51 : 1;
1764 __IO uint16_t SIZE52 : 1;
1765 __IO uint16_t SIZE53 : 1;
1766 __IO uint16_t SIZE54 : 1;
1767 __IO uint16_t SIZE55 : 1;
1768 __IO uint16_t SIZE56 : 1;
1769 uint16_t RESERVED1 : 2;
1770 __IO uint16_t SPK : 1;
1771 __IO uint16_t DRQ : 1;
1772 __IO uint16_t BUSY : 1;
1773 uint16_t RESERVED2 : 1;
1774 __IO uint16_t SPKIE : 1;
1775 __IO uint16_t DRQIE : 1;
1776 __IO uint16_t BFINI : 1;
1777 } stc_usbn_ep5s_field_t;
1780 typedef struct stc_usbn_epns_field
1782 __IO uint16_t SIZE : 8;
1783 __IO uint16_t SPK : 1;
1784 __IO uint16_t DRQ : 1;
1785 __IO uint16_t BUSY : 1;
1786 uint16_t RESERVED1 : 1;
1787 __IO uint16_t SPKIE : 1;
1788 __IO uint16_t DRQIE : 1;
1789 __IO uint16_t BFINI : 1;
1790 } stc_usbn_epns_field_t;
1792 typedef struct stc_usbn_epns
1796 stc_usbn_epns_field_t EPNS_f;
1798 uint8_t RESERVED[2];
1801 typedef struct stc_usbn_epnc_field
1803 __IO uint16_t PKS : 9;
1804 __IO uint16_t STAL : 1;
1805 __IO uint16_t NULE : 1;
1806 __IO uint16_t DMAE : 1;
1807 __IO uint16_t DIR : 1;
1808 __IO uint16_t TYPE0 : 1;
1809 __IO uint16_t TYPE1 : 1;
1810 __IO uint16_t EPEN : 1;
1811 } stc_usbn_epnc_field_t;
1813 typedef struct stc_usbn_epnc
1817 stc_usbn_epnc_field_t EPNC_f;
1819 uint8_t RESERVED[2];
1823 typedef struct stc_usbn_epdt
1826 __IO uint16_t EPNDT;
1828 __IO uint8_t EPNDTL;
1829 __IO uint8_t EPNDTH;
1832 uint8_t RESERVED[2];
1839 typedef struct stc_usbn
1844 stc_usbn_hcnt_field_t HCNT_f;
1849 stc_usbn_hcnt0_field_t HCNT0_f;
1853 stc_usbn_hcnt1_field_t HCNT1_f;
1857 uint8_t RESERVED0[2];
1860 stc_usbn_hirq_field_t HIRQ_f;
1864 stc_usbn_herr_field_t HERR_f;
1866 uint8_t RESERVED1[2];
1868 __IO uint8_t HSTATE;
1869 stc_usbn_hstate_field_t HSTATE_f;
1872 __IO uint8_t HFCOMP;
1873 stc_usbn_hfcomp_field_t HFCOMP_f;
1875 uint8_t RESERVED2[2];
1878 __IO uint16_t HRTIMER;
1879 stc_usbn_hrtimer_field_t HRTIMER_f;
1883 __IO uint8_t HRTIMER0;
1884 stc_usbn_hrtimer0_field_t HRTIMER0_f;
1887 __IO uint8_t HRTIMER1;
1888 stc_usbn_hrtimer1_field_t HRTIMER1_f;
1892 uint8_t RESERVED3[2];
1894 __IO uint8_t HRTIMER2;
1895 stc_usbn_hrtimer2_field_t HRTIMER2_f;
1899 stc_usbn_hadr_field_t HADR_f;
1901 uint8_t RESERVED4[2];
1905 stc_usbn_heof_field_t HEOF_f;
1910 stc_usbn_heof0_field_t HEOF0_f;
1914 stc_usbn_heof1_field_t HEOF1_f;
1918 uint8_t RESERVED5[2];
1921 __IO uint16_t HFRAME;
1922 stc_usbn_hframe_field_t HFRAME_f;
1926 __IO uint8_t HFRAME0;
1927 stc_usbn_hframe0_field_t HFRAME0_f;
1930 __IO uint8_t HFRAME1;
1931 stc_usbn_hframe1_field_t HFRAME1_f;
1935 uint8_t RESERVED6[2];
1937 __IO uint8_t HTOKEN;
1938 stc_usbn_htoken_field_t HTOKEN_f;
1940 uint8_t RESERVED7[3];
1943 stc_usbn_udcc_field_t UDCC_f;
1945 uint8_t RESERVED8[2];
1948 stc_usbn_ep0c_field_t EP0C_f;
1950 uint8_t RESERVED9[2];
1953 stc_usbn_ep1c_field_t EP1C_f;
1955 uint8_t RESERVED10[2];
1958 stc_usbn_ep2c_field_t EP2C_f;
1960 uint8_t RESERVED11[2];
1963 stc_usbn_ep3c_field_t EP3C_f;
1965 uint8_t RESERVED12[2];
1968 stc_usbn_ep4c_field_t EP4C_f;
1970 uint8_t RESERVED13[2];
1973 stc_usbn_ep5c_field_t EP5C_f;
1975 uint8_t RESERVED14[2];
1978 stc_usbn_tmsp_field_t TMSP_f;
1980 uint8_t RESERVED15[2];
1983 stc_usbn_udcs_field_t UDCS_f;
1987 stc_usbn_udcie_field_t UDCIE_f;
1989 uint8_t RESERVED16[2];
1991 __IO uint16_t EP0IS;
1992 stc_usbn_ep0is_field_t EP0IS_f;
1994 uint8_t RESERVED17[2];
1996 __IO uint16_t EP0OS;
1997 stc_usbn_ep0os_field_t EP0OS_f;
1999 uint8_t RESERVED18[2];
2002 stc_usbn_ep1s_field_t EP1S_f;
2004 uint8_t RESERVED19[2];
2007 stc_usbn_ep2s_field_t EP2S_f;
2009 uint8_t RESERVED20[2];
2011 uint8_t RESERVED21[2];
2014 stc_usbn_ep4s_field_t EP4S_f;
2016 uint8_t RESERVED22[2];
2019 stc_usbn_ep5s_field_t EP5S_f;
2021 uint8_t RESERVED23[2];
2023 __IO uint16_t EP0DT;
2025 __IO uint8_t EP0DTL;
2026 __IO uint8_t EP0DTH;
2029 uint8_t RESERVED24[2];
2031 __IO uint16_t EP1DT;
2033 __IO uint8_t EP1DTL;
2034 __IO uint8_t EP1DTH;
2037 uint8_t RESERVED25[2];
2039 __IO uint16_t EP2DT;
2041 __IO uint8_t EP2DTL;
2042 __IO uint8_t EP2DTH;
2045 uint8_t RESERVED26[2];
2047 __IO uint16_t EP3DT;
2049 __IO uint8_t EP3DTL;
2050 __IO uint8_t EP3DTH;
2053 uint8_t RESERVED27[2];
2055 __IO uint16_t EP4DT;
2057 __IO uint8_t EP4DTL;
2058 __IO uint8_t EP4DTH;
2061 uint8_t RESERVED28[2];
2063 __IO uint16_t EP5DT;
2065 __IO uint8_t EP5DTL;
2066 __IO uint8_t EP5DTH;
2402 #if (FM_PERIPHERAL_ENABLE_USB0 == ON)
2406 #if (FM_PERIPHERAL_ENABLE_USB1 == ON)
2415 #if USB_USES_DMA_0 == ON
2416 UsbDmaInstanceIndex0,
2418 #if USB_USES_DMA_1 == ON
2419 UsbDmaInstanceIndex1,
2421 #if USB_USES_DMA_2 == ON
2422 UsbDmaInstanceIndex2,
2424 #if USB_USES_DMA_3 == ON
2425 UsbDmaInstanceIndex3,
2427 #if USB_USES_DMA_4 == ON
2428 UsbDmaInstanceIndex4,
2430 #if USB_USES_DMA_5 == ON
2431 UsbDmaInstanceIndex5,
2433 #if USB_USES_DMA_6 == ON
2434 UsbDmaInstanceIndex6,
2436 #if USB_USES_DMA_7 == ON
2437 UsbDmaInstanceIndex7,
2474 #if (FM_PERIPHERAL_USB_DEVICE_ENABLED == ON)
2476 uint8_t* pu8DeviceDescriptor;
2477 uint8_t* pu8ConfigDescriptor;
2559 #if (FM_PERIPHERAL_USB_DEVICE_ENABLED == ON)
2560 uint8_t* pu8DeviceDescriptor;
2561 uint8_t* pu8ConfigDescriptor;
2583 #if USB_USES_DMA == ON
2590 typedef struct stc_usb_dma
2595 __IO uint32_t* pstcDMACA;
2596 __IO uint32_t* pstcDMACB;
2597 __IO uint32_t* pstcDMACSA;
2598 __IO uint32_t* pstcDMACDA;
2610 #if (USB_ENABLED == ON)
2644 void Usb_RemoveTimeOut(stc_usbn_t* pstcUsb,
void (* Handler)(stc_usbn_t* pstcUsb));
2648 #if USB_USES_DMA == ON
2652 #if (FM_PERIPHERAL_USB_DEVICE_ENABLED == ON)