usbd_reg.h 46 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649
  1. /**************************************************************************//**
  2. * @file usbd_reg.h
  3. * @version V1.00
  4. * @brief USBD 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 __USBD_REG_H__
  10. #define __USBD_REG_H__
  11. #if defined ( __CC_ARM )
  12. #pragma anon_unions
  13. #endif
  14. /**
  15. @addtogroup REGISTER Control Register
  16. @{
  17. */
  18. /**
  19. @addtogroup USBD USB Device Controller(USBD)
  20. Memory Mapped Structure for USBD Controller
  21. @{ */
  22. typedef struct
  23. {
  24. /**
  25. * @var USBD_EP_T::BUFSEG
  26. * Offset: 0x000 Endpoint n Buffer Segmentation Register
  27. * ---------------------------------------------------------------------------------------------------
  28. * |Bits |Field |Descriptions
  29. * | :----: | :----: | :---- |
  30. * |[8:3] |BUFSEG |Endpoint Buffer Segmentation
  31. * | | |It is used to indicate the offset address for each endpoint with the USB SRAM starting address The effective starting address of the endpoint is
  32. * | | |USBD_SRAM address + { BUFSEG, 3'b000}
  33. * | | |Where the USBD_SRAM address = USBD_BA+0x100h.
  34. * | | |Refer to the section 7.29.5.7 for the endpoint SRAM structure and its description.
  35. * @var USBD_EP_T::MXPLD
  36. * Offset: 0x004 Endpoint n Maximal Payload Register
  37. * ---------------------------------------------------------------------------------------------------
  38. * |Bits |Field |Descriptions
  39. * | :----: | :----: | :---- |
  40. * |[8:0] |MXPLD |Maximal Payload
  41. * | | |Define the data length which is transmitted to host (IN token) or the actual data length which is received from the host (OUT token)
  42. * | | |It also used to indicate that the endpoint is ready to be transmitted in IN token or received in OUT token.
  43. * | | |(1) When the register is written by CPU,
  44. * | | |For IN token, the value of MXPLD is used to define the data length to be transmitted and indicate the data buffer is ready.
  45. * | | |For OUT token, it means that the controller is ready to receive data from the host and the value of MXPLD is the maximal data length comes from host.
  46. * | | |(2) When the register is read by CPU,
  47. * | | |For IN token, the value of MXPLD is indicated by the data length be transmitted to host
  48. * | | |For OUT token, the value of MXPLD is indicated the actual data length receiving from host.
  49. * | | |Note: Once MXPLD is written, the data packets will be transmitted/received immediately after IN/OUT token arrived.
  50. * @var USBD_EP_T::CFG
  51. * Offset: 0x008 Endpoint n Configuration Register
  52. * ---------------------------------------------------------------------------------------------------
  53. * |Bits |Field |Descriptions
  54. * | :----: | :----: | :---- |
  55. * |[3:0] |EPNUM |Endpoint Number
  56. * | | |These bits are used to define the endpoint number of the current endpoint
  57. * |[4] |ISOCH |Isochronous Endpoint
  58. * | | |This bit is used to set the endpoint as Isochronous endpoint, no handshake.
  59. * | | |0 = No Isochronous endpoint.
  60. * | | |1 = Isochronous endpoint.
  61. * |[6:5] |STATE |Endpoint STATE
  62. * | | |00 = Endpoint is Disabled.
  63. * | | |01 = Out endpoint.
  64. * | | |10 = IN endpoint.
  65. * | | |11 = Undefined.
  66. * |[7] |DSQSYNC |Data Sequence Synchronization
  67. * | | |0 = DATA0 PID.
  68. * | | |1 = DATA1 PID.
  69. * | | |Note: It is used to specify the DATA0 or DATA1 PID in the following IN token transaction
  70. * | | |hardware will toggle automatically in IN token base on the bit.
  71. * |[9] |CSTALL |Clear STALL Response
  72. * | | |0 = Disable the device to clear the STALL handshake in setup stage.
  73. * | | |1 = Clear the device to response STALL handshake in setup stage.
  74. * @var USBD_EP_T::CFGP
  75. * Offset: 0x00C Endpoint n Set Stall and Clear In/Out Ready Control Register
  76. * ---------------------------------------------------------------------------------------------------
  77. * |Bits |Field |Descriptions
  78. * | :----: | :----: | :---- |
  79. * |[0] |CLRRDY |Clear Ready
  80. * | | |When the USBD_MXPLDx register is set by user, it means that the endpoint is ready to transmit or receive data
  81. * | | |If the user wants to disable this transaction before the transaction start, users can set this bit to 1 to disable it and it is auto clear to 0.
  82. * | | |For IN token, write '1' to clear the IN token had ready to transmit the data to USB.
  83. * | | |For OUT token, write '1' to clear the OUT token had ready to receive the data from USB.
  84. * | | |This bit is write 1 only and is always 0 when it is read back.
  85. * |[1] |SSTALL |Set STALL
  86. * | | |0 = Disable the device to response STALL.
  87. * | | |1 = Set the device to respond STALL automatically.
  88. */
  89. __IO uint32_t BUFSEG; /*!< [0x0000] Endpoint n Buffer Segmentation Register */
  90. __IO uint32_t MXPLD; /*!< [0x0004] Endpoint n Maximal Payload Register */
  91. __IO uint32_t CFG; /*!< [0x0008] Endpoint n Configuration Register */
  92. __IO uint32_t CFGP; /*!< [0x000c] Endpoint n Set Stall and Clear In/Out Ready Control Register */
  93. } USBD_EP_T;
  94. typedef struct
  95. {
  96. /**
  97. * @var USBD_T::INTEN
  98. * Offset: 0x00 USB Device Interrupt Enable Register
  99. * ---------------------------------------------------------------------------------------------------
  100. * |Bits |Field |Descriptions
  101. * | :----: | :----: | :---- |
  102. * |[0] |BUSIEN |Bus Event Interrupt Enable Bit
  103. * | | |0 = BUS event interrupt Disabled.
  104. * | | |1 = BUS event interrupt Enabled.
  105. * |[1] |USBIEN |USB Event Interrupt Enable Bit
  106. * | | |0 = USB event interrupt Disabled.
  107. * | | |1 = USB event interrupt Enabled.
  108. * |[2] |VBDETIEN |VBUS Detection Interrupt Enable Bit
  109. * | | |0 = VBUS detection Interrupt Disabled.
  110. * | | |1 = VBUS detection Interrupt Enabled.
  111. * |[3] |NEVWKIEN |USB No-event-wake-up Interrupt Enable Bit
  112. * | | |0 = No-event-wake-up Interrupt Disabled.
  113. * | | |1 = No-event-wake-up Interrupt Enabled.
  114. * |[4] |SOFIEN |Start of Frame Interrupt Enable Bit
  115. * | | |0 = SOF Interrupt Disabled.
  116. * | | |1 = SOF Interrupt Enabled.
  117. * |[8] |WKEN |Wake-up Function Enable Bit
  118. * | | |0 = USB wake-up function Disabled.
  119. * | | |1 = USB wake-up function Enabled.
  120. * |[15] |INNAKEN |Active NAK Function and Its Status in IN Token
  121. * | | |0 = When device responds NAK after receiving IN token, IN NAK status will not be updated to USBD_EPSTS0 and USBD_EPSTS1register, so that the USB interrupt event will not be asserted.
  122. * | | |1 = IN NAK status will be updated to USBD_EPSTS0 and USBD_EPSTS1 register and the USB interrupt event will be asserted, when the device responds NAK after receiving IN token.
  123. * @var USBD_T::INTSTS
  124. * Offset: 0x04 USB Device Interrupt Event Status Register
  125. * ---------------------------------------------------------------------------------------------------
  126. * |Bits |Field |Descriptions
  127. * | :----: | :----: | :---- |
  128. * |[0] |BUSIF |BUS Interrupt Status
  129. * | | |The BUS event means that there is one of the suspense or the resume function in the bus.
  130. * | | |0 = No BUS event occurred.
  131. * | | |1 = Bus event occurred; check USBD_ATTR[3:0] to know which kind of bus event was occurred, cleared by write 1 to USBD_INTSTS[0].
  132. * |[1] |USBIF |USB Event Interrupt Status
  133. * | | |The USB event includes the SETUP Token, IN Token, OUT ACK, ISO IN, or ISO OUT events in the bus.
  134. * | | |0 = No USB event occurred.
  135. * | | |1 = USB event occurred, check EPSTS0~5[2:0] to know which kind of USB event was occurred, cleared by write 1 to USBD_INTSTS[1] or EPSTS0~11 and SETUP (USBD_INTSTS[31]).
  136. * |[2] |VBDETIF |VBUS Detection Interrupt Status
  137. * | | |0 = There is not attached/detached event in the USB.
  138. * | | |1 = There is attached/detached event in the USB bus and it is cleared by write 1 to USBD_INTSTS[2].
  139. * |[3] |NEVWKIF |No-event-wake-up Interrupt Status
  140. * | | |0 = NEVWK event does not occur.
  141. * | | |1 = No-event-wake-up event occurred, cleared by write 1 to USBD_INTSTS[3].
  142. * |[4] |SOFIF |Start of Frame Interrupt Status
  143. * | | |0 = SOF event does not occur.
  144. * | | |1 = SOF event occurred, cleared by write 1 to USBD_INTSTS[4].
  145. * |[16] |EPEVT0 |Endpoint 0's USB Event Status
  146. * | | |0 = No event occurred in endpoint 0.
  147. * | | |1 = USB event occurred on Endpoint 0, check USBD_EPSTS0[3:0] to know which kind of USB event was occurred, cleared by write 1 to USBD_INTSTS[16] or USBD_INTSTS[1].
  148. * |[17] |EPEVT1 |Endpoint 1's USB Event Status
  149. * | | |0 = No event occurred in endpoint 1.
  150. * | | |1 = USB event occurred on Endpoint 1, check USBD_EPSTS0[7:4] to know which kind of USB event was occurred, cleared by write 1 to USBD_INTSTS[17] or USBD_INTSTS[1].
  151. * |[18] |EPEVT2 |Endpoint 2's USB Event Status
  152. * | | |0 = No event occurred in endpoint 2.
  153. * | | |1 = USB event occurred on Endpoint 2, check USBD_EPSTS0[11:8] to know which kind of USB event was occurred, cleared by write 1 to USBD_INTSTS[18] or USBD_INTSTS[1].
  154. * |[19] |EPEVT3 |Endpoint 3's USB Event Status
  155. * | | |0 = No event occurred in endpoint 3.
  156. * | | |1 = USB event occurred on Endpoint 3, check USBD_EPSTS0[15:12] to know which kind of USB event was occurred, cleared by write 1 to USBD_INTSTS[19] or USBD_INTSTS[1].
  157. * |[20] |EPEVT4 |Endpoint 4's USB Event Status
  158. * | | |0 = No event occurred in endpoint 4.
  159. * | | |1 = USB event occurred on Endpoint 4, check USBD_EPSTS0[19:16] to know which kind of USB event was occurred, cleared by write 1 to USBD_INTSTS[20] or USBD_INTSTS[1].
  160. * |[21] |EPEVT5 |Endpoint 5's USB Event Status
  161. * | | |0 = No event occurred in endpoint 5.
  162. * | | |1 = USB event occurred on Endpoint 5, check USBD_EPSTS0[23:20] to know which kind of USB event was occurred, cleared by write 1 to USBD_INTSTS[21] or USBD_INTSTS[1].
  163. * |[22] |EPEVT6 |Endpoint 6's USB Event Status
  164. * | | |0 = No event occurred in endpoint 6.
  165. * | | |1 = USB event occurred on Endpoint 6, check USBD_EPSTS0[27:24] to know which kind of USB event was occurred, cleared by write 1 to USBD_INTSTS[22] or USBD_INTSTS[1].
  166. * |[23] |EPEVT7 |Endpoint 7's USB Event Status
  167. * | | |0 = No event occurred in endpoint 7.
  168. * | | |1 = USB event occurred on Endpoint 7, check USBD_EPSTS0[31:28] to know which kind of USB event was occurred, cleared by write 1 to USBD_INTSTS[23] or USBD_INTSTS[1].
  169. * |[24] |EPEVT8 |Endpoint 8's USB Event Status
  170. * | | |0 = No event occurred in endpoint 8.
  171. * | | |1 = USB event occurred on Endpoint 8, check USBD_EPSTS1[3 :0] to know which kind of USB event was occurred, cleared by write 1 to USBD_INTSTS[24] or USBD_INTSTS[1].
  172. * |[25] |EPEVT9 |Endpoint 9's USB Event Status
  173. * | | |0 = No event occurred in endpoint 9.
  174. * | | |1 = USB event occurred on Endpoint 9, check USBD_EPSTS1[7 :4] to know which kind of USB event was occurred, cleared by write 1 to USBD_INTSTS[25] or USBD_INTSTS[1].
  175. * |[26] |EPEVT10 |Endpoint 10's USB Event Status
  176. * | | |0 = No event occurred in endpoint 10.
  177. * | | |1 = USB event occurred on Endpoint 10, check USBD_EPSTS1[11 :8] to know which kind of USB event was occurred, cleared by write 1 to USBD_INTSTS[26] or USBD_INTSTS[1].
  178. * |[27] |EPEVT11 |Endpoint 11's USB Event Status
  179. * | | |0 = No event occurred in endpoint 11.
  180. * | | |1 = USB event occurred on Endpoint 11, check USBD_EPSTS1[ 15:12] to know which kind of USB event was occurred, cleared by write 1 to USBD_INTSTS[27] or USBD_INTSTS[1].
  181. * |[31] |SETUP |Setup Event Status
  182. * | | |0 = No Setup event.
  183. * | | |1 = Setup event occurred, cleared by write 1 to USBD_INTSTS[31].
  184. * @var USBD_T::FADDR
  185. * Offset: 0x08 USB Device Function Address Register
  186. * ---------------------------------------------------------------------------------------------------
  187. * |Bits |Field |Descriptions
  188. * | :----: | :----: | :---- |
  189. * |[6:0] |FADDR |USB Device Function Address
  190. * @var USBD_T::EPSTS
  191. * Offset: 0x0C USB Device Endpoint Status Register
  192. * ---------------------------------------------------------------------------------------------------
  193. * |Bits |Field |Descriptions
  194. * | :----: | :----: | :---- |
  195. * |[7] |OV |Overrun
  196. * | | |It indicates that the received data is over the maximum payload number or not.
  197. * | | |0 = No overrun.
  198. * | | |1 = Out Data is more than the Max Payload in MXPLD register or the Setup Data is more than 8 Bytes.
  199. * @var USBD_T::ATTR
  200. * Offset: 0x10 USB Device Bus Status and Attribution Register
  201. * ---------------------------------------------------------------------------------------------------
  202. * |Bits |Field |Descriptions
  203. * | :----: | :----: | :---- |
  204. * |[0] |USBRST |USB Reset Status
  205. * | | |0 = Bus no reset.
  206. * | | |1 = Bus reset when SE0 (single-ended 0) more than 2.5us.
  207. * | | |Note: This bit is read only.
  208. * |[1] |SUSPEND |Suspend Status
  209. * | | |0 = Bus no suspend.
  210. * | | |1 = Bus idle more than 3ms, either cable is plugged off or host is sleeping.
  211. * | | |Note: This bit is read only.
  212. * |[2] |RESUME |Resume Status
  213. * | | |0 = No bus resume.
  214. * | | |1 = Resume from suspend.
  215. * | | |Note: This bit is read only.
  216. * |[3] |TOUT |Time-out Status
  217. * | | |0 = No time-out.
  218. * | | |1 = No Bus response more than 18 bits time.
  219. * | | |Note: This bit is read only.
  220. * |[4] |PHYEN |PHY Transceiver Function Enable Bit
  221. * | | |0 = PHY transceiver function Disabled.
  222. * | | |1 = PHY transceiver function Enabled.
  223. * |[5] |RWAKEUP |Remote Wake-up
  224. * | | |0 = Release the USB bus from K state.
  225. * | | |1 = Force USB bus to K (USB_D+ low, USB_D-: high) state, used for remote wake-up.
  226. * |[7] |USBEN |USB Controller Enable Bit
  227. * | | |0 = USB Controller Disabled.
  228. * | | |1 = USB Controller Enabled.
  229. * |[8] |DPPUEN |Pull-up Resistor on USB_DP Enable Bit
  230. * | | |0 = Pull-up resistor in USB_D+ bus Disabled.
  231. * | | |1 = Pull-up resistor in USB_D+ bus Active.
  232. * |[10] |BYTEM |CPU Access USB SRAM Size Mode Selection
  233. * | | |0 = Word mode: The size of the transfer from CPU to USB SRAM can be Word only.
  234. * | | |1 = Byte mode: The size of the transfer from CPU to USB SRAM can be Byte only.
  235. * |[11] |LPMACK |LPM Token Acknowledge Enable Bit
  236. * | | |The NYET/ACK will be returned only on a successful LPM transaction if no errors in both the EXT token and the LPM token and a valid bLinkState = 0001 (L1) is received, else ERROR and STALL will be returned automatically, respectively.
  237. * | | |0= the valid LPM Token will be NYET.
  238. * | | |1= the valid LPM Token will be ACK.
  239. * |[12] |L1SUSPEND |LPM L1 Suspend
  240. * | | |0 = Bus no L1 state suspend.
  241. * | | |1 = This bit is set by the hardware when LPM command to enter the L1 state is successfully received and acknowledged.
  242. * | | |Note: This bit is read only.
  243. * |[13] |L1RESUME |LPM L1 Resume
  244. * | | |0 = Bus no LPM L1 state resume.
  245. * | | |1 = LPM L1 state Resume from LPM L1 state suspend.
  246. * | | |Note: This bit is read only.
  247. * @var USBD_T::VBUSDET
  248. * Offset: 0x14 USB Device VBUS Detection Register
  249. * ---------------------------------------------------------------------------------------------------
  250. * |Bits |Field |Descriptions
  251. * | :----: | :----: | :---- |
  252. * |[0] |VBUSDET |Device VBUS Detection
  253. * | | |0 = Controller is not attached to the USB host.
  254. * | | |1 = Controller is attached to the USB host.
  255. * @var USBD_T::STBUFSEG
  256. * Offset: 0x18 SETUP Token Buffer Segmentation Register
  257. * ---------------------------------------------------------------------------------------------------
  258. * |Bits |Field |Descriptions
  259. * | :----: | :----: | :---- |
  260. * |[8:3] |STBUFSEG |SETUP Token Buffer Segmentation
  261. * | | |It is used to indicate the offset address for the SETUP token with the USB Device SRAM starting address The effective starting address is
  262. * | | |USBD_SRAM address + {STBUFSEG, 3'b000}
  263. * | | |Where the USBD_SRAM address = USBD_BA+0x100h.
  264. * | | |Note: It is used for SETUP token only.
  265. * @var USBD_T::EPSTS0
  266. * Offset: 0x20 USB Device Endpoint Status Register 0
  267. * ---------------------------------------------------------------------------------------------------
  268. * |Bits |Field |Descriptions
  269. * | :----: | :----: | :---- |
  270. * |[03:00] |EPSTS0 |Endpoint 0 Status
  271. * | | |These bits are used to indicate the current status of this endpoint
  272. * | | |0000 = In ACK.
  273. * | | |0001 = In NAK.
  274. * | | |0010 = Out Packet Data0 ACK.
  275. * | | |0011 = Setup ACK.
  276. * | | |0110 = Out Packet Data1 ACK.
  277. * | | |0111 = Isochronous transfer end.
  278. * |[07:04] |EPSTS1 |Endpoint 1 Status
  279. * | | |These bits are used to indicate the current status of this endpoint
  280. * | | |0000 = In ACK.
  281. * | | |0001 = In NAK.
  282. * | | |0010 = Out Packet Data0 ACK.
  283. * | | |0011 = Setup ACK.
  284. * | | |0110 = Out Packet Data1 ACK.
  285. * | | |0111 = Isochronous transfer end.
  286. * |[11:08] |EPSTS2 |Endpoint 2 Status
  287. * | | |These bits are used to indicate the current status of this endpoint
  288. * | | |0000 = In ACK.
  289. * | | |0001 = In NAK.
  290. * | | |0010 = Out Packet Data0 ACK.
  291. * | | |0011 = Setup ACK.
  292. * | | |0110 = Out Packet Data1 ACK.
  293. * | | |0111 = Isochronous transfer end.
  294. * |[15:12] |EPSTS3 |Endpoint 3 Status
  295. * | | |These bits are used to indicate the current status of this endpoint
  296. * | | |0000 = In ACK.
  297. * | | |0001 = In NAK.
  298. * | | |0010 = Out Packet Data0 ACK.
  299. * | | |0011 = Setup ACK.
  300. * | | |0110 = Out Packet Data1 ACK.
  301. * | | |0111 = Isochronous transfer end.
  302. * |[19:16] |EPSTS4 |Endpoint 4 Status
  303. * | | |These bits are used to indicate the current status of this endpoint
  304. * | | |0000 = In ACK.
  305. * | | |0001 = In NAK.
  306. * | | |0010 = Out Packet Data0 ACK.
  307. * | | |0011 = Setup ACK.
  308. * | | |0110 = Out Packet Data1 ACK.
  309. * | | |0111 = Isochronous transfer end.
  310. * |[23:20] |EPSTS5 |Endpoint 5 Status
  311. * | | |These bits are used to indicate the current status of this endpoint
  312. * | | |0000 = In ACK.
  313. * | | |0001 = In NAK.
  314. * | | |0010 = Out Packet Data0 ACK.
  315. * | | |0011 = Setup ACK.
  316. * | | |0110 = Out Packet Data1 ACK.
  317. * | | |0111 = Isochronous transfer end.
  318. * |[27:24] |EPSTS6 |Endpoint 6 Status
  319. * | | |These bits are used to indicate the current status of this endpoint
  320. * | | |0000 = In ACK.
  321. * | | |0001 = In NAK.
  322. * | | |0010 = Out Packet Data0 ACK.
  323. * | | |0011 = Setup ACK.
  324. * | | |0110 = Out Packet Data1 ACK.
  325. * | | |0111 = Isochronous transfer end.
  326. * |[31:28] |EPSTS7 |Endpoint 7 Status
  327. * | | |These bits are used to indicate the current status of this endpoint
  328. * | | |0000 = In ACK.
  329. * | | |0001 = In NAK.
  330. * | | |0010 = Out Packet Data0 ACK.
  331. * | | |0011 = Setup ACK.
  332. * | | |0110 = Out Packet Data1 ACK.
  333. * | | |0111 = Isochronous transfer end.
  334. * @var USBD_T::EPSTS1
  335. * Offset: 0x24 USB Device Endpoint Status Register 1
  336. * ---------------------------------------------------------------------------------------------------
  337. * |Bits |Field |Descriptions
  338. * | :----: | :----: | :---- |
  339. * |[3:0] |EPSTS8 |Endpoint 8 Status
  340. * | | |These bits are used to indicate the current status of this endpoint
  341. * | | |0000 = In ACK.
  342. * | | |0001 = In NAK.
  343. * | | |0010 = Out Packet Data0 ACK.
  344. * | | |0011 = Setup ACK.
  345. * | | |0110 = Out Packet Data1 ACK.
  346. * | | |0111 = Isochronous transfer end.
  347. * |[7:4] |EPSTS9 |Endpoint 9 Status
  348. * | | |These bits are used to indicate the current status of this endpoint
  349. * | | |0000 = In ACK.
  350. * | | |0001 = In NAK.
  351. * | | |0010 = Out Packet Data0 ACK.
  352. * | | |0011 = Setup ACK.
  353. * | | |0110 = Out Packet Data1 ACK.
  354. * | | |0111 = Isochronous transfer end.
  355. * |[11:8] |EPSTS10 |Endpoint 10 Status
  356. * | | |These bits are used to indicate the current status of this endpoint
  357. * | | |0000 = In ACK.
  358. * | | |0001 = In NAK.
  359. * | | |0010 = Out Packet Data0 ACK.
  360. * | | |0011 = Setup ACK.
  361. * | | |0110 = Out Packet Data1 ACK.
  362. * | | |0111 = Isochronous transfer end.
  363. * |[15:12] |EPSTS11 |Endpoint 11 Status
  364. * | | |These bits are used to indicate the current status of this endpoint
  365. * | | |0000 = In ACK.
  366. * | | |0001 = In NAK.
  367. * | | |0010 = Out Packet Data0 ACK.
  368. * | | |0011 = Setup ACK.
  369. * | | |0110 = Out Packet Data1 ACK.
  370. * | | |0111 = Isochronous transfer end.
  371. * @var USBD_T::LPMATTR
  372. * Offset: 0x88 USB LPM Attribution Register
  373. * ---------------------------------------------------------------------------------------------------
  374. * |Bits |Field |Descriptions
  375. * | :----: | :----: | :---- |
  376. * |[3:0] |LPMLINKSTS|LPM Link State
  377. * | | |These bits contain the bLinkState received with last ACK LPM Token
  378. * |[7:4] |LPMBESL |LPM Best Effort Service Latency
  379. * | | |These bits contain the BESL value received with last ACK LPM Token
  380. * |[8] |LPMRWAKUP |LPM Remote Wakeup
  381. * | | |This bit contains the bRemoteWake value received with last ACK LPM Token
  382. * @var USBD_T::FN
  383. * Offset: 0x8C USB Frame number Register
  384. * ---------------------------------------------------------------------------------------------------
  385. * |Bits |Field |Descriptions
  386. * | :----: | :----: | :---- |
  387. * |[10:0] |FN |Frame Number
  388. * | | |These bits contain the 11-bits frame number in the last received SOF packet.
  389. * @var USBD_T::SE0
  390. * Offset: 0x90 USB Device Drive SE0 Control Register
  391. * ---------------------------------------------------------------------------------------------------
  392. * |Bits |Field |Descriptions
  393. * | :----: | :----: | :---- |
  394. * |[0] |SE0 |Drive Single Ended Zero in USB Bus
  395. * | | |The Single Ended Zero (SE0) is when both lines (USB_D+ and USB_D-) are being pulled low.
  396. * | | |0 = Normal operation.
  397. * | | |1 = Force USB PHY transceiver to drive SE0.
  398. */
  399. __IO uint32_t INTEN; /*!< [0x0000] USB Device Interrupt Enable Register */
  400. __IO uint32_t INTSTS; /*!< [0x0004] USB Device Interrupt Event Status Register */
  401. __IO uint32_t FADDR; /*!< [0x0008] USB Device Function Address Register */
  402. __I uint32_t EPSTS; /*!< [0x000c] USB Device Endpoint Status Register */
  403. __IO uint32_t ATTR; /*!< [0x0010] USB Device Bus Status and Attribution Register */
  404. __I uint32_t VBUSDET; /*!< [0x0014] USB Device VBUS Detection Register */
  405. __IO uint32_t STBUFSEG; /*!< [0x0018] SETUP Token Buffer Segmentation Register */
  406. /// @cond HIDDEN_SYMBOLS
  407. __I uint32_t RESERVE0[1];
  408. /// @endcond //HIDDEN_SYMBOLS
  409. __I uint32_t EPSTS0; /*!< [0x0020] USB Device Endpoint Status Register 0 */
  410. __I uint32_t EPSTS1; /*!< [0x0024] USB Device Endpoint Status Register 1 */
  411. /// @cond HIDDEN_SYMBOLS
  412. __I uint32_t RESERVE1[24];
  413. /// @endcond //HIDDEN_SYMBOLS
  414. __I uint32_t LPMATTR; /*!< [0x0088] USB LPM Attribution Register */
  415. __I uint32_t FN; /*!< [0x008c] USB Frame number Register */
  416. __IO uint32_t SE0; /*!< [0x0090] USB Device Drive SE0 Control Register */
  417. /// @cond HIDDEN_SYMBOLS
  418. __I uint32_t RESERVE2[283];
  419. /// @endcond //HIDDEN_SYMBOLS
  420. USBD_EP_T EP[12]; /*!< [0x500~0x5bc] USB End Point 0 ~ 11 Configuration Register */
  421. } USBD_T;
  422. /**
  423. @addtogroup USBD_CONST USBD Bit Field Definition
  424. Constant Definitions for USBD Controller
  425. @{ */
  426. #define USBD_INTEN_BUSIEN_Pos (0) /*!< USBD_T::INTEN: BUSIEN Position */
  427. #define USBD_INTEN_BUSIEN_Msk (0x1ul << USBD_INTEN_BUSIEN_Pos) /*!< USBD_T::INTEN: BUSIEN Mask */
  428. #define USBD_INTEN_USBIEN_Pos (1) /*!< USBD_T::INTEN: USBIEN Position */
  429. #define USBD_INTEN_USBIEN_Msk (0x1ul << USBD_INTEN_USBIEN_Pos) /*!< USBD_T::INTEN: USBIEN Mask */
  430. #define USBD_INTEN_VBDETIEN_Pos (2) /*!< USBD_T::INTEN: VBDETIEN Position */
  431. #define USBD_INTEN_VBDETIEN_Msk (0x1ul << USBD_INTEN_VBDETIEN_Pos) /*!< USBD_T::INTEN: VBDETIEN Mask */
  432. #define USBD_INTEN_NEVWKIEN_Pos (3) /*!< USBD_T::INTEN: NEVWKIEN Position */
  433. #define USBD_INTEN_NEVWKIEN_Msk (0x1ul << USBD_INTEN_NEVWKIEN_Pos) /*!< USBD_T::INTEN: NEVWKIEN Mask */
  434. #define USBD_INTEN_SOFIEN_Pos (4) /*!< USBD_T::INTEN: SOFIEN Position */
  435. #define USBD_INTEN_SOFIEN_Msk (0x1ul << USBD_INTEN_SOFIEN_Pos) /*!< USBD_T::INTEN: SOFIEN Mask */
  436. #define USBD_INTEN_WKEN_Pos (8) /*!< USBD_T::INTEN: WKEN Position */
  437. #define USBD_INTEN_WKEN_Msk (0x1ul << USBD_INTEN_WKEN_Pos) /*!< USBD_T::INTEN: WKEN Mask */
  438. #define USBD_INTEN_INNAKEN_Pos (15) /*!< USBD_T::INTEN: INNAKEN Position */
  439. #define USBD_INTEN_INNAKEN_Msk (0x1ul << USBD_INTEN_INNAKEN_Pos) /*!< USBD_T::INTEN: INNAKEN Mask */
  440. #define USBD_INTSTS_BUSIF_Pos (0) /*!< USBD_T::INTSTS: BUSIF Position */
  441. #define USBD_INTSTS_BUSIF_Msk (0x1ul << USBD_INTSTS_BUSIF_Pos) /*!< USBD_T::INTSTS: BUSIF Mask */
  442. #define USBD_INTSTS_USBIF_Pos (1) /*!< USBD_T::INTSTS: USBIF Position */
  443. #define USBD_INTSTS_USBIF_Msk (0x1ul << USBD_INTSTS_USBIF_Pos) /*!< USBD_T::INTSTS: USBIF Mask */
  444. #define USBD_INTSTS_VBDETIF_Pos (2) /*!< USBD_T::INTSTS: VBDETIF Position */
  445. #define USBD_INTSTS_VBDETIF_Msk (0x1ul << USBD_INTSTS_VBDETIF_Pos) /*!< USBD_T::INTSTS: VBDETIF Mask */
  446. #define USBD_INTSTS_NEVWKIF_Pos (3) /*!< USBD_T::INTSTS: NEVWKIF Position */
  447. #define USBD_INTSTS_NEVWKIF_Msk (0x1ul << USBD_INTSTS_NEVWKIF_Pos) /*!< USBD_T::INTSTS: NEVWKIF Mask */
  448. #define USBD_INTSTS_SOFIF_Pos (4) /*!< USBD_T::INTSTS: SOFIF Position */
  449. #define USBD_INTSTS_SOFIF_Msk (0x1ul << USBD_INTSTS_SOFIF_Pos) /*!< USBD_T::INTSTS: SOFIF Mask */
  450. #define USBD_INTSTS_EPEVT0_Pos (16) /*!< USBD_T::INTSTS: EPEVT0 Position */
  451. #define USBD_INTSTS_EPEVT0_Msk (0x1ul << USBD_INTSTS_EPEVT0_Pos) /*!< USBD_T::INTSTS: EPEVT0 Mask */
  452. #define USBD_INTSTS_EPEVT1_Pos (17) /*!< USBD_T::INTSTS: EPEVT1 Position */
  453. #define USBD_INTSTS_EPEVT1_Msk (0x1ul << USBD_INTSTS_EPEVT1_Pos) /*!< USBD_T::INTSTS: EPEVT1 Mask */
  454. #define USBD_INTSTS_EPEVT2_Pos (18) /*!< USBD_T::INTSTS: EPEVT2 Position */
  455. #define USBD_INTSTS_EPEVT2_Msk (0x1ul << USBD_INTSTS_EPEVT2_Pos) /*!< USBD_T::INTSTS: EPEVT2 Mask */
  456. #define USBD_INTSTS_EPEVT3_Pos (19) /*!< USBD_T::INTSTS: EPEVT3 Position */
  457. #define USBD_INTSTS_EPEVT3_Msk (0x1ul << USBD_INTSTS_EPEVT3_Pos) /*!< USBD_T::INTSTS: EPEVT3 Mask */
  458. #define USBD_INTSTS_EPEVT4_Pos (20) /*!< USBD_T::INTSTS: EPEVT4 Position */
  459. #define USBD_INTSTS_EPEVT4_Msk (0x1ul << USBD_INTSTS_EPEVT4_Pos) /*!< USBD_T::INTSTS: EPEVT4 Mask */
  460. #define USBD_INTSTS_EPEVT5_Pos (21) /*!< USBD_T::INTSTS: EPEVT5 Position */
  461. #define USBD_INTSTS_EPEVT5_Msk (0x1ul << USBD_INTSTS_EPEVT5_Pos) /*!< USBD_T::INTSTS: EPEVT5 Mask */
  462. #define USBD_INTSTS_EPEVT6_Pos (22) /*!< USBD_T::INTSTS: EPEVT6 Position */
  463. #define USBD_INTSTS_EPEVT6_Msk (0x1ul << USBD_INTSTS_EPEVT6_Pos) /*!< USBD_T::INTSTS: EPEVT6 Mask */
  464. #define USBD_INTSTS_EPEVT7_Pos (23) /*!< USBD_T::INTSTS: EPEVT7 Position */
  465. #define USBD_INTSTS_EPEVT7_Msk (0x1ul << USBD_INTSTS_EPEVT7_Pos) /*!< USBD_T::INTSTS: EPEVT7 Mask */
  466. #define USBD_INTSTS_EPEVT8_Pos (24) /*!< USBD_T::INTSTS: EPEVT8 Position */
  467. #define USBD_INTSTS_EPEVT8_Msk (0x1ul << USBD_INTSTS_EPEVT8_Pos) /*!< USBD_T::INTSTS: EPEVT8 Mask */
  468. #define USBD_INTSTS_EPEVT9_Pos (25) /*!< USBD_T::INTSTS: EPEVT9 Position */
  469. #define USBD_INTSTS_EPEVT9_Msk (0x1ul << USBD_INTSTS_EPEVT9_Pos) /*!< USBD_T::INTSTS: EPEVT9 Mask */
  470. #define USBD_INTSTS_EPEVT10_Pos (26) /*!< USBD_T::INTSTS: EPEVT10 Position */
  471. #define USBD_INTSTS_EPEVT10_Msk (0x1ul << USBD_INTSTS_EPEVT10_Pos) /*!< USBD_T::INTSTS: EPEVT10 Mask */
  472. #define USBD_INTSTS_EPEVT11_Pos (27) /*!< USBD_T::INTSTS: EPEVT11 Position */
  473. #define USBD_INTSTS_EPEVT11_Msk (0x1ul << USBD_INTSTS_EPEVT11_Pos) /*!< USBD_T::INTSTS: EPEVT11 Mask */
  474. #define USBD_INTSTS_SETUP_Pos (31) /*!< USBD_T::INTSTS: SETUP Position */
  475. #define USBD_INTSTS_SETUP_Msk (0x1ul << USBD_INTSTS_SETUP_Pos) /*!< USBD_T::INTSTS: SETUP Mask */
  476. #define USBD_FADDR_FADDR_Pos (0) /*!< USBD_T::FADDR: FADDR Position */
  477. #define USBD_FADDR_FADDR_Msk (0x7ful << USBD_FADDR_FADDR_Pos) /*!< USBD_T::FADDR: FADDR Mask */
  478. #define USBD_EPSTS_OV_Pos (7) /*!< USBD_T::EPSTS: OV Position */
  479. #define USBD_EPSTS_OV_Msk (0x1ul << USBD_EPSTS_OV_Pos) /*!< USBD_T::EPSTS: OV Mask */
  480. #define USBD_ATTR_USBRST_Pos (0) /*!< USBD_T::ATTR: USBRST Position */
  481. #define USBD_ATTR_USBRST_Msk (0x1ul << USBD_ATTR_USBRST_Pos) /*!< USBD_T::ATTR: USBRST Mask */
  482. #define USBD_ATTR_SUSPEND_Pos (1) /*!< USBD_T::ATTR: SUSPEND Position */
  483. #define USBD_ATTR_SUSPEND_Msk (0x1ul << USBD_ATTR_SUSPEND_Pos) /*!< USBD_T::ATTR: SUSPEND Mask */
  484. #define USBD_ATTR_RESUME_Pos (2) /*!< USBD_T::ATTR: RESUME Position */
  485. #define USBD_ATTR_RESUME_Msk (0x1ul << USBD_ATTR_RESUME_Pos) /*!< USBD_T::ATTR: RESUME Mask */
  486. #define USBD_ATTR_TOUT_Pos (3) /*!< USBD_T::ATTR: TOUT Position */
  487. #define USBD_ATTR_TOUT_Msk (0x1ul << USBD_ATTR_TOUT_Pos) /*!< USBD_T::ATTR: TOUT Mask */
  488. #define USBD_ATTR_PHYEN_Pos (4) /*!< USBD_T::ATTR: PHYEN Position */
  489. #define USBD_ATTR_PHYEN_Msk (0x1ul << USBD_ATTR_PHYEN_Pos) /*!< USBD_T::ATTR: PHYEN Mask */
  490. #define USBD_ATTR_RWAKEUP_Pos (5) /*!< USBD_T::ATTR: RWAKEUP Position */
  491. #define USBD_ATTR_RWAKEUP_Msk (0x1ul << USBD_ATTR_RWAKEUP_Pos) /*!< USBD_T::ATTR: RWAKEUP Mask */
  492. #define USBD_ATTR_USBEN_Pos (7) /*!< USBD_T::ATTR: USBEN Position */
  493. #define USBD_ATTR_USBEN_Msk (0x1ul << USBD_ATTR_USBEN_Pos) /*!< USBD_T::ATTR: USBEN Mask */
  494. #define USBD_ATTR_DPPUEN_Pos (8) /*!< USBD_T::ATTR: DPPUEN Position */
  495. #define USBD_ATTR_DPPUEN_Msk (0x1ul << USBD_ATTR_DPPUEN_Pos) /*!< USBD_T::ATTR: DPPUEN Mask */
  496. #define USBD_ATTR_BYTEM_Pos (10) /*!< USBD_T::ATTR: BYTEM Position */
  497. #define USBD_ATTR_BYTEM_Msk (0x1ul << USBD_ATTR_BYTEM_Pos) /*!< USBD_T::ATTR: BYTEM Mask */
  498. #define USBD_ATTR_LPMACK_Pos (11) /*!< USBD_T::ATTR: LPMACK Position */
  499. #define USBD_ATTR_LPMACK_Msk (0x1ul << USBD_ATTR_LPMACK_Pos) /*!< USBD_T::ATTR: LPMACK Mask */
  500. #define USBD_ATTR_L1SUSPEND_Pos (12) /*!< USBD_T::ATTR: L1SUSPEND Position */
  501. #define USBD_ATTR_L1SUSPEND_Msk (0x1ul << USBD_ATTR_L1SUSPEND_Pos) /*!< USBD_T::ATTR: L1SUSPEND Mask */
  502. #define USBD_ATTR_L1RESUME_Pos (13) /*!< USBD_T::ATTR: L1RESUME Position */
  503. #define USBD_ATTR_L1RESUME_Msk (0x1ul << USBD_ATTR_L1RESUME_Pos) /*!< USBD_T::ATTR: L1RESUME Mask */
  504. #define USBD_VBUSDET_VBUSDET_Pos (0) /*!< USBD_T::VBUSDET: VBUSDET Position */
  505. #define USBD_VBUSDET_VBUSDET_Msk (0x1ul << USBD_VBUSDET_VBUSDET_Pos) /*!< USBD_T::VBUSDET: VBUSDET Mask */
  506. #define USBD_STBUFSEG_STBUFSEG_Pos (3) /*!< USBD_T::STBUFSEG: STBUFSEG Position */
  507. #define USBD_STBUFSEG_STBUFSEG_Msk (0x3ful << USBD_STBUFSEG_STBUFSEG_Pos) /*!< USBD_T::STBUFSEG: STBUFSEG Mask */
  508. #define USBD_EPSTS0_EPSTS0_Pos (0) /*!< USBD_T::EPSTS0: EPSTS0 Position */
  509. #define USBD_EPSTS0_EPSTS0_Msk (0xful << USBD_EPSTS0_EPSTS0_Pos) /*!< USBD_T::EPSTS0: EPSTS0 Mask */
  510. #define USBD_EPSTS0_EPSTS1_Pos (4) /*!< USBD_T::EPSTS0: EPSTS1 Position */
  511. #define USBD_EPSTS0_EPSTS1_Msk (0xful << USBD_EPSTS0_EPSTS1_Pos) /*!< USBD_T::EPSTS0: EPSTS1 Mask */
  512. #define USBD_EPSTS0_EPSTS2_Pos (8) /*!< USBD_T::EPSTS0: EPSTS2 Position */
  513. #define USBD_EPSTS0_EPSTS2_Msk (0xful << USBD_EPSTS0_EPSTS2_Pos) /*!< USBD_T::EPSTS0: EPSTS2 Mask */
  514. #define USBD_EPSTS0_EPSTS3_Pos (12) /*!< USBD_T::EPSTS0: EPSTS3 Position */
  515. #define USBD_EPSTS0_EPSTS3_Msk (0xful << USBD_EPSTS0_EPSTS3_Pos) /*!< USBD_T::EPSTS0: EPSTS3 Mask */
  516. #define USBD_EPSTS0_EPSTS4_Pos (16) /*!< USBD_T::EPSTS0: EPSTS4 Position */
  517. #define USBD_EPSTS0_EPSTS4_Msk (0xful << USBD_EPSTS0_EPSTS4_Pos) /*!< USBD_T::EPSTS0: EPSTS4 Mask */
  518. #define USBD_EPSTS0_EPSTS5_Pos (20) /*!< USBD_T::EPSTS0: EPSTS5 Position */
  519. #define USBD_EPSTS0_EPSTS5_Msk (0xful << USBD_EPSTS0_EPSTS5_Pos) /*!< USBD_T::EPSTS0: EPSTS5 Mask */
  520. #define USBD_EPSTS0_EPSTS6_Pos (24) /*!< USBD_T::EPSTS0: EPSTS6 Position */
  521. #define USBD_EPSTS0_EPSTS6_Msk (0xful << USBD_EPSTS0_EPSTS6_Pos) /*!< USBD_T::EPSTS0: EPSTS6 Mask */
  522. #define USBD_EPSTS0_EPSTS7_Pos (28) /*!< USBD_T::EPSTS0: EPSTS7 Position */
  523. #define USBD_EPSTS0_EPSTS7_Msk (0xful << USBD_EPSTS0_EPSTS7_Pos) /*!< USBD_T::EPSTS0: EPSTS7 Mask */
  524. #define USBD_EPSTS1_EPSTS8_Pos (0) /*!< USBD_T::EPSTS1: EPSTS8 Position */
  525. #define USBD_EPSTS1_EPSTS8_Msk (0xful << USBD_EPSTS1_EPSTS8_Pos) /*!< USBD_T::EPSTS1: EPSTS8 Mask */
  526. #define USBD_EPSTS1_EPSTS9_Pos (4) /*!< USBD_T::EPSTS1: EPSTS9 Position */
  527. #define USBD_EPSTS1_EPSTS9_Msk (0xful << USBD_EPSTS1_EPSTS9_Pos) /*!< USBD_T::EPSTS1: EPSTS9 Mask */
  528. #define USBD_EPSTS1_EPSTS10_Pos (8) /*!< USBD_T::EPSTS1: EPSTS10 Position */
  529. #define USBD_EPSTS1_EPSTS10_Msk (0xful << USBD_EPSTS1_EPSTS10_Pos) /*!< USBD_T::EPSTS1: EPSTS10 Mask */
  530. #define USBD_EPSTS1_EPSTS11_Pos (12) /*!< USBD_T::EPSTS1: EPSTS11 Position */
  531. #define USBD_EPSTS1_EPSTS11_Msk (0xful << USBD_EPSTS1_EPSTS11_Pos) /*!< USBD_T::EPSTS1: EPSTS11 Mask */
  532. #define USBD_LPMATTR_LPMLINKSTS_Pos (0) /*!< USBD_T::LPMATTR: LPMLINKSTS Position */
  533. #define USBD_LPMATTR_LPMLINKSTS_Msk (0xful << USBD_LPMATTR_LPMLINKSTS_Pos) /*!< USBD_T::LPMATTR: LPMLINKSTS Mask */
  534. #define USBD_LPMATTR_LPMBESL_Pos (4) /*!< USBD_T::LPMATTR: LPMBESL Position */
  535. #define USBD_LPMATTR_LPMBESL_Msk (0xful << USBD_LPMATTR_LPMBESL_Pos) /*!< USBD_T::LPMATTR: LPMBESL Mask */
  536. #define USBD_LPMATTR_LPMRWAKUP_Pos (8) /*!< USBD_T::LPMATTR: LPMRWAKUP Position */
  537. #define USBD_LPMATTR_LPMRWAKUP_Msk (0x1ul << USBD_LPMATTR_LPMRWAKUP_Pos) /*!< USBD_T::LPMATTR: LPMRWAKUP Mask */
  538. #define USBD_FN_FN_Pos (0) /*!< USBD_T::FN: FN Position */
  539. #define USBD_FN_FN_Msk (0x7fful << USBD_FN_FN_Pos) /*!< USBD_T::FN: FN Mask */
  540. #define USBD_SE0_SE0_Pos (0) /*!< USBD_T::SE0: SE0 Position */
  541. #define USBD_SE0_SE0_Msk (0x1ul << USBD_SE0_SE0_Pos) /*!< USBD_T::SE0: SE0 Mask */
  542. #define USBD_BUFSEG_BUFSEG_Pos (3) /*!< USBD_EP_T::BUFSEG: BUFSEG Position */
  543. #define USBD_BUFSEG_BUFSEG_Msk (0x3ful << USBD_BUFSEG_BUFSEG_Pos) /*!< USBD_EP_T::BUFSEG: BUFSEG Mask */
  544. #define USBD_MXPLD_MXPLD_Pos (0) /*!< USBD_EP_T::MXPLD: MXPLD Position */
  545. #define USBD_MXPLD_MXPLD_Msk (0x1fful << USBD_MXPLD_MXPLD_Pos) /*!< USBD_EP_T::MXPLD: MXPLD Mask */
  546. #define USBD_CFG_EPNUM_Pos (0) /*!< USBD_EP_T::CFG: EPNUM Position */
  547. #define USBD_CFG_EPNUM_Msk (0xful << USBD_CFG_EPNUM_Pos) /*!< USBD_EP_T::CFG: EPNUM Mask */
  548. #define USBD_CFG_ISOCH_Pos (4) /*!< USBD_EP_T::CFG: ISOCH Position */
  549. #define USBD_CFG_ISOCH_Msk (0x1ul << USBD_CFG_ISOCH_Pos) /*!< USBD_EP_T::CFG: ISOCH Mask */
  550. #define USBD_CFG_STATE_Pos (5) /*!< USBD_EP_T::CFG: STATE Position */
  551. #define USBD_CFG_STATE_Msk (0x3ul << USBD_CFG_STATE_Pos) /*!< USBD_EP_T::CFG: STATE Mask */
  552. #define USBD_CFG_DSQSYNC_Pos (7) /*!< USBD_EP_T::CFG: DSQSYNC Position */
  553. #define USBD_CFG_DSQSYNC_Msk (0x1ul << USBD_CFG_DSQSYNC_Pos) /*!< USBD_EP_T::CFG: DSQSYNC Mask */
  554. #define USBD_CFG_CSTALL_Pos (9) /*!< USBD_EP_T::CFG: CSTALL Position */
  555. #define USBD_CFG_CSTALL_Msk (0x1ul << USBD_CFG_CSTALL_Pos) /*!< USBD_EP_T::CFG: CSTALL Mask */
  556. #define USBD_CFGP_CLRRDY_Pos (0) /*!< USBD_EP_T::CFGP: CLRRDY Position */
  557. #define USBD_CFGP_CLRRDY_Msk (0x1ul << USBD_CFGP_CLRRDY_Pos) /*!< USBD_EP_T::CFGP: CLRRDY Mask */
  558. #define USBD_CFGP_SSTALL_Pos (1) /*!< USBD_EP_T::CFGP: SSTALL Position */
  559. #define USBD_CFGP_SSTALL_Msk (0x1ul << USBD_CFGP_SSTALL_Pos) /*!< USBD_EP_T::CFGP: SSTALL Mask */
  560. /**@}*/ /* USBD_CONST */
  561. /**@}*/ /* end of USBD register group */
  562. /**@}*/ /* end of REGISTER group */
  563. #if defined ( __CC_ARM )
  564. #pragma no_anon_unions
  565. #endif
  566. #endif /* __USBD_REG_H__ */