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