Nut/OS  5.0.5
API Reference
otgd_fs_regs.h
Go to the documentation of this file.
00001 /******************** (C) COPYRIGHT 2010 STMicroelectronics ********************
00002 * File Name          : otgd_fs_regs.h
00003 * Author             : STMicroelectronics
00004 * Version            : V3.1.1
00005 * Date               : 04/07/2010
00006 * Description        : USB OTG IP hardware registers.
00007 ********************************************************************************
00008 * THE PRESENT SOFTWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
00009 * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME.
00010 * AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT,
00011 * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE
00012 * CONTENT OF SUCH SOFTWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING
00013 * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
00014 *******************************************************************************/
00015 
00016 #ifndef __USB_OTG_REGS_H__
00017 #define __USB_OTG_REGS_H__
00018 
00019 #include <arch/cm3/stm/stm32xxxx.h>
00020 #include <dev/usb_stm32/usb_type.h>
00021 
00022 #define __IO volatile
00023 
00024 #define USB_OTG_FS1_BASE_ADDR                0x50000000
00025 
00026 #define USB_OTG_CORE_GLOBAL_REGS_OFFSET      0x000
00027 #define USB_OTG_DEV_GLOBAL_REG_OFFSET        0x800
00028 #define USB_OTG_DEV_IN_EP_REG_OFFSET         0x900
00029 #define USB_OTG_EP_REG_OFFSET                0x20
00030 #define USB_OTG_DEV_OUT_EP_REG_OFFSET        0xB00
00031 #define USB_OTG_HOST_GLOBAL_REG_OFFSET       0x400
00032 #define USB_OTG_HOST_PORT_REGS_OFFSET        0x440
00033 #define USB_OTG_HOST_CHAN_REGS_OFFSET        0x500
00034 #define USB_OTG_CHAN_REGS_OFFSET             0x20
00035 #define USB_OTG_PCGCCTL_OFFSET               0xE00
00036 #define USB_OTG_DATA_FIFO_OFFSET             0x1000
00037 #define USB_OTG_DATA_FIFO_SIZE               0x1000
00038 
00039 #define MAX_PERIO_FIFOS                      8
00040 #define MAX_TX_FIFOS                         4
00041 #define MAX_EPS_CHANNELS                     8
00042 /*******************************************************************************
00043  * USB_OTG Core registers .
00044  * The USB_OTG_core_regs structure defines the size
00045  * and relative field offsets for the Core Global registers.
00046  ******************************************************************************/
00047 typedef struct _USB_OTG_common_regs  //000h
00048 {
00049 
00050   __IO uint32_t otg_ctl;      /* USB_OTG Control and Status Register    000h*/
00051   __IO uint32_t otg_int;      /* USB_OTG Interrupt Register             004h*/
00052   __IO uint32_t ahb_cfg;      /* Core AHB Configuration Register    008h*/
00053   __IO uint32_t usb_cfg;      /* Core USB Configuration Register    00Ch*/
00054   __IO uint32_t rst_ctl;      /* Core Reset Register                010h*/
00055   __IO uint32_t int_sts;      /* Core Interrupt Register            014h*/
00056   __IO uint32_t int_msk;      /* Core Interrupt Mask Register       018h*/
00057   __IO uint32_t rx_stsr;      /* Receive Sts Q Read Register        01Ch*/
00058   __IO uint32_t rx_stsp;      /* Receive Sts Q Read & POP Register  020h*/
00059   __IO uint32_t rx_fifo_siz;  /* Receive FIFO Size Register         024h*/
00060   __IO uint32_t np_tx_fifo_siz;   /* Non Periodic Tx FIFO Size Register 028h*/
00061   __IO uint32_t np_tx_sts;    /* Non Periodic Tx FIFO/Queue Sts reg 02Ch*/
00062   __IO uint32_t i2c_ctl;      /* I2C Access Register                030h*/
00063   __IO uint32_t phy_vnd_ctl;  /* PHY Vendor Control Register        034h*/
00064   __IO uint32_t gpio;         /* General Purpose IO Register        038h*/
00065   __IO uint32_t usr_id;       /* User ID Register                   03Ch*/
00066   __IO uint32_t snps_id;      /* Synopsys ID Register               040h*/
00067   __IO uint32_t hw_cfg1;      /* User HW Config1 Register (RO)      044h*/
00068   __IO uint32_t hw_cfg2;      /* User HW Config2 Register (RO)      048h*/
00069   __IO uint32_t hw_cfg3;      /* User HW Config3 Register (RO)      04Ch*/
00070   __IO uint32_t hw_cfg4;      /* User HW Config4 Register (RO)      050h*/
00071   uint32_t  reserved[43];          /* Reserved                      054h-0FFh*/
00072   __IO uint32_t host_p_tx_fifo_siz; /* Host Periodic Tx FIFO Size Reg     100h*/
00073   __IO uint32_t dev_p_tx_fsiz_dieptxf[15];/* dev Periodic Transmit FIFO */
00074 
00075 }
00076 USB_OTG_common_regs;
00077 
00078 /*******************************************************************************
00079  * dev Registers
00080  * dev Global Registers : Offsets 800h-BFFh
00081  * The following structures define the size and relative field offsets
00082  * for the dev Mode Registers.
00083  * These registers are visible only in dev mode and must not be
00084  * accessed in Host mode, as the results are unknown
00085  ******************************************************************************/
00086 typedef struct _USB_OTG_dev_regs // 800h
00087 {
00088 
00089   __IO uint32_t dev_cfg;         /* dev Configuration Register   800h*/
00090   __IO uint32_t dev_ctl;         /* dev Control Register         804h*/
00091   __IO uint32_t dev_sts;         /* dev Status Register (RO)     808h*/
00092   uint32_t reserved3;         /* Reserved                     80Ch*/
00093   __IO uint32_t dev_in_ep_msk;   /* dev IN Endpoint Mask         810h*/
00094   __IO uint32_t dev_out_ep_msk;  /* dev OUT Endpoint Mask        814h*/
00095   __IO uint32_t dev_all_int;     /* dev All Endpoints Itr Reg    818h*/
00096   __IO uint32_t dev_all_int_msk; /* dev All Endpoints Itr Mask   81Ch*/
00097   uint32_t  Reserved8;       /* Reserved                     820h*/
00098   __IO uint32_t Reserved9;       /* Reserved                     824h*/
00099   __IO uint32_t dev_vbus_dis;    /* dev VBUS discharge Register  828h*/
00100   __IO uint32_t dev_vbus_pulse;  /* dev VBUS Pulse Register      82Ch*/
00101   __IO uint32_t dev_thr_ctl;     /* dev thr                      830h*/
00102   __IO uint32_t dev_fifo_empty_msk; /* dev empty msk             834h*/
00103 
00104 }
00105 USB_OTG_dev_regs;
00106 /*******************************************************************************
00107  * dev Logical IN Endpoint-Specific Registers: Offsets 900h-AFCh
00108  * There will be one set of endpoint registers per logical endpointimplemented.
00109  * These registers are visible only in dev mode and must not be
00110  * accessed in Host mode, as the results are unknown
00111 *******************************************************************************/
00112 typedef struct _USB_OTG_dev_in_ep_regs
00113 {
00114   __IO uint32_t dev_in_ep_ctl; /* dev IN Endpoint Control Reg 900h + (ep_num * 20h) + 00h*/
00115   uint32_t reserved04;             /* Reserved                       900h + (ep_num * 20h) + 04h*/
00116   __IO uint32_t dev_in_ep_int; /* dev IN Endpoint Itr Reg     900h + (ep_num * 20h) + 08h*/
00117   uint32_t reserved0C;             /* Reserved                       900h + (ep_num * 20h) + 0Ch*/
00118   __IO uint32_t dev_in_ep_txfer_siz; /* IN Endpoint Txfer Size   900h + (ep_num * 20h) + 10h*/
00119   __IO uint32_t dev_in_ep_dma; /* IN Endpoint DMA Address Reg    900h + (ep_num * 20h) + 14h*/
00120   __IO uint32_t dev_tx_fifo_sts;/*IN Endpoint Tx FIFO Status Reg 900h + (ep_num * 20h) + 18h*/
00121   uint32_t reserved18;             /* Reserved  900h+(ep_num*20h)+1Ch-900h+ (ep_num * 20h) + 1Ch*/
00122 
00123 }
00124 USB_OTG_dev_in_ep_regs;
00125 
00126 /*******************************************************************************
00127  * dev Logical OUT Endpoint-Specific Registers Offsets: B00h-CFCh
00128  * There will be one set of endpoint registers per logical endpoint
00129  * implemented.
00130  * These registers are visible only in dev mode and must not be
00131  * accessed in Host mode, as the results are unknown
00132 ******************************************************************************/
00133 typedef struct _USB_OTG_dev_out_ep_regs
00134 {
00135   __IO uint32_t dev_out_ep_ctl;       /* dev OUT Endpoint Control Reg  B00h + (ep_num * 20h) + 00h*/
00136   __IO uint32_t dev_out_ep_frm_nbr;   /* dev OUT Endpoint Frame number B00h + (ep_num * 20h) + 04h*/
00137   __IO uint32_t dev_out_ep_int;              /* dev OUT Endpoint Itr Reg      B00h + (ep_num * 20h) + 08h*/
00138   uint32_t reserved0C;                    /* Reserved                         B00h + (ep_num * 20h) + 0Ch*/
00139   __IO uint32_t dev_out_ep_txfer_siz; /* dev OUT Endpoint Txfer Size   B00h + (ep_num * 20h) + 10h*/
00140   __IO uint32_t dev_out_ep_dma;              /* dev OUT Endpoint DMA Address  B00h + (ep_num * 20h) + 14h*/
00141   uint32_t reserved18[2];                 /* Reserved B00h + (ep_num * 20h) + 18h - B00h + (ep_num * 20h) + 1Ch*/
00142 
00143 }
00144 USB_OTG_dev_out_ep_regs;
00145 /*******************************************************************************
00146  * Host Mode Register Structures
00147  * The Host Global Registers structure defines the size and relative
00148  * field offsets for the Host Mode Global Registers.
00149  * Host Global Registers offsets 400h-7FFh.
00150 *******************************************************************************/
00151 typedef struct _USB_OTG_host_regs
00152 {
00153   __IO uint32_t host_cfg;             /* Host Configuration Register    400h*/
00154   __IO uint32_t host_frm_intrvl;      /* Host Frame Interval Register   404h*/
00155   __IO uint32_t host_frm_nbr;         /* Host Frame Nbr/Frame Remaining 408h*/
00156   uint32_t reserved40C;                   /* Reserved                       40Ch*/
00157   __IO uint32_t host_p_tx_sts;   /* Host Periodic Tx FIFO/ Queue Status 410h*/
00158   __IO uint32_t host_all_int;   /* Host All Channels Interrupt Register 414h*/
00159   __IO uint32_t host_all_int_msk;   /* Host All Channels Interrupt Mask 418h*/
00160 
00161 }
00162 USB_OTG_host_regs;
00163 
00164 /*******************************************************************************
00165 * Host Channel Specific Registers 500h-5FCh
00166 *******************************************************************************/
00167 typedef struct _USB_OTG_hc_regs
00168 {
00169 
00170   __IO uint32_t hc_char;
00171   __IO uint32_t hc_split;
00172   __IO uint32_t hc_int;
00173   __IO uint32_t hc_int_msk;
00174   __IO uint32_t hc_txfer_siz;
00175   __IO uint32_t hc_dma;
00176   uint32_t reserved[2];
00177 
00178 }
00179 USB_OTG_hc_regs;
00180 /*******************************************************************************
00181  * otg Core registers .
00182  * The USB_OTG_core_regs structure defines the size
00183  * and relative field offsets for the Core Global registers.
00184  ******************************************************************************/
00185 typedef struct USB_OTG_core_regs  //000h
00186 {
00187   USB_OTG_common_regs         *common_regs;
00188   USB_OTG_dev_regs            *dev_regs;
00189   USB_OTG_host_regs           *host_regs;
00190   USB_OTG_dev_in_ep_regs      *inep_regs[MAX_EPS_CHANNELS];
00191   USB_OTG_dev_out_ep_regs     *outep_regs[MAX_EPS_CHANNELS];
00192   USB_OTG_hc_regs             *hc_regs[MAX_EPS_CHANNELS];
00193   __IO uint32_t                    *hprt0;
00194   __IO uint32_t                    *data_fifo[MAX_EPS_CHANNELS];
00195   __IO uint32_t                    *pcgcctl;
00196 
00197 }
00198 USB_OTG_CORE_REGS , *pUSB_OTG_CORE_REGS;
00199 /******************************************************************************/
00200 
00201 typedef union _USB_OTG_OTG_ctl_data
00202 {
00203   uint32_t d32;
00204   struct
00205   {
00206 uint32_t sesreqscs :
00207     1;
00208 uint32_t sesreq :
00209     1;
00210 uint32_t reserved2_7 :
00211     6;
00212 uint32_t hstnegscs :
00213     1;
00214 uint32_t hnpreq :
00215     1;
00216 uint32_t hstsethnpen :
00217     1;
00218 uint32_t devhnpen :
00219     1;
00220 uint32_t reserved12_15 :
00221     4;
00222 uint32_t conidsts :
00223     1;
00224 uint32_t reserved17 :
00225     1;
00226 uint32_t asesvld :
00227     1;
00228 uint32_t bsesvld :
00229     1;
00230 uint32_t currmod :
00231     1;
00232 uint32_t reserved21_31 :
00233     11;
00234   }
00235   b;
00236 } USB_OTG_OTG_ctl_data;
00237 
00238 /******************************************************************************/
00239 
00240 typedef union _USB_OTG_OTG_int_data
00241 {
00242   uint32_t d32;
00243   struct
00244   {
00245 uint32_t reserved0_1 :
00246     2;
00247 uint32_t sesenddet :
00248     1;
00249 uint32_t reserved3_7 :
00250     5;
00251 uint32_t sesreqsucstschng :
00252     1;
00253 uint32_t hstnegsucstschng :
00254     1;
00255 uint32_t reserver10_16 :
00256     7;
00257 uint32_t hstnegdet :
00258     1;
00259 uint32_t adevtoutchng :
00260     1;
00261 uint32_t debdone :
00262     1;
00263 uint32_t reserved31_20 :
00264     12;
00265   }
00266   b;
00267 } USB_OTG_OTG_int_data;
00268 
00269 
00270 /******************************************************************************/
00271 
00272 
00273 typedef union _USB_OTG_ahb_cfg_data
00274 {
00275   uint32_t d32;
00276   struct
00277   {
00278 uint32_t glblintrmsk :
00279     1;
00280 uint32_t hburstlen :
00281     4;
00282 uint32_t dmaenable :
00283     1;
00284 uint32_t reserved :
00285     1;
00286 uint32_t nptxfemplvl_txfemplvl :
00287     1;
00288 uint32_t ptxfemplvl :
00289     1;
00290 uint32_t reserved9_31 :
00291     23;
00292   }
00293   b;
00294 } USB_OTG_ahb_cfg_data;
00295 
00296 /******************************************************************************/
00297 
00298 typedef union _USB_OTG_usb_cfg_data
00299 {
00300   uint32_t d32;
00301   struct
00302   {
00303 uint32_t toutcal :
00304     3;
00305 uint32_t phyif :
00306     1;
00307 uint32_t ulpi_utmi_sel :
00308     1;
00309 uint32_t fsintf :
00310     1;
00311 uint32_t physel :
00312     1;
00313 uint32_t ddrsel :
00314     1;
00315 uint32_t srpcap :
00316     1;
00317 uint32_t hnpcap :
00318     1;
00319 uint32_t usbtrdtim :
00320     4;
00321 uint32_t nptxfrwnden :
00322     1;
00323 uint32_t phylpwrclksel :
00324     1;
00325 uint32_t otgutmifssel :
00326     1;
00327 uint32_t ulpi_fsls :
00328     1;
00329 uint32_t ulpi_auto_res :
00330     1;
00331 uint32_t ulpi_clk_sus_m :
00332     1;
00333 uint32_t ulpi_ext_vbus_drv :
00334     1;
00335 uint32_t ulpi_int_vbus_indicator :
00336     1;
00337 uint32_t term_sel_dl_pulse :
00338     1;
00339 uint32_t reserved :
00340     6;
00341 uint32_t force_host :
00342     1;
00343 uint32_t force_dev :
00344     1;
00345 uint32_t corrupt_tx :
00346     1;
00347   }
00348   b;
00349 } USB_OTG_usb_cfg_data;
00350 /******************************************************************************/
00351 
00352 typedef union _USB_OTG_rst_ctl_data
00353 {
00354   uint32_t d32;
00355   struct
00356   {
00357 uint32_t csftrst :
00358     1;
00359 uint32_t hsftrst :
00360     1;
00361 uint32_t hstfrm :
00362     1;
00363 uint32_t intknqflsh :
00364     1;
00365 uint32_t rxfflsh :
00366     1;
00367 uint32_t txfflsh :
00368     1;
00369 uint32_t txfnum :
00370     5;
00371 uint32_t reserved11_29 :
00372     19;
00373 uint32_t dmareq :
00374     1;
00375 uint32_t ahbidle :
00376     1;
00377   }
00378   b;
00379 } USB_OTG_rst_ctl_data;
00380 
00381 /******************************************************************************/
00382 
00383 typedef union _USB_OTG_int_msk_data
00384 {
00385   uint32_t d32;
00386   struct
00387   {
00388 uint32_t reserved0 :
00389     1;
00390 uint32_t modemismatch :
00391     1;
00392 uint32_t otgintr :
00393     1;
00394 uint32_t sofintr :
00395     1;
00396 uint32_t rxstsqlvl :
00397     1;
00398 uint32_t nptxfempty :
00399     1;
00400 uint32_t ginnakeff :
00401     1;
00402 uint32_t goutnakeff :
00403     1;
00404 uint32_t reserved8 :
00405     1;
00406 uint32_t i2cintr :
00407     1;
00408 uint32_t erlysuspend :
00409     1;
00410 uint32_t usbsuspend :
00411     1;
00412 uint32_t usbreset :
00413     1;
00414 uint32_t enumdone :
00415     1;
00416 uint32_t isooutdrop :
00417     1;
00418 uint32_t eopframe :
00419     1;
00420 uint32_t reserved16 :
00421     1;
00422 uint32_t epmismatch :
00423     1;
00424 uint32_t inepintr :
00425     1;
00426 uint32_t outepintr :
00427     1;
00428 uint32_t incomplisoin :
00429     1;
00430 uint32_t incomplisoout :
00431     1;
00432 uint32_t reserved22_23 :
00433     2;
00434 uint32_t portintr :
00435     1;
00436 uint32_t hcintr :
00437     1;
00438 uint32_t ptxfempty :
00439     1;
00440 uint32_t reserved27 :
00441     1;
00442 uint32_t conidstschng :
00443     1;
00444 uint32_t disconnect :
00445     1;
00446 uint32_t sessreqintr :
00447     1;
00448 uint32_t wkupintr :
00449     1;
00450   }
00451   b;
00452 } USB_OTG_int_msk_data;
00453 
00454 /******************************************************************************/
00455 
00456 
00457 typedef union _USB_OTG_int_sts_data
00458 {
00459   uint32_t d32;
00460   struct
00461   {
00462 uint32_t curmode :
00463     1;
00464 uint32_t modemismatch :
00465     1;
00466 uint32_t otgintr :
00467     1;
00468 uint32_t sofintr :
00469     1;
00470 uint32_t rxstsqlvl :
00471     1;
00472 uint32_t nptxfempty :
00473     1;
00474 uint32_t ginnakeff :
00475     1;
00476 uint32_t goutnakeff :
00477     1;
00478 uint32_t reserved8 :
00479     1;
00480 uint32_t i2cintr :
00481     1;
00482 uint32_t erlysuspend :
00483     1;
00484 uint32_t usbsuspend :
00485     1;
00486 uint32_t usbreset :
00487     1;
00488 uint32_t enumdone :
00489     1;
00490 uint32_t isooutdrop :
00491     1;
00492 uint32_t eopframe :
00493     1;
00494 uint32_t intokenrx :
00495     1;
00496 uint32_t epmismatch :
00497     1;
00498 uint32_t inepint:
00499     1;
00500 uint32_t outepintr :
00501     1;
00502 uint32_t incomplisoin :
00503     1;
00504 uint32_t incomplisoout :
00505     1;
00506 uint32_t reserved22_23 :
00507     2;
00508 uint32_t portintr :
00509     1;
00510 uint32_t hcintr :
00511     1;
00512 uint32_t ptxfempty :
00513     1;
00514 uint32_t reserved27 :
00515     1;
00516 uint32_t conidstschng :
00517     1;
00518 uint32_t disconnect :
00519     1;
00520 uint32_t sessreqintr :
00521     1;
00522 uint32_t wkupintr :
00523     1;
00524   }
00525   b;
00526 } USB_OTG_int_sts_data;
00527 
00528 /******************************************************************************/
00529 typedef union _USB_OTG_dev_rx_sts_data
00530 {
00531 
00532   uint32_t d32;
00533   struct
00534   {
00535 uint32_t epnum :
00536     4;
00537 uint32_t bcnt :
00538     11;
00539 uint32_t dpid :
00540     2;
00541 uint32_t pktsts :
00542     4;
00543 uint32_t fn :
00544     4;
00545 uint32_t reserved :
00546     7;
00547   }
00548   b;
00549 } USB_OTG_dev_rx_sts_data;
00550 
00551 /******************************************************************************/
00552 typedef union _USB_OTG_host_rx_sts_data
00553 {
00554 
00555   uint32_t d32;
00556   struct
00557   {
00558 uint32_t chnum :
00559     4;
00560 uint32_t bcnt :
00561     11;
00562 uint32_t dpid :
00563     2;
00564 uint32_t pktsts :
00565     4;
00566 uint32_t reserved :
00567     11;
00568   }
00569   b;
00570 } USB_OTG_host_rx_sts_data;
00571 
00572 /******************************************************************************/
00573 
00574 typedef union _USB_OTG_fifo_size_data
00575 {
00576   uint32_t d32;
00577   struct
00578   {
00579 uint32_t startaddr :
00580     16;
00581 uint32_t depth :
00582     16;
00583   }
00584   b;
00585 } USB_OTG_fifo_size_data;
00586 
00587 /******************************************************************************/
00588 
00589 typedef union _USB_OTG_np_tx_sts_data
00590 {
00591   uint32_t d32;
00592   struct
00593   {
00594 uint32_t nptxfspcavail :
00595     16;
00596 uint32_t nptxqspcavail :
00597     8;
00598 uint32_t nptxqtop_terminate :
00599     1;
00600 uint32_t nptxqtop_token :
00601     2;
00602 uint32_t nptxqtop_chnep :
00603     4;
00604 uint32_t reserved :
00605     1;
00606   }
00607   b;
00608 } USB_OTG_np_tx_sts_data;
00609 
00610 /******************************************************************************/
00611 
00612 typedef union _USB_OTG_dev_tx_fifo_sts_data
00613 {
00614   uint32_t d32;
00615   struct
00616   {
00617 uint32_t txfspcavail :
00618     16;
00619 uint32_t reserved :
00620     16;
00621   }
00622   b;
00623 } USB_OTG_dev_tx_fifo_sts_data;
00624 
00625 /******************************************************************************/
00626 typedef union _USB_OTG_i2c_ctl_data
00627 {
00628 
00629   uint32_t d32;
00630   struct
00631   {
00632 uint32_t rwdata :
00633     8;
00634 uint32_t regaddr :
00635     8;
00636 uint32_t addr :
00637     7;
00638 uint32_t i2cen :
00639     1;
00640 uint32_t ack :
00641     1;
00642 uint32_t i2csuspctl :
00643     1;
00644 uint32_t i2cdevaddr :
00645     2;
00646 uint32_t dat_se0:
00647     1;
00648 uint32_t reserved :
00649     1;
00650 uint32_t rw :
00651     1;
00652 uint32_t bsydne :
00653     1;
00654   }
00655   b;
00656 } USB_OTG_i2c_ctl_data;
00657 
00658 /******************************************************************************/
00659 
00660 typedef union _USB_OTG_gpio_data
00661 {
00662 
00663   uint32_t d32;
00664   struct
00665   {
00666     /* input */
00667 uint32_t ovrcur :
00668     1;
00669 uint32_t otgid :
00670     1;
00671 uint32_t reserved_in :
00672     14;
00673     /* Output */
00674 uint32_t pwdn :
00675     1;
00676 uint32_t i2cifen :
00677     1;
00678 uint32_t vbussensingA :
00679     1;
00680 uint32_t vbussensingB :
00681     1;
00682 uint32_t SOFouten :
00683     1;
00684 uint32_t reserved_out :
00685     11;
00686   }
00687   b;
00688 } USB_OTG_gpio_data;
00689 
00690 
00691 /******************************************************************************/
00692 
00693 typedef union _USB_OTG_hw_cfg1_data
00694 {
00695 
00696   uint32_t d32;
00697   struct
00698   {
00699 uint32_t ep_dir0 :
00700     2;
00701 uint32_t ep_dir1 :
00702     2;
00703 uint32_t ep_dir2 :
00704     2;
00705 uint32_t ep_dir3 :
00706     2;
00707 uint32_t ep_dir4 :
00708     2;
00709 uint32_t ep_dir5 :
00710     2;
00711 uint32_t ep_dir6 :
00712     2;
00713 uint32_t ep_dir7 :
00714     2;
00715 uint32_t ep_dir8 :
00716     2;
00717 uint32_t ep_dir9 :
00718     2;
00719 uint32_t ep_dir10 :
00720     2;
00721 uint32_t ep_dir11 :
00722     2;
00723 uint32_t ep_dir12 :
00724     2;
00725 uint32_t ep_dir13 :
00726     2;
00727 uint32_t ep_dir14 :
00728     2;
00729 uint32_t ep_dir15 :
00730     2;
00731   }
00732   b;
00733 } USB_OTG_hw_cfg1_data;
00734 
00735 /******************************************************************************/
00736 typedef union _USB_OTG_hw_cfg2_data
00737 {
00738   uint32_t d32;
00739   struct
00740   {
00741 uint32_t op_mode :
00742     3;
00743 uint32_t architecture :
00744     2;
00745 uint32_t point2point :
00746     1;
00747 uint32_t hs_phy_type :
00748     2;
00749 uint32_t fs_phy_type :
00750     2;
00751 uint32_t num_dev_ep :
00752     4;
00753 uint32_t num_host_chan :
00754     4;
00755 uint32_t perio_ep_supported :
00756     1;
00757 uint32_t dynamic_fifo :
00758     1;
00759 uint32_t rx_status_q_depth :
00760     2;
00761 uint32_t nonperio_tx_q_depth :
00762     2;
00763 uint32_t host_perio_tx_q_depth :
00764     2;
00765 uint32_t dev_token_q_depth :
00766     5;
00767 uint32_t reserved31 :
00768     1;
00769   }
00770   b;
00771 } USB_OTG_hw_cfg2_data;
00772 
00773 /******************************************************************************/
00774 
00775 typedef union _USB_OTG_hw_cfg3_data
00776 {
00777 
00778   uint32_t d32;
00779   struct
00780   {
00781 uint32_t xfer_size_cntr_width :
00782     4;
00783 uint32_t packet_size_cntr_width :
00784     3;
00785 uint32_t otg_func :
00786     1;
00787 uint32_t i2c :
00788     1;
00789 uint32_t vendor_ctrl_if :
00790     1;
00791 uint32_t optional_features :
00792     1;
00793 uint32_t synch_reset_type :
00794     1;
00795 uint32_t ahb_phy_clock_synch :
00796     1;
00797 uint32_t reserved15_13 :
00798     3;
00799 uint32_t dfifo_depth :
00800     16;
00801   }
00802   b;
00803 } USB_OTG_hw_cfg3_data;
00804 
00805 /******************************************************************************/
00806 
00807 typedef union _USB_OTG_hw_cfg4_data
00808 {
00809   uint32_t d32;
00810   struct
00811   {
00812 uint32_t num_dev_perio_in_ep :
00813     4;
00814 uint32_t power_optimiz :
00815     1;
00816 uint32_t min_ahb_freq :
00817     9;
00818 uint32_t utmi_phy_data_width :
00819     2;
00820 uint32_t num_dev_mode_ctrl_ep :
00821     4;
00822 uint32_t iddig_filt_en :
00823     1;
00824 uint32_t vbus_valid_filt_en :
00825     1;
00826 uint32_t a_valid_filt_en :
00827     1;
00828 uint32_t b_valid_filt_en :
00829     1;
00830 uint32_t session_end_filt_en :
00831     1;
00832 uint32_t ded_fifo_en :
00833     1;
00834 uint32_t num_in_eps :
00835     4;
00836 uint32_t reserved31_30 :
00837     2;
00838   }
00839   b;
00840 } USB_OTG_hw_cfg4_data;
00841 
00842 /******************************************************************************/
00843 typedef union _USB_OTG_dev_cfg_data
00844 {
00845 
00846   uint32_t d32;
00847   struct
00848   {
00849 uint32_t devspd :
00850     2;
00851 uint32_t nzstsouthshk :
00852     1;
00853 uint32_t reserved3 :
00854     1;
00855 uint32_t devaddr :
00856     7;
00857 uint32_t perfrint :
00858     2;
00859 uint32_t reserved13_17 :
00860     5;
00861 uint32_t epmscnt :
00862     4;
00863   }
00864   b;
00865 } USB_OTG_dev_cfg_data;
00866 
00867 /******************************************************************************/
00868 
00869 typedef union _USB_OTG_dev_ctl_data
00870 {
00871 
00872   uint32_t d32;
00873   struct
00874   {
00875 uint32_t rmtwkupsig :
00876     1;
00877 uint32_t sftdiscon :
00878     1;
00879 uint32_t gnpinnaksts :
00880     1;
00881 uint32_t goutnaksts :
00882     1;
00883 uint32_t tstctl :
00884     3;
00885 uint32_t sgnpinnak :
00886     1;
00887 uint32_t cgnpinnak :
00888     1;
00889 uint32_t sgoutnak :
00890     1;
00891 uint32_t cgoutnak :
00892     1;
00893 uint32_t reserved :
00894     21;
00895   }
00896   b;
00897 } USB_OTG_dev_ctl_data;
00898 
00899 /******************************************************************************/
00900 typedef union _USB_OTG_dev_sts_data
00901 {
00902 
00903   uint32_t d32;
00904   struct
00905   {
00906 uint32_t suspsts :
00907     1;
00908 uint32_t enumspd :
00909     2;
00910 uint32_t errticerr :
00911     1;
00912 uint32_t reserved4_7:
00913     4;
00914 uint32_t soffn :
00915     14;
00916 uint32_t reserved22_31 :
00917     10;
00918   }
00919   b;
00920 } USB_OTG_dev_sts_data;
00921 
00922 /******************************************************************************/
00923 
00924 typedef union _USB_OTG_dev_in_ep_int_data
00925 {
00926 
00927   uint32_t d32;
00928   struct
00929   {
00930 uint32_t xfercompl :
00931     1;
00932 uint32_t epdisabled :
00933     1;
00934 uint32_t ahberr :
00935     1;
00936 uint32_t timeout :
00937     1;
00938 uint32_t intktxfemp :
00939     1;
00940 uint32_t intknepmis :
00941     1;
00942 uint32_t inepnakeff :
00943     1;
00944 uint32_t emptyintr :
00945     1;
00946 uint32_t txfifoundrn :
00947     1;
00948 uint32_t reserved08_31 :
00949     23;
00950   }
00951   b;
00952 } USB_OTG_dev_in_ep_int_data;
00953 
00954 /******************************************************************************/
00955 
00956 typedef union _USB_OTG_dev_in_ep_int_data  USB_OTG_dev_in_ep_msk_data;
00957 /******************************************************************************/
00958 
00959 typedef union _USB_OTG_dev_out_ep_int_data
00960 {
00961 
00962   uint32_t d32;
00963   struct
00964   {
00965 uint32_t xfercompl :
00966     1;
00967 uint32_t epdisabled :
00968     1;
00969 uint32_t ahberr :
00970     1;
00971 uint32_t setup :
00972     1;
00973 uint32_t reserved04_31 :
00974     28;
00975   }
00976   b;
00977 } USB_OTG_dev_out_ep_int_data;
00978 
00979 /******************************************************************************/
00980 
00981 typedef union _USB_OTG_dev_out_ep_int_data  USB_OTG_dev_out_ep_msk_data;
00982 
00983 /******************************************************************************/
00984 typedef union _USB_OTG_dev_all_int_data
00985 {
00986 
00987   uint32_t d32;
00988   struct
00989   {
00990 uint32_t in :
00991     16;
00992 uint32_t out :
00993     16;
00994   }
00995   ep;
00996   struct
00997   {
00999 uint32_t inep0  :
01000     1;
01001 uint32_t inep1  :
01002     1;
01003 uint32_t inep2  :
01004     1;
01005 uint32_t inep3  :
01006     1;
01007 uint32_t inep4  :
01008     1;
01009 uint32_t inep5  :
01010     1;
01011 uint32_t inep6  :
01012     1;
01013 uint32_t inep7  :
01014     1;
01015 uint32_t inep8  :
01016     1;
01017 uint32_t inep9  :
01018     1;
01019 uint32_t inep10 :
01020     1;
01021 uint32_t inep11 :
01022     1;
01023 uint32_t inep12 :
01024     1;
01025 uint32_t inep13 :
01026     1;
01027 uint32_t inep14 :
01028     1;
01029 uint32_t inep15 :
01030     1;
01032 uint32_t outep0  :
01033     1;
01034 uint32_t outep1  :
01035     1;
01036 uint32_t outep2  :
01037     1;
01038 uint32_t outep3  :
01039     1;
01040 uint32_t outep4  :
01041     1;
01042 uint32_t outep5  :
01043     1;
01044 uint32_t outep6  :
01045     1;
01046 uint32_t outep7  :
01047     1;
01048 uint32_t outep8  :
01049     1;
01050 uint32_t outep9  :
01051     1;
01052 uint32_t outep10 :
01053     1;
01054 uint32_t outep11 :
01055     1;
01056 uint32_t outep12 :
01057     1;
01058 uint32_t outep13 :
01059     1;
01060 uint32_t outep14 :
01061     1;
01062 uint32_t outep15 :
01063     1;
01064   }
01065   b;
01066 } USB_OTG_dev_all_int_data;
01067 
01068 /******************************************************************************/
01069 typedef union _USB_OTG_token_qr1_data
01070 {
01071 
01072   uint32_t d32;
01073   struct
01074   {
01075 uint32_t intknwptr :
01076     5;
01077 uint32_t reserved05_06 :
01078     2;
01079 uint32_t wrap_bit :
01080     1;
01081 uint32_t epnums0_5 :
01082     24;
01083   }
01084   b;
01085 } USB_OTG_token_qr1_data;
01086 
01087 /******************************************************************************/
01088 
01089 typedef union _USB_OTG_dev_thr_ctl_data
01090 {
01091 
01092   uint32_t d32;
01093   struct
01094   {
01095 uint32_t non_iso_thr_en :
01096     1;
01097 uint32_t iso_thr_en :
01098     1;
01099 uint32_t tx_thr_len :
01100     9;
01101 uint32_t reserved11_15 :
01102     5;
01103 uint32_t rx_thr_en :
01104     1;
01105 uint32_t rx_thr_len :
01106     9;
01107 uint32_t reserved26_31 :
01108     6;
01109   }
01110   b;
01111 } USB_OTG_dev_thr_ctl_data;
01112 
01113 /******************************************************************************/
01114 typedef union _USB_OTG_dev_ep_ctl_data
01115 {
01116 
01117   uint32_t d32;
01118   struct
01119   {
01120 uint32_t mps :
01121     11;
01122 uint32_t nextep :
01123     4;
01124 uint32_t usbactep :
01125     1;
01126 uint32_t dpid :
01127     1;
01128 uint32_t naksts :
01129     1;
01130 uint32_t eptype :
01131     2;
01132 uint32_t snp :
01133     1;
01134 uint32_t stall :
01135     1;
01136 uint32_t txfnum :
01137     4;
01138 uint32_t cnak :
01139     1;
01140 uint32_t snak :
01141     1;
01142 uint32_t setd0pid :
01143     1;
01144 uint32_t setd1pid :
01145     1;
01146 uint32_t epdis :
01147     1;
01148 uint32_t epena :
01149     1;
01150   }
01151   b;
01152 } USB_OTG_dev_ep_ctl_data;
01153 
01154 /******************************************************************************/
01155 
01156 typedef union _USB_OTG_dev_ep_txfer_siz_data
01157 {
01158 
01159   uint32_t d32;
01160   struct
01161   {
01162 uint32_t xfersize :
01163     19;
01164 uint32_t pktcnt :
01165     10;
01166 uint32_t mc :
01167     2;
01168 uint32_t reserved :
01169     1;
01170   }
01171   b;
01172 } USB_OTG_dev_ep_txfer_siz_data;
01173 
01174 /******************************************************************************/
01175 
01176 typedef union _USB_OTG_dev_ep_txfer_size0_data
01177 {
01178 
01179   uint32_t d32;
01180   struct
01181   {
01182 uint32_t xfersize :
01183     7;
01184 uint32_t reserved7_18 :
01185     12;
01186 uint32_t pktcnt :
01187     1;
01188 uint32_t reserved20_28 :
01189     9;
01190 uint32_t supcnt :
01191     2;
01192     uint32_t reserved31;
01193   }
01194   b;
01195 } USB_OTG_dev_ep_txfer_size0_data;
01196 
01197 /******************************************************************************/
01198 typedef union _USB_OTG_host_cfg_data
01199 {
01200 
01201   uint32_t d32;
01202   struct
01203   {
01204 uint32_t fslspclksel :
01205     2;
01206 uint32_t fslssupp :
01207     1;
01208   }
01209   b;
01210 } USB_OTG_host_cfg_data;
01211 
01212 /******************************************************************************/
01213 
01214 typedef union _USB_OTG_Host_frm_intrvl_data
01215 {
01216   uint32_t d32;
01217   struct
01218   {
01219 uint32_t frint :
01220     16;
01221 uint32_t reserved :
01222     16;
01223   }
01224   b;
01225 } USB_OTG_Host_frm_intrvl_data;
01226 
01227 /******************************************************************************/
01228 #define HFNUM_MAX_FRNUM 0x3FFF
01229 typedef union _USB_OTG_host_frm_nbr_data
01230 {
01231 
01232   uint32_t d32;
01233   struct
01234   {
01235 uint32_t frnum :
01236     16;
01237 uint32_t frrem :
01238     16;
01239   }
01240   b;
01241 } USB_OTG_host_frm_nbr_data;
01242 
01243 /******************************************************************************/
01244 
01245 typedef union _USB_OTG_host_perio_tx_sts_data
01246 {
01247 
01248   uint32_t d32;
01249   struct
01250   {
01251 uint32_t ptxfspcavail :
01252     16;
01253 uint32_t ptxqspcavail :
01254     8;
01255 uint32_t ptxqtop_terminate :
01256     1;
01257 uint32_t ptxqtop_token :
01258     2;
01259 uint32_t ptxqtop_chnum :
01260     4;
01261 uint32_t ptxqtop_odd :
01262     1;
01263   }
01264   b;
01265 } USB_OTG_host_perio_tx_sts_data;
01266 
01267 /******************************************************************************/
01268 typedef union _USB_OTG_hprt0_data
01269 {
01270   uint32_t d32;
01271   struct
01272   {
01273 uint32_t prtconnsts :
01274     1;
01275 uint32_t prtconndet :
01276     1;
01277 uint32_t prtena :
01278     1;
01279 uint32_t prtenchng :
01280     1;
01281 uint32_t prtovrcurract :
01282     1;
01283 uint32_t prtovrcurrchng :
01284     1;
01285 uint32_t prtres :
01286     1;
01287 uint32_t prtsusp :
01288     1;
01289 uint32_t prtrst :
01290     1;
01291 uint32_t reserved9 :
01292     1;
01293 uint32_t prtlnsts :
01294     2;
01295 uint32_t prtpwr :
01296     1;
01297 uint32_t prttstctl :
01298     4;
01299 uint32_t prtspd :
01300     2;
01301 uint32_t reserved19_31 :
01302     13;
01303   }
01304   b;
01305 } USB_OTG_hprt0_data;
01306 
01307 /******************************************************************************/
01308 
01309 typedef union _USB_OTG_host_all_int_data
01310 {
01311   uint32_t d32;
01312   struct
01313   {
01314 uint32_t ch0 :
01315     1;
01316 uint32_t ch1 :
01317     1;
01318 uint32_t ch2 :
01319     1;
01320 uint32_t ch3 :
01321     1;
01322 uint32_t ch4 :
01323     1;
01324 uint32_t ch5 :
01325     1;
01326 uint32_t ch6 :
01327     1;
01328 uint32_t ch7 :
01329     1;
01330 uint32_t ch8 :
01331     1;
01332 uint32_t ch9 :
01333     1;
01334 uint32_t ch10 :
01335     1;
01336 uint32_t ch11 :
01337     1;
01338 uint32_t ch12 :
01339     1;
01340 uint32_t ch13 :
01341     1;
01342 uint32_t ch14 :
01343     1;
01344 uint32_t ch15 :
01345     1;
01346 uint32_t reserved :
01347     16;
01348   }
01349   b;
01350 
01351   struct
01352   {
01353 uint32_t chint :
01354     16;
01355 uint32_t reserved :
01356     16;
01357   }
01358   b2;
01359 } USB_OTG_host_all_int_data;
01360 
01361 
01362 /******************************************************************************/
01363 
01364 typedef union _USB_OTG_host_all_int_msk_data
01365 {
01366   uint32_t d32;
01367   struct
01368   {
01369 uint32_t ch0 :
01370     1;
01371 uint32_t ch1 :
01372     1;
01373 uint32_t ch2 :
01374     1;
01375 uint32_t ch3 :
01376     1;
01377 uint32_t ch4 :
01378     1;
01379 uint32_t ch5 :
01380     1;
01381 uint32_t ch6 :
01382     1;
01383 uint32_t ch7 :
01384     1;
01385 uint32_t ch8 :
01386     1;
01387 uint32_t ch9 :
01388     1;
01389 uint32_t ch10 :
01390     1;
01391 uint32_t ch11 :
01392     1;
01393 uint32_t ch12 :
01394     1;
01395 uint32_t ch13 :
01396     1;
01397 uint32_t ch14 :
01398     1;
01399 uint32_t ch15 :
01400     1;
01401 uint32_t reserved :
01402     16;
01403   }
01404   b;
01405 
01406   struct
01407   {
01408 uint32_t chint :
01409     16;
01410 uint32_t reserved :
01411     16;
01412   }
01413   b2;
01414 } USB_OTG_host_all_int_msk_data;
01415 
01416 /******************************************************************************/
01417 
01418 typedef union _USB_OTG_hc_char_data
01419 {
01420 
01421   uint32_t d32;
01422   struct
01423   {
01424 uint32_t mps :
01425     11;
01426 uint32_t epnum :
01427     4;
01428 uint32_t epdir :
01429     1;
01430 uint32_t reserved :
01431     1;
01432 uint32_t lspddev :
01433     1;
01434 uint32_t eptype :
01435     2;
01436 uint32_t multicnt :
01437     2;
01438 uint32_t devaddr :
01439     7;
01440 uint32_t oddfrm :
01441     1;
01442 uint32_t chdis :
01443     1;
01444 uint32_t chen :
01445     1;
01446   }
01447   b;
01448 } USB_OTG_hc_char_data;
01449 
01450 /******************************************************************************/
01451 typedef union _USB_OTG_hc_splt_data
01452 {
01453 
01454   uint32_t d32;
01455   struct
01456   {
01457 uint32_t prtaddr :
01458     7;
01459 uint32_t hubaddr :
01460     7;
01461 uint32_t xactpos :
01462     2;
01463 uint32_t compsplt :
01464     1;
01465 uint32_t reserved :
01466     14;
01467 uint32_t spltena :
01468     1;
01469   }
01470   b;
01471 } USB_OTG_hc_splt_data;
01472 
01473 /******************************************************************************/
01474 
01475 typedef union _USB_OTG_hc_int_data
01476 {
01477   uint32_t d32;
01478   struct
01479   {
01480 uint32_t xfercomp :
01481     1;
01482 uint32_t chhltd :
01483     1;
01484 uint32_t ahberr :
01485     1;
01486 uint32_t stall :
01487     1;
01488 uint32_t nak :
01489     1;
01490 uint32_t ack :
01491     1;
01492 uint32_t nyet :
01493     1;
01494 uint32_t xacterr :
01495     1;
01496 uint32_t bblerr :
01497     1;
01498 uint32_t frmovrun :
01499     1;
01500 uint32_t datatglerr :
01501     1;
01502 uint32_t reserved :
01503     21;
01504   }
01505   b;
01506 } USB_OTG_hc_int_data;
01507 
01508 /******************************************************************************/
01509 
01510 
01511 typedef union _USB_OTG_hc_txfer_siz_data
01512 {
01513 
01514   uint32_t d32;
01515   struct
01516   {
01517 uint32_t xfersize :
01518     19;
01519 uint32_t pktcnt :
01520     10;
01521 uint32_t pid :
01522     2;
01523 uint32_t dopng :
01524     1;
01525   }
01526   b;
01527 } USB_OTG_hc_txfer_siz_data;
01528 
01529 /******************************************************************************/
01530 
01531 typedef union _USB_OTG_hc_int_msk_data
01532 {
01533 
01534   uint32_t d32;
01535   struct
01536   {
01537 uint32_t xfercompl :
01538     1;
01539 uint32_t chhltd :
01540     1;
01541 uint32_t ahberr :
01542     1;
01543 uint32_t stall :
01544     1;
01545 uint32_t nak :
01546     1;
01547 uint32_t ack :
01548     1;
01549 uint32_t nyet :
01550     1;
01551 uint32_t xacterr :
01552     1;
01553 uint32_t bblerr :
01554     1;
01555 uint32_t frmovrun :
01556     1;
01557 uint32_t datatglerr :
01558     1;
01559 uint32_t reserved :
01560     21;
01561   }
01562   b;
01563 } USB_OTG_hc_int_msk_data;
01564 
01565 /******************************************************************************/
01566 
01567 typedef union _USB_OTG_host_pcgcctl_data
01568 {
01569   uint32_t d32;
01570   struct
01571   {
01572 uint32_t stoppclk :
01573     1;
01574 uint32_t gatehclk :
01575     1;
01576 uint32_t pwrclmp :
01577     1;
01578 uint32_t rstpdwnmodule :
01579     1;
01580 uint32_t physuspended :
01581     1;
01582 uint32_t reserved :
01583     27;
01584   }
01585   b;
01586 } USB_OTG_host_pcgcctl_data;
01587 
01588 
01589 /******************* (C) COPYRIGHT 2010 STMicroelectronics *****END OF FILE****/
01590 
01591 #endif