2 #if (USE_STM32_USB_HOST_MODE || USE_STM32_USB_USE_DEVICE_MODE || USE_STM32_USB_OTG_MODE)
31 #ifndef __USB_OTG_REGS_H__
32 #define __USB_OTG_REGS_H__
35 #include "config/usb_conf.h"
52 #define USB_OTG_HS_BASE_ADDR 0x40040000
53 #define USB_OTG_FS_BASE_ADDR 0x50000000
55 #define USB_OTG_CORE_GLOBAL_REGS_OFFSET 0x000
56 #define USB_OTG_DEV_GLOBAL_REG_OFFSET 0x800
57 #define USB_OTG_DEV_IN_EP_REG_OFFSET 0x900
58 #define USB_OTG_EP_REG_OFFSET 0x20
59 #define USB_OTG_DEV_OUT_EP_REG_OFFSET 0xB00
60 #define USB_OTG_HOST_GLOBAL_REG_OFFSET 0x400
61 #define USB_OTG_HOST_PORT_REGS_OFFSET 0x440
62 #define USB_OTG_HOST_CHAN_REGS_OFFSET 0x500
63 #define USB_OTG_CHAN_REGS_OFFSET 0x20
64 #define USB_OTG_PCGCCTL_OFFSET 0xE00
65 #define USB_OTG_DATA_FIFO_OFFSET 0x1000
66 #define USB_OTG_DATA_FIFO_SIZE 0x1000
69 #define USB_OTG_MAX_TX_FIFOS 15
71 #define USB_OTG_HS_MAX_PACKET_SIZE 512
72 #define USB_OTG_FS_MAX_PACKET_SIZE 64
73 #define USB_OTG_MAX_EP0_SIZE 64
85 typedef struct _USB_OTG_GREGS
87 __IO uint32_t GOTGCTL;
88 __IO uint32_t GOTGINT;
89 __IO uint32_t GAHBCFG;
90 __IO uint32_t GUSBCFG;
91 __IO uint32_t GRSTCTL;
92 __IO uint32_t GINTSTS;
93 __IO uint32_t GINTMSK;
94 __IO uint32_t GRXSTSR;
95 __IO uint32_t GRXSTSP;
96 __IO uint32_t GRXFSIZ;
97 __IO uint32_t DIEPTXF0_HNPTXFSIZ;
98 __IO uint32_t HNPTXSTS;
99 uint32_t Reserved30[2];
102 uint32_t Reserved40[48];
103 __IO uint32_t HPTXFSIZ;
104 __IO uint32_t DIEPTXF[USB_OTG_MAX_TX_FIFOS];
115 typedef struct _USB_OTG_DREGS
121 __IO uint32_t DIEPMSK;
122 __IO uint32_t DOEPMSK;
124 __IO uint32_t DAINTMSK;
127 __IO uint32_t DVBUSDIS;
128 __IO uint32_t DVBUSPULSE;
129 __IO uint32_t DTHRCTL;
130 __IO uint32_t DIEPEMPMSK;
131 __IO uint32_t DEACHINT;
132 __IO uint32_t DEACHMSK;
134 __IO uint32_t DINEP1MSK;
135 uint32_t Reserved44[15];
136 __IO uint32_t DOUTEP1MSK;
147 typedef struct _USB_OTG_INEPREGS
149 __IO uint32_t DIEPCTL;
151 __IO uint32_t DIEPINT;
153 __IO uint32_t DIEPTSIZ;
154 __IO uint32_t DIEPDMA;
155 __IO uint32_t DTXFSTS;
167 typedef struct _USB_OTG_OUTEPREGS
169 __IO uint32_t DOEPCTL;
171 __IO uint32_t DOEPINT;
173 __IO uint32_t DOEPTSIZ;
174 __IO uint32_t DOEPDMA;
175 uint32_t Reserved18[2];
186 typedef struct _USB_OTG_HREGS
191 uint32_t Reserved40C;
192 __IO uint32_t HPTXSTS;
194 __IO uint32_t HAINTMSK;
205 typedef struct _USB_OTG_HC_REGS
207 __IO uint32_t HCCHAR;
208 __IO uint32_t HCSPLT;
210 __IO uint32_t HCINTMSK;
211 __IO uint32_t HCTSIZ;
213 uint32_t Reserved[2];
224 typedef struct USB_OTG_core_regs
226 USB_OTG_GREGS *GREGS;
227 USB_OTG_DREGS *DREGS;
228 USB_OTG_HREGS *HREGS;
229 USB_OTG_INEPREGS *INEP_REGS[USB_OTG_MAX_TX_FIFOS];
230 USB_OTG_OUTEPREGS *OUTEP_REGS[USB_OTG_MAX_TX_FIFOS];
231 USB_OTG_HC_REGS *HC_REGS[USB_OTG_MAX_TX_FIFOS];
232 __IO uint32_t *HPRT0;
233 __IO uint32_t *DFIFO[USB_OTG_MAX_TX_FIFOS];
234 __IO uint32_t *PCGCCTL;
236 USB_OTG_CORE_REGS , *PUSB_OTG_CORE_REGS;
237 typedef union _USB_OTG_GOTGCTL_TypeDef
246 uint32_t Reserved2_7 :
252 uint32_t hstsethnpen :
256 uint32_t Reserved12_15 :
266 uint32_t Reserved20_31 :
270 } USB_OTG_GOTGCTL_TypeDef ;
272 typedef union _USB_OTG_GOTGINT_TypeDef
277 uint32_t Reserved0_1 :
281 uint32_t Reserved3_7 :
283 uint32_t sesreqsucstschng :
285 uint32_t hstnegsucstschng :
287 uint32_t reserver10_16 :
291 uint32_t adevtoutchng :
295 uint32_t Reserved31_20 :
299 } USB_OTG_GOTGINT_TypeDef ;
300 typedef union _USB_OTG_GAHBCFG_TypeDef
305 uint32_t glblintrmsk :
313 uint32_t nptxfemplvl_txfemplvl :
315 uint32_t ptxfemplvl :
317 uint32_t Reserved9_31 :
321 } USB_OTG_GAHBCFG_TypeDef ;
322 typedef union _USB_OTG_GUSBCFG_TypeDef
329 uint32_t Reserved3_5 :
341 uint32_t Reserved14 :
343 uint32_t phylpwrclksel :
345 uint32_t Reserved16 :
349 uint32_t ulpi_auto_res :
351 uint32_t ulpi_clk_sus_m :
353 uint32_t ulpi_ext_vbus_drv :
355 uint32_t ulpi_int_vbus_ind :
357 uint32_t term_sel_dl_pulse :
359 uint32_t ulpi_ind_cpl :
361 uint32_t ulpi_passthrough :
363 uint32_t ulpi_protect_disable :
365 uint32_t Reserved26_28 :
367 uint32_t force_host :
371 uint32_t corrupt_tx :
375 } USB_OTG_GUSBCFG_TypeDef ;
376 typedef union _USB_OTG_GRSTCTL_TypeDef
395 uint32_t Reserved11_29 :
403 } USB_OTG_GRSTCTL_TypeDef ;
404 typedef union _USB_OTG_GINTMSK_TypeDef
411 uint32_t modemismatch :
419 uint32_t nptxfempty :
423 uint32_t goutnakeff :
425 uint32_t Reserved8_9 :
427 uint32_t erlysuspend :
429 uint32_t usbsuspend :
435 uint32_t isooutdrop :
439 uint32_t Reserved16 :
441 uint32_t epmismatch :
447 uint32_t incomplisoin :
449 uint32_t incomplisoout :
451 uint32_t Reserved22_23 :
459 uint32_t Reserved27 :
461 uint32_t conidstschng :
463 uint32_t disconnect :
465 uint32_t sessreqintr :
471 } USB_OTG_GINTMSK_TypeDef ;
472 typedef union _USB_OTG_GINTSTS_TypeDef
479 uint32_t modemismatch :
487 uint32_t nptxfempty :
491 uint32_t goutnakeff :
493 uint32_t Reserved8_9 :
495 uint32_t erlysuspend :
497 uint32_t usbsuspend :
503 uint32_t isooutdrop :
507 uint32_t Reserved16_17 :
513 uint32_t incomplisoin :
515 uint32_t incomplisoout :
517 uint32_t Reserved22_23 :
525 uint32_t Reserved27 :
527 uint32_t conidstschng :
529 uint32_t disconnect :
531 uint32_t sessreqintr :
537 } USB_OTG_GINTSTS_TypeDef ;
538 typedef union _USB_OTG_DRXSTS_TypeDef
557 } USB_OTG_DRXSTS_TypeDef ;
558 typedef union _USB_OTG_GRXSTS_TypeDef
575 } USB_OTG_GRXFSTS_TypeDef ;
576 typedef union _USB_OTG_FSIZ_TypeDef
587 } USB_OTG_FSIZ_TypeDef ;
588 typedef union _USB_OTG_HNPTXSTS_TypeDef
593 uint32_t nptxfspcavail :
595 uint32_t nptxqspcavail :
610 } USB_OTG_HNPTXSTS_TypeDef ;
611 typedef union _USB_OTG_DTXFSTSn_TypeDef
616 uint32_t txfspcavail :
622 } USB_OTG_DTXFSTSn_TypeDef ;
624 typedef union _USB_OTG_GCCFG_TypeDef
629 uint32_t Reserved_in :
633 uint32_t Reserved_17 :
635 uint32_t vbussensingA :
637 uint32_t vbussensingB :
641 uint32_t disablevbussensing :
643 uint32_t Reserved_out :
647 } USB_OTG_GCCFG_TypeDef ;
649 typedef union _USB_OTG_DCFG_TypeDef
656 uint32_t nzstsouthshk :
664 uint32_t Reserved12_31 :
668 } USB_OTG_DCFG_TypeDef ;
669 typedef union _USB_OTG_DCTL_TypeDef
674 uint32_t rmtwkupsig :
678 uint32_t gnpinnaksts :
680 uint32_t goutnaksts :
692 uint32_t poprg_done :
698 } USB_OTG_DCTL_TypeDef ;
699 typedef union _USB_OTG_DSTS_TypeDef
710 uint32_t Reserved4_7:
714 uint32_t Reserved22_31 :
718 } USB_OTG_DSTS_TypeDef ;
719 typedef union _USB_OTG_DIEPINTn_TypeDef
726 uint32_t epdisabled :
732 uint32_t intktxfemp :
736 uint32_t inepnakeff :
740 uint32_t txfifoundrn :
742 uint32_t Reserved14_31 :
746 } USB_OTG_DIEPINTn_TypeDef ;
747 typedef union _USB_OTG_DIEPINTn_TypeDef USB_OTG_DIEPMSK_TypeDef ;
748 typedef union _USB_OTG_DOEPINTn_TypeDef
755 uint32_t epdisabled :
761 uint32_t Reserved04_31 :
765 } USB_OTG_DOEPINTn_TypeDef ;
766 typedef union _USB_OTG_DOEPINTn_TypeDef USB_OTG_DOEPMSK_TypeDef ;
768 typedef union _USB_OTG_DAINT_TypeDef
779 } USB_OTG_DAINT_TypeDef ;
781 typedef union _USB_OTG_DTHRCTL_TypeDef
786 uint32_t non_iso_thr_en :
788 uint32_t iso_thr_en :
790 uint32_t tx_thr_len :
792 uint32_t Reserved11_15 :
796 uint32_t rx_thr_len :
798 uint32_t Reserved26 :
802 uint32_t Reserved28_31 :
806 } USB_OTG_DTHRCTL_TypeDef ;
807 typedef union _USB_OTG_DEPCTL_TypeDef
844 } USB_OTG_DEPCTL_TypeDef ;
845 typedef union _USB_OTG_DEPXFRSIZ_TypeDef
860 } USB_OTG_DEPXFRSIZ_TypeDef ;
861 typedef union _USB_OTG_DEP0XFRSIZ_TypeDef
868 uint32_t Reserved7_18 :
872 uint32_t Reserved20_28 :
879 } USB_OTG_DEP0XFRSIZ_TypeDef ;
880 typedef union _USB_OTG_HCFG_TypeDef
885 uint32_t fslspclksel :
891 } USB_OTG_HCFG_TypeDef ;
892 typedef union _USB_OTG_HFRMINTRVL_TypeDef
903 } USB_OTG_HFRMINTRVL_TypeDef ;
905 typedef union _USB_OTG_HFNUM_TypeDef
916 } USB_OTG_HFNUM_TypeDef ;
917 typedef union _USB_OTG_HPTXSTS_TypeDef
922 uint32_t ptxfspcavail :
924 uint32_t ptxqspcavail :
939 } USB_OTG_HPTXSTS_TypeDef ;
940 typedef union _USB_OTG_HPRT0_TypeDef
945 uint32_t prtconnsts :
947 uint32_t prtconndet :
953 uint32_t prtovrcurract :
955 uint32_t prtovrcurrchng :
973 uint32_t Reserved19_31 :
977 } USB_OTG_HPRT0_TypeDef ;
978 typedef union _USB_OTG_HAINT_TypeDef
989 } USB_OTG_HAINT_TypeDef ;
990 typedef union _USB_OTG_HAINTMSK_TypeDef
1001 } USB_OTG_HAINTMSK_TypeDef ;
1002 typedef union _USB_OTG_HCCHAR_TypeDef
1031 } USB_OTG_HCCHAR_TypeDef ;
1032 typedef union _USB_OTG_HCSPLT_TypeDef
1051 } USB_OTG_HCSPLT_TypeDef ;
1052 typedef union _USB_OTG_HCINTn_TypeDef
1057 uint32_t xfercompl :
1077 uint32_t datatglerr :
1083 } USB_OTG_HCINTn_TypeDef ;
1084 typedef union _USB_OTG_HCTSIZn_TypeDef
1099 } USB_OTG_HCTSIZn_TypeDef ;
1100 typedef union _USB_OTG_HCINTMSK_TypeDef
1105 uint32_t xfercompl :
1125 uint32_t datatglerr :
1131 } USB_OTG_HCINTMSK_TypeDef ;
1133 typedef union _USB_OTG_PCGCCTL_TypeDef
1142 uint32_t Reserved2_3 :
1146 uint32_t Reserved5_31 :
1150 } USB_OTG_PCGCCTL_TypeDef ;
1179 #endif //__USB_OTG_REGS_H__
static struct audio_setup_t setup
libheivs configuration file