otg_reg.h 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399
  1. /**************************************************************************//**
  2. * @file otg_reg.h
  3. * @version V1.00
  4. * @brief OTG register definition header file
  5. *
  6. * SPDX-License-Identifier: Apache-2.0
  7. * @copyright (C) 2017-2020 Nuvoton Technology Corp. All rights reserved.
  8. *****************************************************************************/
  9. #ifndef __OTG_REG_H__
  10. #define __OTG_REG_H__
  11. #if defined ( __CC_ARM )
  12. #pragma anon_unions
  13. #endif
  14. /**
  15. @addtogroup REGISTER Control Register
  16. @{
  17. */
  18. /**
  19. @addtogroup OTG USB On-The-Go Controller(OTG)
  20. Memory Mapped Structure for OTG Controller
  21. @{ */
  22. typedef struct
  23. {
  24. /**
  25. * @var OTG_T::CTL
  26. * Offset: 0x00 OTG Control Register
  27. * ---------------------------------------------------------------------------------------------------
  28. * |Bits |Field |Descriptions
  29. * | :----: | :----: | :---- |
  30. * |[0] |VBUSDROP |Drop VBUS Control
  31. * | | |If user application running on this OTG A-device wants to conserve power, set this bit to drop VBUS
  32. * | | |BUSREQ (OTG_CTL[1]) will be also cleared no matter A-device or B-device.
  33. * | | |0 = Not drop the VBUS.
  34. * | | |1 = Drop the VBUS.
  35. * |[1] |BUSREQ |OTG Bus Request
  36. * | | |If OTG A-device wants to do data transfers via USB bus, setting this bit will drive VBUS high to detect USB device connection
  37. * | | |If user won't use the bus any more, clearing this bit will drop VBUS to save power
  38. * | | |This bit will be cleared when A-device goes to A_wait_vfall state
  39. * | | |This bit will be also cleared if VBUSDROP (OTG_CTL[0]) bit is set or IDSTS (OTG_STATUS[1]) changed.
  40. * | | |If user of an OTG-B Device wants to request VBUS, setting this bit will run SRP protocol
  41. * | | |This bit will be cleared if SRP failure (OTG A-device does not provide VBUS after B-device issues ARP in specified interval, defined in OTG specification)
  42. * | | |This bit will be also cleared if VBUSDROP (OTG_CTL[0]) bit is set IDSTS (OTG_STATUS[1]) changed.
  43. * | | |0 = Not launch VBUS in OTG A-device or not request SRP in OTG B-device.
  44. * | | |1 = Launch VBUS in OTG A-device or request SRP in OTG B-device.
  45. * |[2] |HNPREQEN |OTG HNP Request Enable Bit
  46. * | | |When USB frame as A-device, set this bit when A-device allows to process HNP protocol -- A-device changes role from Host to Peripheral
  47. * | | |This bit will be cleared when OTG state changes from a_suspend to a_peripheral or goes back to a_idle state
  48. * | | |When USB frame as B-device, set this bit after the OTG A-device successfully sends a SetFeature (b_hnp_enable) command to the OTG B-device to start role change -- B-device changes role from Peripheral to Host
  49. * | | |This bit will be cleared when OTG state changes from b_peripheral to b_wait_acon or goes back to b_idle state.
  50. * | | |0 = HNP request Disabled.
  51. * | | |1 = HNP request Enabled (A-device can change role from Host to Peripheral or B-device can change role from Peripheral to Host).
  52. * | | |Note: Refer to OTG specification to get a_suspend, a_peripheral, a_idle and b_idle state.
  53. * |[4] |OTGEN |OTG Function Enable Bit
  54. * | | |User needs to set this bit to enable OTG function while USB frame configured as OTG device
  55. * | | |When USB frame not configured as OTG device, this bit is must be low.
  56. * | | |0= OTG function Disabled.
  57. * | | |1 = OTG function Enabled.
  58. * |[5] |WKEN |OTG ID Pin Wake-up Enable Bit
  59. * | | |0 = OTG ID pin status change wake-up function Disabled.
  60. * | | |1 = OTG ID pin status change wake-up function Enabled.
  61. * @var OTG_T::PHYCTL
  62. * Offset: 0x04 OTG PHY Control Register
  63. * ---------------------------------------------------------------------------------------------------
  64. * |Bits |Field |Descriptions
  65. * | :----: | :----: | :---- |
  66. * |[0] |OTGPHYEN |OTG PHY Enable
  67. * | | |When USB frame is configured as OTG-device or ID-dependent, user needs to set this bit before using OTG function
  68. * | | |If device is not configured as OTG-device nor ID-dependent , this bit is "don't care".
  69. * | | |0 = OTG PHY Disabled.
  70. * | | |1 = OTG PHY Enabled.
  71. * |[1] |IDDETEN |ID Detection Enable Bit
  72. * | | |0 = Detect ID pin status Disabled.
  73. * | | |1 = Detect ID pin status Enabled.
  74. * |[4] |VBENPOL |Off-chip USB VBUS Power Switch Enable Polarity
  75. * | | |The OTG controller will enable off-chip USB VBUS power switch to provide VBUS power when need
  76. * | | |A USB_VBUS_EN pin is used to control the off-chip USB VBUS power switch.
  77. * | | |The polarity of enabling off-chip USB VBUS power switch (high active or low active) depends on the selected component
  78. * | | |Set this bit as following according to the polarity of off-chip USB VBUS power switch.
  79. * | | |0 = The off-chip USB VBUS power switch enable is active high.
  80. * | | |1 = The off-chip USB VBUS power switch enable is active low.
  81. * |[5] |VBSTSPOL |Off-chip USB VBUS Power Switch Status Polarity
  82. * | | |The polarity of off-chip USB VBUS power switch valid signal depends on the selected component
  83. * | | |A USB_VBUS_ST pin is used to monitor the valid signal of the off-chip USB VBUS power switch
  84. * | | |Set this bit as following according to the polarity of off-chip USB VBUS power switch.
  85. * | | |0 = The polarity of off-chip USB VBUS power switch valid status is high.
  86. * | | |1 = The polarity of off-chip USB VBUS power switch valid status is low.
  87. * @var OTG_T::INTEN
  88. * Offset: 0x08 OTG Interrupt Enable Register
  89. * ---------------------------------------------------------------------------------------------------
  90. * |Bits |Field |Descriptions
  91. * | :----: | :----: | :---- |
  92. * |[0] |ROLECHGIEN|Role (Host or Peripheral) Changed Interrupt Enable Bit
  93. * | | |0 = Interrupt Disabled.
  94. * | | |1 = Interrupt Enabled.
  95. * |[1] |VBEIEN |VBUS Error Interrupt Enable Bit
  96. * | | |0 = Interrupt Disabled.
  97. * | | |1 = Interrupt Enabled.
  98. * | | |Note: VBUS error means going to a_vbus_err state. Please refer to A-device state diagram in OTG spec.
  99. * |[2] |SRPFIEN |SRP Fail Interrupt Enable Bit
  100. * | | |0 = Interrupt Disabled.
  101. * | | |1 = Interrupt Enabled.
  102. * |[3] |HNPFIEN |HNP Fail Interrupt Enable Bit
  103. * | | |0 = Interrupt Disabled.
  104. * | | |1 = Interrupt Enabled.
  105. * |[4] |GOIDLEIEN |OTG Device Goes to IDLE State Interrupt Enable Bit
  106. * | | |0 = Interrupt Disabled.
  107. * | | |1 = Interrupt Enabled.
  108. * | | |Note: Going to idle state means going to a_idle or b_idle state
  109. * | | |Please refer to A-device state diagram and B-device state diagram in OTG spec.
  110. * |[5] |IDCHGIEN |IDSTS Changed Interrupt Enable Bit
  111. * | | |If this bit is set to 1 and IDSTS (OTG_STATUS[1]) status is changed from high to low or from low to high, a interrupt will be asserted.
  112. * | | |0 = Interrupt Disabled.
  113. * | | |1 = Interrupt Enabled.
  114. * |[6] |PDEVIEN |Act As Peripheral Interrupt Enable Bit
  115. * | | |If this bit is set to 1 and the device is changed as a peripheral, a interrupt will be asserted.
  116. * | | |0 = This device as a peripheral interrupt Disabled.
  117. * | | |1 = This device as a peripheral interrupt Enabled.
  118. * |[7] |HOSTIEN |Act As Host Interrupt Enable Bit
  119. * | | |If this bit is set to 1 and the device is changed as a host, a interrupt will be asserted.
  120. * | | |0 = This device as a host interrupt Disabled.
  121. * | | |1 = This device as a host interrupt Enabled.
  122. * |[8] |BVLDCHGIEN|B-device Session Valid Status Changed Interrupt Enable Bit
  123. * | | |If this bit is set to 1 and BVLD (OTG_STATUS[3]) status is changed from high to low or from low to high, a interrupt will be asserted.
  124. * | | |0 = Interrupt Disabled.
  125. * | | |1 = Interrupt Enabled.
  126. * |[9] |AVLDCHGIEN|A-device Session Valid Status Changed Interrupt Enable Bit
  127. * | | |If this bit is set to 1 and AVLD (OTG_STATUS[4]) status is changed from high to low or from low to high, a interrupt will be asserted.
  128. * | | |0 = Interrupt Disabled.
  129. * | | |1 = Interrupt Enabled.
  130. * |[10] |VBCHGIEN |VBUSVLD Status Changed Interrupt Enable Bit
  131. * | | |If this bit is set to 1 and VBUSVLD (OTG_STATUS[5]) status is changed from high to low or from low to high, a interrupt will be asserted.
  132. * | | |0 = Interrupt Disabled.
  133. * | | |1 = Interrupt Enabled.
  134. * |[11] |SECHGIEN |SESSEND Status Changed Interrupt Enable Bit
  135. * | | |If this bit is set to 1 and SESSEND (OTG_STATUS[2]) status is changed from high to low or from low to high, a interrupt will be asserted.
  136. * | | |0 = Interrupt Disabled.
  137. * | | |1 = Interrupt Enabled.
  138. * |[13] |SRPDETIEN |SRP Detected Interrupt Enable Bit
  139. * | | |0 = Interrupt Disabled.
  140. * | | |1 = Interrupt Enabled.
  141. * @var OTG_T::INTSTS
  142. * Offset: 0x0C OTG Interrupt Status Register
  143. * ---------------------------------------------------------------------------------------------------
  144. * |Bits |Field |Descriptions
  145. * | :----: | :----: | :---- |
  146. * |[0] |ROLECHGIF |OTG Role Change Interrupt Status
  147. * | | |This flag is set when the role of an OTG device changed from a host to a peripheral, or changed from a peripheral to a host while USB_ID pin status does not change.
  148. * | | |0 = OTG device role not changed.
  149. * | | |1 = OTG device role changed.
  150. * | | |Note: Write 1 to clear this flag.
  151. * |[1] |VBEIF |VBUS Error Interrupt Status
  152. * | | |This bit will be set when voltage on VBUS cannot reach a minimum valid threshold 4.4V within a maximum time of 100ms after OTG A-device starting to drive VBUS high.
  153. * | | |0 = OTG A-device drives VBUS over threshold voltage before this interval expires.
  154. * | | |1 = OTG A-device cannot drive VBUS over threshold voltage before this interval expires.
  155. * | | |Note: Write 1 to clear this flag and recover from the VBUS error state.
  156. * |[2] |SRPFIF |SRP Fail Interrupt Status
  157. * | | |After initiating SRP, an OTG B-device will wait for the OTG A-device to drive VBUS high at least TB_SRP_FAIL minimum, defined in OTG specification
  158. * | | |This flag is set when the OTG B-device does not get VBUS high after this interval.
  159. * | | |0 = OTG B-device gets VBUS high before this interval.
  160. * | | |1 = OTG B-device does not get VBUS high before this interval.
  161. * | | |Note: Write 1 to clear this flag.
  162. * |[3] |HNPFIF |HNP Fail Interrupt Status
  163. * | | |When A-device has granted B-device to be host and USB bus is in SE0 (both USB_D+ and USB_D- low) state, this bit will be set when A-device does not connect after specified interval expires.
  164. * | | |0 = A-device connects to B-device before specified interval expires.
  165. * | | |1 = A-device does not connect to B-device before specified interval expires.
  166. * | | |Note: Write 1 to clear this flag.
  167. * |[4] |GOIDLEIF |OTG Device Goes to IDLE Interrupt Status
  168. * | | |Flag is set if the OTG device transfers from non-idle state to idle state
  169. * | | |The OTG device will be neither a host nor a peripheral.
  170. * | | |0 = OTG device does not go back to idle state (a_idle or b_idle).
  171. * | | |1 = OTG device goes back to idle state(a_idle or b_idle).
  172. * | | |Note 1: Going to idle state means going to a_idle or b_idle state. Please refer to OTG specification.
  173. * | | |Note 2: Write 1 to clear this flag.
  174. * |[5] |IDCHGIF |ID State Change Interrupt Status
  175. * | | |0 = IDSTS (OTG_STATUS[1]) not toggled.
  176. * | | |1 = IDSTS (OTG_STATUS[1]) from high to low or from low to high.
  177. * | | |Note: Write 1 to clear this flag.
  178. * |[6] |PDEVIF |Act As Peripheral Interrupt Status
  179. * | | |0= This device does not act as a peripheral.
  180. * | | |1 = This device acts as a peripheral.
  181. * | | |Note: Write 1 to clear this flag.
  182. * |[7] |HOSTIF |Act As Host Interrupt Status
  183. * | | |0= This device does not act as a host.
  184. * | | |1 = This device acts as a host.
  185. * | | |Note: Write 1 to clear this flag.
  186. * |[8] |BVLDCHGIF |B-device Session Valid State Change Interrupt Status
  187. * | | |0 = BVLD (OTG_STATUS[3]) is not toggled.
  188. * | | |1 = BVLD (OTG_STATUS[3]) from high to low or low to high.
  189. * | | |Note: Write 1 to clear this status.
  190. * |[9] |AVLDCHGIF |A-device Session Valid State Change Interrupt Status
  191. * | | |0 = AVLD (OTG_STATUS[4]) not toggled.
  192. * | | |1 = AVLD (OTG_STATUS[4]) from high to low or low to high.
  193. * | | |Note: Write 1 to clear this status.
  194. * |[10] |VBCHGIF |VBUSVLD State Change Interrupt Status
  195. * | | |0 = VBUSVLD (OTG_STATUS[5]) not toggled.
  196. * | | |1 = VBUSVLD (OTG_STATUS[5]) from high to low or from low to high.
  197. * | | |Note: Write 1 to clear this status.
  198. * |[11] |SECHGIF |SESSEND State Change Interrupt Status
  199. * | | |0 = SESSEND (OTG_STATUS[2]) not toggled.
  200. * | | |1 = SESSEND (OTG_STATUS[2]) from high to low or from low to high.
  201. * | | |Note: Write 1 to clear this flag.
  202. * |[13] |SRPDETIF |SRP Detected Interrupt Status
  203. * | | |0 = SRP not detected.
  204. * | | |1 = SRP detected.
  205. * | | |Note: Write 1 to clear this status.
  206. * @var OTG_T::STATUS
  207. * Offset: 0x10 OTG Status Register
  208. * ---------------------------------------------------------------------------------------------------
  209. * |Bits |Field |Descriptions
  210. * | :----: | :----: | :---- |
  211. * |[0] |OVERCUR |over Current Condition
  212. * | | |The voltage on VBUS cannot reach a minimum VBUS valid threshold, 4.4V minimum, within a maximum time of 100ms after OTG A-device drives VBUS high.
  213. * | | |0 = OTG A-device drives VBUS successfully.
  214. * | | |1 = OTG A-device cannot drives VBUS high in this interval.
  215. * |[1] |IDSTS |USB_ID Pin State of Mini-b/Micro-plug
  216. * | | |0 = Mini-A/Micro-A plug is attached.
  217. * | | |1 = Mini-B/Micro-B plug is attached.
  218. * |[2] |SESSEND |Session End Status
  219. * | | |When VBUS voltage is lower than 0.4V, this bit will be set to 1
  220. * | | |Session end means no meaningful power on VBUS.
  221. * | | |0 = Session is not end.
  222. * | | |1 = Session is end.
  223. * |[3] |BVLD |B-device Session Valid Status
  224. * | | |0 = B-device session is not valid.
  225. * | | |1 = B-device session is valid.
  226. * |[4] |AVLD |A-device Session Valid Status
  227. * | | |0 = A-device session is not valid.
  228. * | | |1 = A-device session is valid.
  229. * |[5] |VBUSVLD |VBUS Valid Status
  230. * | | |When VBUS is larger than 4.7V, this bit will be set to 1.
  231. * | | |0 = VBUS is not valid.
  232. * | | |1 = VBUS is valid.
  233. * |[6] |ASPERI |As Peripheral Status
  234. * | | |When OTG as peripheral, this bit is set.
  235. * | | |0: OTG not as peripheral
  236. * | | |1: OTG as peripheral
  237. * |[7] |ASHOST |As Host Status
  238. * | | |When OTG as Host, this bit is set.
  239. * | | |0: OTG not as Host
  240. * | | |1: OTG as Host
  241. */
  242. __IO uint32_t CTL; /*!< [0x0000] OTG Control Register */
  243. __IO uint32_t PHYCTL; /*!< [0x0004] OTG PHY Control Register */
  244. __IO uint32_t INTEN; /*!< [0x0008] OTG Interrupt Enable Register */
  245. __IO uint32_t INTSTS; /*!< [0x000c] OTG Interrupt Status Register */
  246. __I uint32_t STATUS; /*!< [0x0010] OTG Status Register */
  247. } OTG_T;
  248. /**
  249. @addtogroup OTG_CONST OTG Bit Field Definition
  250. Constant Definitions for OTG Controller
  251. @{ */
  252. #define OTG_CTL_VBUSDROP_Pos (0) /*!< OTG_T::CTL: VBUSDROP Position */
  253. #define OTG_CTL_VBUSDROP_Msk (0x1ul << OTG_CTL_VBUSDROP_Pos) /*!< OTG_T::CTL: VBUSDROP Mask */
  254. #define OTG_CTL_BUSREQ_Pos (1) /*!< OTG_T::CTL: BUSREQ Position */
  255. #define OTG_CTL_BUSREQ_Msk (0x1ul << OTG_CTL_BUSREQ_Pos) /*!< OTG_T::CTL: BUSREQ Mask */
  256. #define OTG_CTL_HNPREQEN_Pos (2) /*!< OTG_T::CTL: HNPREQEN Position */
  257. #define OTG_CTL_HNPREQEN_Msk (0x1ul << OTG_CTL_HNPREQEN_Pos) /*!< OTG_T::CTL: HNPREQEN Mask */
  258. #define OTG_CTL_OTGEN_Pos (4) /*!< OTG_T::CTL: OTGEN Position */
  259. #define OTG_CTL_OTGEN_Msk (0x1ul << OTG_CTL_OTGEN_Pos) /*!< OTG_T::CTL: OTGEN Mask */
  260. #define OTG_CTL_WKEN_Pos (5) /*!< OTG_T::CTL: WKEN Position */
  261. #define OTG_CTL_WKEN_Msk (0x1ul << OTG_CTL_WKEN_Pos) /*!< OTG_T::CTL: WKEN Mask */
  262. #define OTG_PHYCTL_OTGPHYEN_Pos (0) /*!< OTG_T::PHYCTL: OTGPHYEN Position */
  263. #define OTG_PHYCTL_OTGPHYEN_Msk (0x1ul << OTG_PHYCTL_OTGPHYEN_Pos) /*!< OTG_T::PHYCTL: OTGPHYEN Mask */
  264. #define OTG_PHYCTL_IDDETEN_Pos (1) /*!< OTG_T::PHYCTL: IDDETEN Position */
  265. #define OTG_PHYCTL_IDDETEN_Msk (0x1ul << OTG_PHYCTL_IDDETEN_Pos) /*!< OTG_T::PHYCTL: IDDETEN Mask */
  266. #define OTG_PHYCTL_VBENPOL_Pos (4) /*!< OTG_T::PHYCTL: VBENPOL Position */
  267. #define OTG_PHYCTL_VBENPOL_Msk (0x1ul << OTG_PHYCTL_VBENPOL_Pos) /*!< OTG_T::PHYCTL: VBENPOL Mask */
  268. #define OTG_PHYCTL_VBSTSPOL_Pos (5) /*!< OTG_T::PHYCTL: VBSTSPOL Position */
  269. #define OTG_PHYCTL_VBSTSPOL_Msk (0x1ul << OTG_PHYCTL_VBSTSPOL_Pos) /*!< OTG_T::PHYCTL: VBSTSPOL Mask */
  270. #define OTG_INTEN_ROLECHGIEN_Pos (0) /*!< OTG_T::INTEN: ROLECHGIEN Position */
  271. #define OTG_INTEN_ROLECHGIEN_Msk (0x1ul << OTG_INTEN_ROLECHGIEN_Pos) /*!< OTG_T::INTEN: ROLECHGIEN Mask */
  272. #define OTG_INTEN_VBEIEN_Pos (1) /*!< OTG_T::INTEN: VBEIEN Position */
  273. #define OTG_INTEN_VBEIEN_Msk (0x1ul << OTG_INTEN_VBEIEN_Pos) /*!< OTG_T::INTEN: VBEIEN Mask */
  274. #define OTG_INTEN_SRPFIEN_Pos (2) /*!< OTG_T::INTEN: SRPFIEN Position */
  275. #define OTG_INTEN_SRPFIEN_Msk (0x1ul << OTG_INTEN_SRPFIEN_Pos) /*!< OTG_T::INTEN: SRPFIEN Mask */
  276. #define OTG_INTEN_HNPFIEN_Pos (3) /*!< OTG_T::INTEN: HNPFIEN Position */
  277. #define OTG_INTEN_HNPFIEN_Msk (0x1ul << OTG_INTEN_HNPFIEN_Pos) /*!< OTG_T::INTEN: HNPFIEN Mask */
  278. #define OTG_INTEN_GOIDLEIEN_Pos (4) /*!< OTG_T::INTEN: GOIDLEIEN Position */
  279. #define OTG_INTEN_GOIDLEIEN_Msk (0x1ul << OTG_INTEN_GOIDLEIEN_Pos) /*!< OTG_T::INTEN: GOIDLEIEN Mask */
  280. #define OTG_INTEN_IDCHGIEN_Pos (5) /*!< OTG_T::INTEN: IDCHGIEN Position */
  281. #define OTG_INTEN_IDCHGIEN_Msk (0x1ul << OTG_INTEN_IDCHGIEN_Pos) /*!< OTG_T::INTEN: IDCHGIEN Mask */
  282. #define OTG_INTEN_PDEVIEN_Pos (6) /*!< OTG_T::INTEN: PDEVIEN Position */
  283. #define OTG_INTEN_PDEVIEN_Msk (0x1ul << OTG_INTEN_PDEVIEN_Pos) /*!< OTG_T::INTEN: PDEVIEN Mask */
  284. #define OTG_INTEN_HOSTIEN_Pos (7) /*!< OTG_T::INTEN: HOSTIEN Position */
  285. #define OTG_INTEN_HOSTIEN_Msk (0x1ul << OTG_INTEN_HOSTIEN_Pos) /*!< OTG_T::INTEN: HOSTIEN Mask */
  286. #define OTG_INTEN_BVLDCHGIEN_Pos (8) /*!< OTG_T::INTEN: BVLDCHGIEN Position */
  287. #define OTG_INTEN_BVLDCHGIEN_Msk (0x1ul << OTG_INTEN_BVLDCHGIEN_Pos) /*!< OTG_T::INTEN: BVLDCHGIEN Mask */
  288. #define OTG_INTEN_AVLDCHGIEN_Pos (9) /*!< OTG_T::INTEN: AVLDCHGIEN Position */
  289. #define OTG_INTEN_AVLDCHGIEN_Msk (0x1ul << OTG_INTEN_AVLDCHGIEN_Pos) /*!< OTG_T::INTEN: AVLDCHGIEN Mask */
  290. #define OTG_INTEN_VBCHGIEN_Pos (10) /*!< OTG_T::INTEN: VBCHGIEN Position */
  291. #define OTG_INTEN_VBCHGIEN_Msk (0x1ul << OTG_INTEN_VBCHGIEN_Pos) /*!< OTG_T::INTEN: VBCHGIEN Mask */
  292. #define OTG_INTEN_SECHGIEN_Pos (11) /*!< OTG_T::INTEN: SECHGIEN Position */
  293. #define OTG_INTEN_SECHGIEN_Msk (0x1ul << OTG_INTEN_SECHGIEN_Pos) /*!< OTG_T::INTEN: SECHGIEN Mask */
  294. #define OTG_INTEN_SRPDETIEN_Pos (13) /*!< OTG_T::INTEN: SRPDETIEN Position */
  295. #define OTG_INTEN_SRPDETIEN_Msk (0x1ul << OTG_INTEN_SRPDETIEN_Pos) /*!< OTG_T::INTEN: SRPDETIEN Mask */
  296. #define OTG_INTSTS_ROLECHGIF_Pos (0) /*!< OTG_T::INTSTS: ROLECHGIF Position */
  297. #define OTG_INTSTS_ROLECHGIF_Msk (0x1ul << OTG_INTSTS_ROLECHGIF_Pos) /*!< OTG_T::INTSTS: ROLECHGIF Mask */
  298. #define OTG_INTSTS_VBEIF_Pos (1) /*!< OTG_T::INTSTS: VBEIF Position */
  299. #define OTG_INTSTS_VBEIF_Msk (0x1ul << OTG_INTSTS_VBEIF_Pos) /*!< OTG_T::INTSTS: VBEIF Mask */
  300. #define OTG_INTSTS_SRPFIF_Pos (2) /*!< OTG_T::INTSTS: SRPFIF Position */
  301. #define OTG_INTSTS_SRPFIF_Msk (0x1ul << OTG_INTSTS_SRPFIF_Pos) /*!< OTG_T::INTSTS: SRPFIF Mask */
  302. #define OTG_INTSTS_HNPFIF_Pos (3) /*!< OTG_T::INTSTS: HNPFIF Position */
  303. #define OTG_INTSTS_HNPFIF_Msk (0x1ul << OTG_INTSTS_HNPFIF_Pos) /*!< OTG_T::INTSTS: HNPFIF Mask */
  304. #define OTG_INTSTS_GOIDLEIF_Pos (4) /*!< OTG_T::INTSTS: GOIDLEIF Position */
  305. #define OTG_INTSTS_GOIDLEIF_Msk (0x1ul << OTG_INTSTS_GOIDLEIF_Pos) /*!< OTG_T::INTSTS: GOIDLEIF Mask */
  306. #define OTG_INTSTS_IDCHGIF_Pos (5) /*!< OTG_T::INTSTS: IDCHGIF Position */
  307. #define OTG_INTSTS_IDCHGIF_Msk (0x1ul << OTG_INTSTS_IDCHGIF_Pos) /*!< OTG_T::INTSTS: IDCHGIF Mask */
  308. #define OTG_INTSTS_PDEVIF_Pos (6) /*!< OTG_T::INTSTS: PDEVIF Position */
  309. #define OTG_INTSTS_PDEVIF_Msk (0x1ul << OTG_INTSTS_PDEVIF_Pos) /*!< OTG_T::INTSTS: PDEVIF Mask */
  310. #define OTG_INTSTS_HOSTIF_Pos (7) /*!< OTG_T::INTSTS: HOSTIF Position */
  311. #define OTG_INTSTS_HOSTIF_Msk (0x1ul << OTG_INTSTS_HOSTIF_Pos) /*!< OTG_T::INTSTS: HOSTIF Mask */
  312. #define OTG_INTSTS_BVLDCHGIF_Pos (8) /*!< OTG_T::INTSTS: BVLDCHGIF Position */
  313. #define OTG_INTSTS_BVLDCHGIF_Msk (0x1ul << OTG_INTSTS_BVLDCHGIF_Pos) /*!< OTG_T::INTSTS: BVLDCHGIF Mask */
  314. #define OTG_INTSTS_AVLDCHGIF_Pos (9) /*!< OTG_T::INTSTS: AVLDCHGIF Position */
  315. #define OTG_INTSTS_AVLDCHGIF_Msk (0x1ul << OTG_INTSTS_AVLDCHGIF_Pos) /*!< OTG_T::INTSTS: AVLDCHGIF Mask */
  316. #define OTG_INTSTS_VBCHGIF_Pos (10) /*!< OTG_T::INTSTS: VBCHGIF Position */
  317. #define OTG_INTSTS_VBCHGIF_Msk (0x1ul << OTG_INTSTS_VBCHGIF_Pos) /*!< OTG_T::INTSTS: VBCHGIF Mask */
  318. #define OTG_INTSTS_SECHGIF_Pos (11) /*!< OTG_T::INTSTS: SECHGIF Position */
  319. #define OTG_INTSTS_SECHGIF_Msk (0x1ul << OTG_INTSTS_SECHGIF_Pos) /*!< OTG_T::INTSTS: SECHGIF Mask */
  320. #define OTG_INTSTS_SRPDETIF_Pos (13) /*!< OTG_T::INTSTS: SRPDETIF Position */
  321. #define OTG_INTSTS_SRPDETIF_Msk (0x1ul << OTG_INTSTS_SRPDETIF_Pos) /*!< OTG_T::INTSTS: SRPDETIF Mask */
  322. #define OTG_STATUS_OVERCUR_Pos (0) /*!< OTG_T::STATUS: OVERCUR Position */
  323. #define OTG_STATUS_OVERCUR_Msk (0x1ul << OTG_STATUS_OVERCUR_Pos) /*!< OTG_T::STATUS: OVERCUR Mask */
  324. #define OTG_STATUS_IDSTS_Pos (1) /*!< OTG_T::STATUS: IDSTS Position */
  325. #define OTG_STATUS_IDSTS_Msk (0x1ul << OTG_STATUS_IDSTS_Pos) /*!< OTG_T::STATUS: IDSTS Mask */
  326. #define OTG_STATUS_SESSEND_Pos (2) /*!< OTG_T::STATUS: SESSEND Position */
  327. #define OTG_STATUS_SESSEND_Msk (0x1ul << OTG_STATUS_SESSEND_Pos) /*!< OTG_T::STATUS: SESSEND Mask */
  328. #define OTG_STATUS_BVLD_Pos (3) /*!< OTG_T::STATUS: BVLD Position */
  329. #define OTG_STATUS_BVLD_Msk (0x1ul << OTG_STATUS_BVLD_Pos) /*!< OTG_T::STATUS: BVLD Mask */
  330. #define OTG_STATUS_AVLD_Pos (4) /*!< OTG_T::STATUS: AVLD Position */
  331. #define OTG_STATUS_AVLD_Msk (0x1ul << OTG_STATUS_AVLD_Pos) /*!< OTG_T::STATUS: AVLD Mask */
  332. #define OTG_STATUS_VBUSVLD_Pos (5) /*!< OTG_T::STATUS: VBUSVLD Position */
  333. #define OTG_STATUS_VBUSVLD_Msk (0x1ul << OTG_STATUS_VBUSVLD_Pos) /*!< OTG_T::STATUS: VBUSVLD Mask */
  334. #define OTG_STATUS_ASPERI_Pos (6) /*!< OTG_T::STATUS: ASPERI Position */
  335. #define OTG_STATUS_ASPERI_Msk (0x1ul << OTG_STATUS_ASPERI_Pos) /*!< OTG_T::STATUS: ASPERI Mask */
  336. #define OTG_STATUS_ASHOST_Pos (7) /*!< OTG_T::STATUS: ASHOST Position */
  337. #define OTG_STATUS_ASHOST_Msk (0x1ul << OTG_STATUS_ASHOST_Pos) /*!< OTG_T::STATUS: ASHOST Mask */
  338. /**@}*/ /* OTG_CONST */
  339. /**@}*/ /* end of OTG register group */
  340. /**@}*/ /* end of REGISTER group */
  341. #if defined ( __CC_ARM )
  342. #pragma no_anon_unions
  343. #endif
  344. #endif /* __OTG_REG_H__ */