Keyboard firmwares for Atmel AVR and Cortex-M
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

USBRegs_STM32.h 6.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  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. #ifndef __USB_OTG_REGS_H__
  28. #define __USB_OTG_REGS_H__
  29. typedef struct //000h
  30. {
  31. __IO uint32_t GOTGCTL; /* USB_OTG Control and Status Register 000h*/
  32. __IO uint32_t GOTGINT; /* USB_OTG Interrupt Register 004h*/
  33. __IO uint32_t GAHBCFG; /* Core AHB Configuration Register 008h*/
  34. __IO uint32_t GUSBCFG; /* Core USB Configuration Register 00Ch*/
  35. __IO uint32_t GRSTCTL; /* Core Reset Register 010h*/
  36. __IO uint32_t GINTSTS; /* Core Interrupt Register 014h*/
  37. __IO uint32_t GINTMSK; /* Core Interrupt Mask Register 018h*/
  38. __IO uint32_t GRXSTSR; /* Receive Sts Q Read Register 01Ch*/
  39. __IO uint32_t GRXSTSP; /* Receive Sts Q Read & POP Register 020h*/
  40. __IO uint32_t GRXFSIZ; /* Receive FIFO Size Register 024h*/
  41. __IO uint32_t DIEPTXF0_HNPTXFSIZ; /* EP0 / Non Periodic Tx FIFO Size Register 028h*/
  42. __IO uint32_t HNPTXSTS; /* Non Periodic Tx FIFO/Queue Sts reg 02Ch*/
  43. uint32_t Reserved30[2]; /* Reserved 030h*/
  44. __IO uint32_t GCCFG; /* General Purpose IO Register 038h*/
  45. __IO uint32_t CID; /* User ID Register 03Ch*/
  46. uint32_t Reserved40[48]; /* Reserved 040h-0FFh*/
  47. __IO uint32_t HPTXFSIZ; /* Host Periodic Tx FIFO Size Reg 100h*/
  48. __IO uint32_t DIEPTXF[3];/* dev Periodic Transmit FIFO */
  49. }
  50. USB_OTG_GREGS;
  51. typedef struct // 800h
  52. {
  53. __IO uint32_t DCFG; /* dev Configuration Register 800h*/
  54. __IO uint32_t DCTL; /* dev Control Register 804h*/
  55. __IO uint32_t DSTS; /* dev Status Register (RO) 808h*/
  56. uint32_t Reserved0C; /* Reserved 80Ch*/
  57. __IO uint32_t DIEPMSK; /* dev IN Endpoint Mask 810h*/
  58. __IO uint32_t DOEPMSK; /* dev OUT Endpoint Mask 814h*/
  59. __IO uint32_t DAINT; /* dev All Endpoints Itr Reg 818h*/
  60. __IO uint32_t DAINTMSK; /* dev All Endpoints Itr Mask 81Ch*/
  61. uint32_t Reserved20; /* Reserved 820h*/
  62. uint32_t Reserved9; /* Reserved 824h*/
  63. __IO uint32_t DVBUSDIS; /* dev VBUS discharge Register 828h*/
  64. __IO uint32_t DVBUSPULSE; /* dev VBUS Pulse Register 82Ch*/
  65. __IO uint32_t DTHRCTL; /* dev thr 830h*/
  66. __IO uint32_t DIEPEMPMSK; /* dev empty msk 834h*/
  67. }
  68. USB_OTG_DREGS;
  69. typedef struct
  70. {
  71. __IO uint32_t DIEPCTL; /* dev IN Endpoint Control Reg 900h + (ep_num * 20h) + 00h*/
  72. uint32_t Reserved04; /* Reserved 900h + (ep_num * 20h) + 04h*/
  73. __IO uint32_t DIEPINT; /* dev IN Endpoint Itr Reg 900h + (ep_num * 20h) + 08h*/
  74. uint32_t Reserved0C; /* Reserved 900h + (ep_num * 20h) + 0Ch*/
  75. __IO uint32_t DIEPTSIZ; /* IN Endpoint Txfer Size 900h + (ep_num * 20h) + 10h*/
  76. uint32_t Reserved14;
  77. __IO uint32_t DTXFSTS;/*IN Endpoint Tx FIFO Status Reg 900h + (ep_num * 20h) + 18h*/
  78. uint32_t Reserved1C; /* Reserved 900h+(ep_num*20h)+1Ch-900h+ (ep_num * 20h) + 1Ch*/
  79. }
  80. USB_OTG_INEPREGS;
  81. typedef struct
  82. {
  83. __IO uint32_t DOEPCTL; /* dev OUT Endpoint Control Reg B00h + (ep_num * 20h) + 00h*/
  84. uint32_t Reserved04; /* Reserved B00h + (ep_num * 20h) + 04h*/
  85. __IO uint32_t DOEPINT; /* dev OUT Endpoint Itr Reg B00h + (ep_num * 20h) + 08h*/
  86. uint32_t Reserved0C; /* Reserved B00h + (ep_num * 20h) + 0Ch*/
  87. __IO uint32_t DOEPTSIZ; /* dev OUT Endpoint Txfer Size B00h + (ep_num * 20h) + 10h*/
  88. uint32_t Reserved14[3];
  89. }
  90. USB_OTG_OUTEPREGS;
  91. typedef struct
  92. {
  93. __IO uint32_t HCFG; /* Host Configuration Register 400h*/
  94. __IO uint32_t HFIR; /* Host Frame Interval Register 404h*/
  95. __IO uint32_t HFNUM; /* Host Frame Nbr/Frame Remaining 408h*/
  96. uint32_t Reserved40C; /* Reserved 40Ch*/
  97. __IO uint32_t HPTXSTS; /* Host Periodic Tx FIFO/ Queue Status 410h*/
  98. __IO uint32_t HAINT; /* Host All Channels Interrupt Register 414h*/
  99. __IO uint32_t HAINTMSK; /* Host All Channels Interrupt Mask 418h*/
  100. }
  101. USB_OTG_HREGS;
  102. typedef struct
  103. {
  104. __IO uint32_t HCCHAR;
  105. __IO uint32_t HCSPLT;
  106. __IO uint32_t HCINT;
  107. __IO uint32_t HCINTMSK;
  108. __IO uint32_t HCTSIZ;
  109. uint32_t Reserved[3];
  110. }
  111. USB_OTG_HC_REGS;
  112. typedef struct
  113. {
  114. USB_OTG_GREGS GREGS;
  115. uint32_t RESERVED0[188];
  116. USB_OTG_HREGS HREGS;
  117. uint32_t RESERVED1[9];
  118. __IO uint32_t HPRT;
  119. uint32_t RESERVED2[47];
  120. USB_OTG_HC_REGS HC_REGS[8];
  121. uint32_t RESERVED3[128];
  122. USB_OTG_DREGS DREGS;
  123. uint32_t RESERVED4[50];
  124. USB_OTG_INEPREGS INEP_REGS[4];
  125. uint32_t RESERVED5[96];
  126. USB_OTG_OUTEPREGS OUTEP_REGS[4];
  127. uint32_t RESERVED6[160];
  128. __IO uint32_t PCGCCTL;
  129. uint32_t RESERVED7[127];
  130. __IO uint32_t FIFO[4][1024];
  131. }
  132. USB_OTG_CORE_REGS;
  133. #define OTG_FS_BASE (AHB2PERIPH_BASE + 0x0000)
  134. #define OTG_FS ((USB_OTG_CORE_REGS *) OTG_FS_BASE)
  135. #endif //__USB_OTG_REGS_H__
  136. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/