ARMEBS4  revision-26.06.2015
usb_regs.h
1 #include "heivs/config.h"
2 #if (USE_STM32_USB_HOST_MODE || USE_STM32_USB_USE_DEVICE_MODE || USE_STM32_USB_OTG_MODE)
3 /**
4  ******************************************************************************
5  * @file usb_regs.h
6  * @author MCD Application Team
7  * @version V2.1.0
8  * @date 19-March-2012
9  * @brief hardware registers
10  ******************************************************************************
11  * @attention
12  *
13  * <h2><center>&copy; COPYRIGHT 2012 STMicroelectronics</center></h2>
14  *
15  * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
16  * You may not use this file except in compliance with the License.
17  * You may obtain a copy of the License at:
18  *
19  * http://www.st.com/software_license_agreement_liberty_v2
20  *
21  * Unless required by applicable law or agreed to in writing, software
22  * distributed under the License is distributed on an "AS IS" BASIS,
23  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
24  * See the License for the specific language governing permissions and
25  * limitations under the License.
26  *
27  ******************************************************************************
28  */
29 
30 /* Define to prevent recursive inclusion -------------------------------------*/
31 #ifndef __USB_OTG_REGS_H__
32 #define __USB_OTG_REGS_H__
33 
34 /* Includes ------------------------------------------------------------------*/
35 #include "config/usb_conf.h"
36 
37 
38 /** @addtogroup USB_OTG_DRIVER
39  * @{
40  */
41 
42 /** @defgroup USB_REGS
43  * @brief This file is the
44  * @{
45  */
46 
47 
48 /** @defgroup USB_REGS_Exported_Defines
49  * @{
50  */
51 
52 #define USB_OTG_HS_BASE_ADDR 0x40040000
53 #define USB_OTG_FS_BASE_ADDR 0x50000000
54 
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
67 
68 
69 #define USB_OTG_MAX_TX_FIFOS 15
70 
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
74 /**
75  * @}
76  */
77 
78 /** @defgroup USB_REGS_Exported_Types
79  * @{
80  */
81 
82 /** @defgroup __USB_OTG_Core_register
83  * @{
84  */
85 typedef struct _USB_OTG_GREGS //000h
86 {
87  __IO uint32_t GOTGCTL; /* USB_OTG Control and Status Register 000h*/
88  __IO uint32_t GOTGINT; /* USB_OTG Interrupt Register 004h*/
89  __IO uint32_t GAHBCFG; /* Core AHB Configuration Register 008h*/
90  __IO uint32_t GUSBCFG; /* Core USB Configuration Register 00Ch*/
91  __IO uint32_t GRSTCTL; /* Core Reset Register 010h*/
92  __IO uint32_t GINTSTS; /* Core Interrupt Register 014h*/
93  __IO uint32_t GINTMSK; /* Core Interrupt Mask Register 018h*/
94  __IO uint32_t GRXSTSR; /* Receive Sts Q Read Register 01Ch*/
95  __IO uint32_t GRXSTSP; /* Receive Sts Q Read & POP Register 020h*/
96  __IO uint32_t GRXFSIZ; /* Receive FIFO Size Register 024h*/
97  __IO uint32_t DIEPTXF0_HNPTXFSIZ; /* EP0 / Non Periodic Tx FIFO Size Register 028h*/
98  __IO uint32_t HNPTXSTS; /* Non Periodic Tx FIFO/Queue Sts reg 02Ch*/
99  uint32_t Reserved30[2]; /* Reserved 030h*/
100  __IO uint32_t GCCFG; /* General Purpose IO Register 038h*/
101  __IO uint32_t CID; /* User ID Register 03Ch*/
102  uint32_t Reserved40[48]; /* Reserved 040h-0FFh*/
103  __IO uint32_t HPTXFSIZ; /* Host Periodic Tx FIFO Size Reg 100h*/
104  __IO uint32_t DIEPTXF[USB_OTG_MAX_TX_FIFOS];/* dev Periodic Transmit FIFO */
105 }
106 USB_OTG_GREGS;
107 /**
108  * @}
109  */
110 
111 
112 /** @defgroup __device_Registers
113  * @{
114  */
115 typedef struct _USB_OTG_DREGS // 800h
116 {
117  __IO uint32_t DCFG; /* dev Configuration Register 800h*/
118  __IO uint32_t DCTL; /* dev Control Register 804h*/
119  __IO uint32_t DSTS; /* dev Status Register (RO) 808h*/
120  uint32_t Reserved0C; /* Reserved 80Ch*/
121  __IO uint32_t DIEPMSK; /* dev IN Endpoint Mask 810h*/
122  __IO uint32_t DOEPMSK; /* dev OUT Endpoint Mask 814h*/
123  __IO uint32_t DAINT; /* dev All Endpoints Itr Reg 818h*/
124  __IO uint32_t DAINTMSK; /* dev All Endpoints Itr Mask 81Ch*/
125  uint32_t Reserved20; /* Reserved 820h*/
126  uint32_t Reserved9; /* Reserved 824h*/
127  __IO uint32_t DVBUSDIS; /* dev VBUS discharge Register 828h*/
128  __IO uint32_t DVBUSPULSE; /* dev VBUS Pulse Register 82Ch*/
129  __IO uint32_t DTHRCTL; /* dev thr 830h*/
130  __IO uint32_t DIEPEMPMSK; /* dev empty msk 834h*/
131  __IO uint32_t DEACHINT; /* dedicated EP interrupt 838h*/
132  __IO uint32_t DEACHMSK; /* dedicated EP msk 83Ch*/
133  uint32_t Reserved40; /* dedicated EP mask 840h*/
134  __IO uint32_t DINEP1MSK; /* dedicated EP mask 844h*/
135  uint32_t Reserved44[15]; /* Reserved 844-87Ch*/
136  __IO uint32_t DOUTEP1MSK; /* dedicated EP msk 884h*/
137 }
138 USB_OTG_DREGS;
139 /**
140  * @}
141  */
142 
143 
144 /** @defgroup __IN_Endpoint-Specific_Register
145  * @{
146  */
147 typedef struct _USB_OTG_INEPREGS
148 {
149  __IO uint32_t DIEPCTL; /* dev IN Endpoint Control Reg 900h + (ep_num * 20h) + 00h*/
150  uint32_t Reserved04; /* Reserved 900h + (ep_num * 20h) + 04h*/
151  __IO uint32_t DIEPINT; /* dev IN Endpoint Itr Reg 900h + (ep_num * 20h) + 08h*/
152  uint32_t Reserved0C; /* Reserved 900h + (ep_num * 20h) + 0Ch*/
153  __IO uint32_t DIEPTSIZ; /* IN Endpoint Txfer Size 900h + (ep_num * 20h) + 10h*/
154  __IO uint32_t DIEPDMA; /* IN Endpoint DMA Address Reg 900h + (ep_num * 20h) + 14h*/
155  __IO uint32_t DTXFSTS;/*IN Endpoint Tx FIFO Status Reg 900h + (ep_num * 20h) + 18h*/
156  uint32_t Reserved18; /* Reserved 900h+(ep_num*20h)+1Ch-900h+ (ep_num * 20h) + 1Ch*/
157 }
158 USB_OTG_INEPREGS;
159 /**
160  * @}
161  */
162 
163 
164 /** @defgroup __OUT_Endpoint-Specific_Registers
165  * @{
166  */
167 typedef struct _USB_OTG_OUTEPREGS
168 {
169  __IO uint32_t DOEPCTL; /* dev OUT Endpoint Control Reg B00h + (ep_num * 20h) + 00h*/
170  uint32_t Reserved04; /* Reserved B00h + (ep_num * 20h) + 04h*/
171  __IO uint32_t DOEPINT; /* dev OUT Endpoint Itr Reg B00h + (ep_num * 20h) + 08h*/
172  uint32_t Reserved0C; /* Reserved B00h + (ep_num * 20h) + 0Ch*/
173  __IO uint32_t DOEPTSIZ; /* dev OUT Endpoint Txfer Size B00h + (ep_num * 20h) + 10h*/
174  __IO uint32_t DOEPDMA; /* dev OUT Endpoint DMA Address B00h + (ep_num * 20h) + 14h*/
175  uint32_t Reserved18[2]; /* Reserved B00h + (ep_num * 20h) + 18h - B00h + (ep_num * 20h) + 1Ch*/
176 }
177 USB_OTG_OUTEPREGS;
178 /**
179  * @}
180  */
181 
182 
183 /** @defgroup __Host_Mode_Register_Structures
184  * @{
185  */
186 typedef struct _USB_OTG_HREGS
187 {
188  __IO uint32_t HCFG; /* Host Configuration Register 400h*/
189  __IO uint32_t HFIR; /* Host Frame Interval Register 404h*/
190  __IO uint32_t HFNUM; /* Host Frame Nbr/Frame Remaining 408h*/
191  uint32_t Reserved40C; /* Reserved 40Ch*/
192  __IO uint32_t HPTXSTS; /* Host Periodic Tx FIFO/ Queue Status 410h*/
193  __IO uint32_t HAINT; /* Host All Channels Interrupt Register 414h*/
194  __IO uint32_t HAINTMSK; /* Host All Channels Interrupt Mask 418h*/
195 }
196 USB_OTG_HREGS;
197 /**
198  * @}
199  */
200 
201 
202 /** @defgroup __Host_Channel_Specific_Registers
203  * @{
204  */
205 typedef struct _USB_OTG_HC_REGS
206 {
207  __IO uint32_t HCCHAR;
208  __IO uint32_t HCSPLT;
209  __IO uint32_t HCINT;
210  __IO uint32_t HCINTMSK;
211  __IO uint32_t HCTSIZ;
212  __IO uint32_t HCDMA;
213  uint32_t Reserved[2];
214 }
215 USB_OTG_HC_REGS;
216 /**
217  * @}
218  */
219 
220 
221 /** @defgroup __otg_Core_registers
222  * @{
223  */
224 typedef struct USB_OTG_core_regs //000h
225 {
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;
235 }
236 USB_OTG_CORE_REGS , *PUSB_OTG_CORE_REGS;
237 typedef union _USB_OTG_GOTGCTL_TypeDef
238 {
239  uint32_t d32;
240  struct
241  {
242 uint32_t sesreqscs :
243  1;
244 uint32_t sesreq :
245  1;
246 uint32_t Reserved2_7 :
247  6;
248 uint32_t hstnegscs :
249  1;
250 uint32_t hnpreq :
251  1;
252 uint32_t hstsethnpen :
253  1;
254 uint32_t devhnpen :
255  1;
256 uint32_t Reserved12_15 :
257  4;
258 uint32_t conidsts :
259  1;
260 uint32_t dbct :
261  1;
262 uint32_t asesvld :
263  1;
264 uint32_t bsesvld :
265  1;
266 uint32_t Reserved20_31 :
267  12;
268  }
269  b;
270 } USB_OTG_GOTGCTL_TypeDef ;
271 
272 typedef union _USB_OTG_GOTGINT_TypeDef
273 {
274  uint32_t d32;
275  struct
276  {
277 uint32_t Reserved0_1 :
278  2;
279 uint32_t sesenddet :
280  1;
281 uint32_t Reserved3_7 :
282  5;
283 uint32_t sesreqsucstschng :
284  1;
285 uint32_t hstnegsucstschng :
286  1;
287 uint32_t reserver10_16 :
288  7;
289 uint32_t hstnegdet :
290  1;
291 uint32_t adevtoutchng :
292  1;
293 uint32_t debdone :
294  1;
295 uint32_t Reserved31_20 :
296  12;
297  }
298  b;
299 } USB_OTG_GOTGINT_TypeDef ;
300 typedef union _USB_OTG_GAHBCFG_TypeDef
301 {
302  uint32_t d32;
303  struct
304  {
305 uint32_t glblintrmsk :
306  1;
307 uint32_t hburstlen :
308  4;
309 uint32_t dmaenable :
310  1;
311 uint32_t Reserved :
312  1;
313 uint32_t nptxfemplvl_txfemplvl :
314  1;
315 uint32_t ptxfemplvl :
316  1;
317 uint32_t Reserved9_31 :
318  23;
319  }
320  b;
321 } USB_OTG_GAHBCFG_TypeDef ;
322 typedef union _USB_OTG_GUSBCFG_TypeDef
323 {
324  uint32_t d32;
325  struct
326  {
327 uint32_t toutcal :
328  3;
329 uint32_t Reserved3_5 :
330  3;
331 uint32_t physel :
332  1;
333 uint32_t Reserved7 :
334  1;
335 uint32_t srpcap :
336  1;
337 uint32_t hnpcap :
338  1;
339 uint32_t usbtrdtim :
340  4;
341 uint32_t Reserved14 :
342  1;
343 uint32_t phylpwrclksel :
344  1;
345 uint32_t Reserved16 :
346  1;
347 uint32_t ulpi_fsls :
348  1;
349 uint32_t ulpi_auto_res :
350  1;
351 uint32_t ulpi_clk_sus_m :
352  1;
353 uint32_t ulpi_ext_vbus_drv :
354  1;
355 uint32_t ulpi_int_vbus_ind :
356  1;
357 uint32_t term_sel_dl_pulse :
358  1;
359 uint32_t ulpi_ind_cpl :
360  1;
361 uint32_t ulpi_passthrough :
362  1;
363 uint32_t ulpi_protect_disable :
364  1;
365 uint32_t Reserved26_28 :
366  3;
367 uint32_t force_host :
368  1;
369 uint32_t force_dev :
370  1;
371 uint32_t corrupt_tx :
372  1;
373  }
374  b;
375 } USB_OTG_GUSBCFG_TypeDef ;
376 typedef union _USB_OTG_GRSTCTL_TypeDef
377 {
378  uint32_t d32;
379  struct
380  {
381 uint32_t csftrst :
382  1;
383 uint32_t hsftrst :
384  1;
385 uint32_t hstfrm :
386  1;
387 uint32_t Reserved3 :
388  1;
389 uint32_t rxfflsh :
390  1;
391 uint32_t txfflsh :
392  1;
393 uint32_t txfnum :
394  5;
395 uint32_t Reserved11_29 :
396  19;
397 uint32_t dmareq :
398  1;
399 uint32_t ahbidle :
400  1;
401  }
402  b;
403 } USB_OTG_GRSTCTL_TypeDef ;
404 typedef union _USB_OTG_GINTMSK_TypeDef
405 {
406  uint32_t d32;
407  struct
408  {
409 uint32_t Reserved0 :
410  1;
411 uint32_t modemismatch :
412  1;
413 uint32_t otgintr :
414  1;
415 uint32_t sofintr :
416  1;
417 uint32_t rxstsqlvl :
418  1;
419 uint32_t nptxfempty :
420  1;
421 uint32_t ginnakeff :
422  1;
423 uint32_t goutnakeff :
424  1;
425 uint32_t Reserved8_9 :
426  2;
427 uint32_t erlysuspend :
428  1;
429 uint32_t usbsuspend :
430  1;
431 uint32_t usbreset :
432  1;
433 uint32_t enumdone :
434  1;
435 uint32_t isooutdrop :
436  1;
437 uint32_t eopframe :
438  1;
439 uint32_t Reserved16 :
440  1;
441 uint32_t epmismatch :
442  1;
443 uint32_t inepintr :
444  1;
445 uint32_t outepintr :
446  1;
447 uint32_t incomplisoin :
448  1;
449 uint32_t incomplisoout :
450  1;
451 uint32_t Reserved22_23 :
452  2;
453 uint32_t portintr :
454  1;
455 uint32_t hcintr :
456  1;
457 uint32_t ptxfempty :
458  1;
459 uint32_t Reserved27 :
460  1;
461 uint32_t conidstschng :
462  1;
463 uint32_t disconnect :
464  1;
465 uint32_t sessreqintr :
466  1;
467 uint32_t wkupintr :
468  1;
469  }
470  b;
471 } USB_OTG_GINTMSK_TypeDef ;
472 typedef union _USB_OTG_GINTSTS_TypeDef
473 {
474  uint32_t d32;
475  struct
476  {
477 uint32_t curmode :
478  1;
479 uint32_t modemismatch :
480  1;
481 uint32_t otgintr :
482  1;
483 uint32_t sofintr :
484  1;
485 uint32_t rxstsqlvl :
486  1;
487 uint32_t nptxfempty :
488  1;
489 uint32_t ginnakeff :
490  1;
491 uint32_t goutnakeff :
492  1;
493 uint32_t Reserved8_9 :
494  2;
495 uint32_t erlysuspend :
496  1;
497 uint32_t usbsuspend :
498  1;
499 uint32_t usbreset :
500  1;
501 uint32_t enumdone :
502  1;
503 uint32_t isooutdrop :
504  1;
505 uint32_t eopframe :
506  1;
507 uint32_t Reserved16_17 :
508  2;
509 uint32_t inepint:
510  1;
511 uint32_t outepintr :
512  1;
513 uint32_t incomplisoin :
514  1;
515 uint32_t incomplisoout :
516  1;
517 uint32_t Reserved22_23 :
518  2;
519 uint32_t portintr :
520  1;
521 uint32_t hcintr :
522  1;
523 uint32_t ptxfempty :
524  1;
525 uint32_t Reserved27 :
526  1;
527 uint32_t conidstschng :
528  1;
529 uint32_t disconnect :
530  1;
531 uint32_t sessreqintr :
532  1;
533 uint32_t wkupintr :
534  1;
535  }
536  b;
537 } USB_OTG_GINTSTS_TypeDef ;
538 typedef union _USB_OTG_DRXSTS_TypeDef
539 {
540  uint32_t d32;
541  struct
542  {
543 uint32_t epnum :
544  4;
545 uint32_t bcnt :
546  11;
547 uint32_t dpid :
548  2;
549 uint32_t pktsts :
550  4;
551 uint32_t fn :
552  4;
553 uint32_t Reserved :
554  7;
555  }
556  b;
557 } USB_OTG_DRXSTS_TypeDef ;
558 typedef union _USB_OTG_GRXSTS_TypeDef
559 {
560  uint32_t d32;
561  struct
562  {
563 uint32_t chnum :
564  4;
565 uint32_t bcnt :
566  11;
567 uint32_t dpid :
568  2;
569 uint32_t pktsts :
570  4;
571 uint32_t Reserved :
572  11;
573  }
574  b;
575 } USB_OTG_GRXFSTS_TypeDef ;
576 typedef union _USB_OTG_FSIZ_TypeDef
577 {
578  uint32_t d32;
579  struct
580  {
581 uint32_t startaddr :
582  16;
583 uint32_t depth :
584  16;
585  }
586  b;
587 } USB_OTG_FSIZ_TypeDef ;
588 typedef union _USB_OTG_HNPTXSTS_TypeDef
589 {
590  uint32_t d32;
591  struct
592  {
593  uint32_t nptxfspcavail :
594  16;
595  uint32_t nptxqspcavail :
596  8;
597  struct
598  {
599  uint32_t terminate :
600  1;
601  uint32_t token :
602  2;
603  uint32_t chnum :
604  4;
605  } nptxqtop;
606  uint32_t Reserved :
607  1;
608  }
609  b;
610 } USB_OTG_HNPTXSTS_TypeDef ;
611 typedef union _USB_OTG_DTXFSTSn_TypeDef
612 {
613  uint32_t d32;
614  struct
615  {
616 uint32_t txfspcavail :
617  16;
618 uint32_t Reserved :
619  16;
620  }
621  b;
622 } USB_OTG_DTXFSTSn_TypeDef ;
623 
624 typedef union _USB_OTG_GCCFG_TypeDef
625 {
626  uint32_t d32;
627  struct
628  {
629 uint32_t Reserved_in :
630  16;
631 uint32_t pwdn :
632  1;
633 uint32_t Reserved_17 :
634  1;
635 uint32_t vbussensingA :
636  1;
637 uint32_t vbussensingB :
638  1;
639 uint32_t sofouten :
640  1;
641 uint32_t disablevbussensing :
642  1;
643 uint32_t Reserved_out :
644  10;
645  }
646  b;
647 } USB_OTG_GCCFG_TypeDef ;
648 
649 typedef union _USB_OTG_DCFG_TypeDef
650 {
651  uint32_t d32;
652  struct
653  {
654 uint32_t devspd :
655  2;
656 uint32_t nzstsouthshk :
657  1;
658 uint32_t Reserved3 :
659  1;
660 uint32_t devaddr :
661  7;
662 uint32_t perfrint :
663  2;
664 uint32_t Reserved12_31 :
665  19;
666  }
667  b;
668 } USB_OTG_DCFG_TypeDef ;
669 typedef union _USB_OTG_DCTL_TypeDef
670 {
671  uint32_t d32;
672  struct
673  {
674 uint32_t rmtwkupsig :
675  1;
676 uint32_t sftdiscon :
677  1;
678 uint32_t gnpinnaksts :
679  1;
680 uint32_t goutnaksts :
681  1;
682 uint32_t tstctl :
683  3;
684 uint32_t sgnpinnak :
685  1;
686 uint32_t cgnpinnak :
687  1;
688 uint32_t sgoutnak :
689  1;
690 uint32_t cgoutnak :
691  1;
692 uint32_t poprg_done :
693  1;
694 uint32_t Reserved :
695  20;
696  }
697  b;
698 } USB_OTG_DCTL_TypeDef ;
699 typedef union _USB_OTG_DSTS_TypeDef
700 {
701  uint32_t d32;
702  struct
703  {
704 uint32_t suspsts :
705  1;
706 uint32_t enumspd :
707  2;
708 uint32_t errticerr :
709  1;
710 uint32_t Reserved4_7:
711  4;
712 uint32_t soffn :
713  14;
714 uint32_t Reserved22_31 :
715  10;
716  }
717  b;
718 } USB_OTG_DSTS_TypeDef ;
719 typedef union _USB_OTG_DIEPINTn_TypeDef
720 {
721  uint32_t d32;
722  struct
723  {
724 uint32_t xfercompl :
725  1;
726 uint32_t epdisabled :
727  1;
728 uint32_t Reserved2 :
729  1;
730 uint32_t timeout :
731  1;
732 uint32_t intktxfemp :
733  1;
734 uint32_t Reserved5 :
735  1;
736 uint32_t inepnakeff :
737  1;
738 uint32_t emptyintr :
739  1;
740 uint32_t txfifoundrn :
741  1;
742 uint32_t Reserved14_31 :
743  23;
744  }
745  b;
746 } USB_OTG_DIEPINTn_TypeDef ;
747 typedef union _USB_OTG_DIEPINTn_TypeDef USB_OTG_DIEPMSK_TypeDef ;
748 typedef union _USB_OTG_DOEPINTn_TypeDef
749 {
750  uint32_t d32;
751  struct
752  {
753 uint32_t xfercompl :
754  1;
755 uint32_t epdisabled :
756  1;
757 uint32_t Reserved2 :
758  1;
759 uint32_t setup :
760  1;
761 uint32_t Reserved04_31 :
762  28;
763  }
764  b;
765 } USB_OTG_DOEPINTn_TypeDef ;
766 typedef union _USB_OTG_DOEPINTn_TypeDef USB_OTG_DOEPMSK_TypeDef ;
767 
768 typedef union _USB_OTG_DAINT_TypeDef
769 {
770  uint32_t d32;
771  struct
772  {
773 uint32_t in :
774  16;
775 uint32_t out :
776  16;
777  }
778  ep;
779 } USB_OTG_DAINT_TypeDef ;
780 
781 typedef union _USB_OTG_DTHRCTL_TypeDef
782 {
783  uint32_t d32;
784  struct
785  {
786 uint32_t non_iso_thr_en :
787  1;
788 uint32_t iso_thr_en :
789  1;
790 uint32_t tx_thr_len :
791  9;
792 uint32_t Reserved11_15 :
793  5;
794 uint32_t rx_thr_en :
795  1;
796 uint32_t rx_thr_len :
797  9;
798 uint32_t Reserved26 :
799  1;
800 uint32_t arp_en :
801  1;
802 uint32_t Reserved28_31 :
803  4;
804  }
805  b;
806 } USB_OTG_DTHRCTL_TypeDef ;
807 typedef union _USB_OTG_DEPCTL_TypeDef
808 {
809  uint32_t d32;
810  struct
811  {
812 uint32_t mps :
813  11;
814 uint32_t reserved :
815  4;
816 uint32_t usbactep :
817  1;
818 uint32_t dpid :
819  1;
820 uint32_t naksts :
821  1;
822 uint32_t eptype :
823  2;
824 uint32_t snp :
825  1;
826 uint32_t stall :
827  1;
828 uint32_t txfnum :
829  4;
830 uint32_t cnak :
831  1;
832 uint32_t snak :
833  1;
834 uint32_t setd0pid :
835  1;
836 uint32_t setd1pid :
837  1;
838 uint32_t epdis :
839  1;
840 uint32_t epena :
841  1;
842  }
843  b;
844 } USB_OTG_DEPCTL_TypeDef ;
845 typedef union _USB_OTG_DEPXFRSIZ_TypeDef
846 {
847  uint32_t d32;
848  struct
849  {
850 uint32_t xfersize :
851  19;
852 uint32_t pktcnt :
853  10;
854 uint32_t mc :
855  2;
856 uint32_t Reserved :
857  1;
858  }
859  b;
860 } USB_OTG_DEPXFRSIZ_TypeDef ;
861 typedef union _USB_OTG_DEP0XFRSIZ_TypeDef
862 {
863  uint32_t d32;
864  struct
865  {
866 uint32_t xfersize :
867  7;
868 uint32_t Reserved7_18 :
869  12;
870 uint32_t pktcnt :
871  2;
872 uint32_t Reserved20_28 :
873  9;
874 uint32_t supcnt :
875  2;
876  uint32_t Reserved31;
877  }
878  b;
879 } USB_OTG_DEP0XFRSIZ_TypeDef ;
880 typedef union _USB_OTG_HCFG_TypeDef
881 {
882  uint32_t d32;
883  struct
884  {
885 uint32_t fslspclksel :
886  2;
887 uint32_t fslssupp :
888  1;
889  }
890  b;
891 } USB_OTG_HCFG_TypeDef ;
892 typedef union _USB_OTG_HFRMINTRVL_TypeDef
893 {
894  uint32_t d32;
895  struct
896  {
897 uint32_t frint :
898  16;
899 uint32_t Reserved :
900  16;
901  }
902  b;
903 } USB_OTG_HFRMINTRVL_TypeDef ;
904 
905 typedef union _USB_OTG_HFNUM_TypeDef
906 {
907  uint32_t d32;
908  struct
909  {
910 uint32_t frnum :
911  16;
912 uint32_t frrem :
913  16;
914  }
915  b;
916 } USB_OTG_HFNUM_TypeDef ;
917 typedef union _USB_OTG_HPTXSTS_TypeDef
918 {
919  uint32_t d32;
920  struct
921  {
922 uint32_t ptxfspcavail :
923  16;
924 uint32_t ptxqspcavail :
925  8;
926  struct
927  {
928  uint32_t terminate :
929  1;
930  uint32_t token :
931  2;
932  uint32_t chnum :
933  4;
934  uint32_t odd_even :
935  1;
936  } ptxqtop;
937  }
938  b;
939 } USB_OTG_HPTXSTS_TypeDef ;
940 typedef union _USB_OTG_HPRT0_TypeDef
941 {
942  uint32_t d32;
943  struct
944  {
945 uint32_t prtconnsts :
946  1;
947 uint32_t prtconndet :
948  1;
949 uint32_t prtena :
950  1;
951 uint32_t prtenchng :
952  1;
953 uint32_t prtovrcurract :
954  1;
955 uint32_t prtovrcurrchng :
956  1;
957 uint32_t prtres :
958  1;
959 uint32_t prtsusp :
960  1;
961 uint32_t prtrst :
962  1;
963 uint32_t Reserved9 :
964  1;
965 uint32_t prtlnsts :
966  2;
967 uint32_t prtpwr :
968  1;
969 uint32_t prttstctl :
970  4;
971 uint32_t prtspd :
972  2;
973 uint32_t Reserved19_31 :
974  13;
975  }
976  b;
977 } USB_OTG_HPRT0_TypeDef ;
978 typedef union _USB_OTG_HAINT_TypeDef
979 {
980  uint32_t d32;
981  struct
982  {
983 uint32_t chint :
984  16;
985 uint32_t Reserved :
986  16;
987  }
988  b;
989 } USB_OTG_HAINT_TypeDef ;
990 typedef union _USB_OTG_HAINTMSK_TypeDef
991 {
992  uint32_t d32;
993  struct
994  {
995 uint32_t chint :
996  16;
997 uint32_t Reserved :
998  16;
999  }
1000  b;
1001 } USB_OTG_HAINTMSK_TypeDef ;
1002 typedef union _USB_OTG_HCCHAR_TypeDef
1003 {
1004  uint32_t d32;
1005  struct
1006  {
1007 uint32_t mps :
1008  11;
1009 uint32_t epnum :
1010  4;
1011 uint32_t epdir :
1012  1;
1013 uint32_t Reserved :
1014  1;
1015 uint32_t lspddev :
1016  1;
1017 uint32_t eptype :
1018  2;
1019 uint32_t multicnt :
1020  2;
1021 uint32_t devaddr :
1022  7;
1023 uint32_t oddfrm :
1024  1;
1025 uint32_t chdis :
1026  1;
1027 uint32_t chen :
1028  1;
1029  }
1030  b;
1031 } USB_OTG_HCCHAR_TypeDef ;
1032 typedef union _USB_OTG_HCSPLT_TypeDef
1033 {
1034  uint32_t d32;
1035  struct
1036  {
1037 uint32_t prtaddr :
1038  7;
1039 uint32_t hubaddr :
1040  7;
1041 uint32_t xactpos :
1042  2;
1043 uint32_t compsplt :
1044  1;
1045 uint32_t Reserved :
1046  14;
1047 uint32_t spltena :
1048  1;
1049  }
1050  b;
1051 } USB_OTG_HCSPLT_TypeDef ;
1052 typedef union _USB_OTG_HCINTn_TypeDef
1053 {
1054  uint32_t d32;
1055  struct
1056  {
1057 uint32_t xfercompl :
1058  1;
1059 uint32_t chhltd :
1060  1;
1061 uint32_t ahberr :
1062  1;
1063 uint32_t stall :
1064  1;
1065 uint32_t nak :
1066  1;
1067 uint32_t ack :
1068  1;
1069 uint32_t nyet :
1070  1;
1071 uint32_t xacterr :
1072  1;
1073 uint32_t bblerr :
1074  1;
1075 uint32_t frmovrun :
1076  1;
1077 uint32_t datatglerr :
1078  1;
1079 uint32_t Reserved :
1080  21;
1081  }
1082  b;
1083 } USB_OTG_HCINTn_TypeDef ;
1084 typedef union _USB_OTG_HCTSIZn_TypeDef
1085 {
1086  uint32_t d32;
1087  struct
1088  {
1089 uint32_t xfersize :
1090  19;
1091 uint32_t pktcnt :
1092  10;
1093 uint32_t pid :
1094  2;
1095 uint32_t dopng :
1096  1;
1097  }
1098  b;
1099 } USB_OTG_HCTSIZn_TypeDef ;
1100 typedef union _USB_OTG_HCINTMSK_TypeDef
1101 {
1102  uint32_t d32;
1103  struct
1104  {
1105 uint32_t xfercompl :
1106  1;
1107 uint32_t chhltd :
1108  1;
1109 uint32_t ahberr :
1110  1;
1111 uint32_t stall :
1112  1;
1113 uint32_t nak :
1114  1;
1115 uint32_t ack :
1116  1;
1117 uint32_t nyet :
1118  1;
1119 uint32_t xacterr :
1120  1;
1121 uint32_t bblerr :
1122  1;
1123 uint32_t frmovrun :
1124  1;
1125 uint32_t datatglerr :
1126  1;
1127 uint32_t Reserved :
1128  21;
1129  }
1130  b;
1131 } USB_OTG_HCINTMSK_TypeDef ;
1132 
1133 typedef union _USB_OTG_PCGCCTL_TypeDef
1134 {
1135  uint32_t d32;
1136  struct
1137  {
1138 uint32_t stoppclk :
1139  1;
1140 uint32_t gatehclk :
1141  1;
1142 uint32_t Reserved2_3 :
1143  2;
1144 uint32_t phy_susp :
1145  1;
1146 uint32_t Reserved5_31 :
1147  27;
1148  }
1149  b;
1150 } USB_OTG_PCGCCTL_TypeDef ;
1151 
1152 /**
1153  * @}
1154  */
1155 
1156 
1157 /** @defgroup USB_REGS_Exported_Macros
1158  * @{
1159  */
1160 /**
1161  * @}
1162  */
1163 
1164 /** @defgroup USB_REGS_Exported_Variables
1165  * @{
1166  */
1167 /**
1168  * @}
1169  */
1170 
1171 /** @defgroup USB_REGS_Exported_FunctionsPrototype
1172  * @{
1173  */
1174 /**
1175  * @}
1176  */
1177 
1178 
1179 #endif //__USB_OTG_REGS_H__
1180 
1181 
1182 /**
1183  * @}
1184  */
1185 
1186 /**
1187  * @}
1188  */
1189 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
1190 #endif /* (USE_STM32_USB_HOST_MODE || USE_STM32_USB_USE_DEVICE_MODE || USE_STM32_USB_OTG_MODE) */
static struct audio_setup_t setup
Definition: audio_stm32.c:90
libheivs configuration file