usb_regs.h 21 KB

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