config.h 120 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524
  1. /**************************************************************************//**
  2. * @file config.h
  3. * @version V1.00
  4. * @brief This header file defines the configuration of USB Host library.
  5. * @note
  6. * SPDX-License-Identifier: Apache-2.0
  7. * Copyright (C) 2018 Nuvoton Technology Corp. All rights reserved.
  8. *****************************************************************************/
  9. #ifndef _USBH_CONFIG_H_
  10. #define _USBH_CONFIG_H_
  11. /// @cond HIDDEN_SYMBOLS
  12. #include <rtthread.h>
  13. #include "N9H30.h"
  14. #include "nu_sys.h"
  15. #include "drv_sys.h"
  16. /*----------------------------------------------------------------------------------------*/
  17. /* Hardware settings */
  18. /*----------------------------------------------------------------------------------------*/
  19. #define HCLK_MHZ 300 /* used for loop-delay. must be larger than
  20. true HCLK clock MHz */
  21. #define NON_CACHE_MASK (0x80000000)
  22. #define ENABLE_OHCI_IRQ() rt_hw_interrupt_umask(IRQ_OHCI)
  23. #define DISABLE_OHCI_IRQ() rt_hw_interrupt_mask(IRQ_OHCI)
  24. #define IS_OHCI_IRQ_ENABLED() ((inpw(REG_AIC_IMR)>>OHCI_IRQn) & 0x1)
  25. #define ENABLE_EHCI_IRQ() rt_hw_interrupt_umask(IRQ_EHCI)
  26. #define DISABLE_EHCI_IRQ() rt_hw_interrupt_mask(IRQ_EHCI)
  27. #define IS_EHCI_IRQ_ENABLED() ((inpw(REG_AIC_IMR)>>EHCI_IRQn) & 0x1)
  28. #define ENABLE_OHCI /* Enable OHCI host controller */
  29. #define ENABLE_EHCI /* Enable EHCI host controller */
  30. #define EHCI_PORT_CNT 2 /* Number of EHCI roothub ports */
  31. #define OHCI_PORT_CNT 2 /* Number of OHCI roothub ports */
  32. //#define OHCI_PER_PORT_POWER /* OHCI root hub per port powered */
  33. #define OHCI_ISO_DELAY 4 /* preserved number frames while scheduling
  34. OHCI isochronous transfer */
  35. #define EHCI_ISO_DELAY 2 /* preserved number of frames while
  36. scheduling EHCI isochronous transfer */
  37. #define EHCI_ISO_RCLM_RANGE 32 /* When inspecting activated iTD/siTD,
  38. unconditionally reclaim iTD/isTD scheduled
  39. in just elapsed EHCI_ISO_RCLM_RANGE ms. */
  40. #define MAX_DESC_BUFF_SIZE 4096 /* To hold the configuration descriptor, USB
  41. core will allocate a buffer with this size
  42. for each connected device. USB core does
  43. not release it until device disconnected. */
  44. /*----------------------------------------------------------------------------------------*/
  45. /* Memory allocation settings */
  46. /*----------------------------------------------------------------------------------------*/
  47. #define STATIC_MEMORY_ALLOC 0 /* pre-allocate static memory blocks. No dynamic memory aloocation.
  48. But the maximum number of connected devices and transfers are
  49. limited. */
  50. #define MAX_UDEV_DRIVER 8 /*!< Maximum number of registered drivers */
  51. #define MAX_ALT_PER_IFACE 12 /*!< maximum number of alternative interfaces per interface */
  52. #define MAX_EP_PER_IFACE 8 /*!< maximum number of endpoints per interface */
  53. #define MAX_HUB_DEVICE 8 /*!< Maximum number of hub devices */
  54. /* Host controller hardware transfer descriptors memory pool. ED/TD/ITD of OHCI and QH/QTD of EHCI
  55. are all allocated from this pool. Allocated unit size is determined by MEM_POOL_UNIT_SIZE.
  56. May allocate one or more units depend on hardware descriptor type. */
  57. #define MEM_POOL_UNIT_SIZE 128 /*!< A fixed hard coding setting. Do not change it! */
  58. #define MEM_POOL_UNIT_NUM 256 /*!< Increase this or heap size if memory allocate failed. */
  59. /*----------------------------------------------------------------------------------------*/
  60. /* Re-defined staff for various compiler */
  61. /*----------------------------------------------------------------------------------------*/
  62. #ifdef __ICCARM__
  63. #define __inline inline
  64. #endif
  65. /*----------------------------------------------------------------------------------------*/
  66. /* Debug settings */
  67. /*----------------------------------------------------------------------------------------*/
  68. #define ENABLE_ERROR_MSG /* enable debug messages */
  69. #define ENABLE_DEBUG_MSG /* enable debug messages */
  70. //#define ENABLE_VERBOSE_DEBUG /* verbos debug messages */
  71. //#define DUMP_DESCRIPTOR /* dump descriptors */
  72. #ifdef ENABLE_ERROR_MSG
  73. #define USB_error rt_kprintf
  74. #else
  75. #define USB_error(...)
  76. #endif
  77. #ifdef ENABLE_DEBUG_MSG
  78. #define USB_debug rt_kprintf
  79. #ifdef ENABLE_VERBOSE_DEBUG
  80. #define USB_vdebug rt_kprintf
  81. #else
  82. #define USB_vdebug(...)
  83. #endif
  84. #else
  85. #define USB_debug(...)
  86. #define USB_vdebug(...)
  87. #endif
  88. #define __I volatile const /*!< Defines 'read only' permissions */
  89. #define __IO volatile /*!< Defines 'read / write' permissions */
  90. //typedef unsigned int uint32_t;
  91. //typedef unsigned short uint16_t;
  92. //typedef unsigned char uint8_t;
  93. /*---------------------- USB Host Controller -------------------------*/
  94. /**
  95. @addtogroup USBH USB Host Controller(USBH)
  96. Memory Mapped Structure for USBH Controller
  97. @{ */
  98. typedef struct
  99. {
  100. /**
  101. * @var USBH_T::HcRevision
  102. * Offset: 0x00 Host Controller Revision Register
  103. * ---------------------------------------------------------------------------------------------------
  104. * |Bits |Field |Descriptions
  105. * | :----: | :----: | :---- |
  106. * |[7:0] |REV |Revision Number
  107. * | | |Indicates the Open HCI Specification revision number implemented by the Hardware
  108. * | | |Host Controller supports 1.1 specification.
  109. * | | |(X.Y = XYh).
  110. * @var USBH_T::HcControl
  111. * Offset: 0x04 Host Controller Control Register
  112. * ---------------------------------------------------------------------------------------------------
  113. * |Bits |Field |Descriptions
  114. * | :----: | :----: | :---- |
  115. * |[1:0] |CBSR |Control Bulk Service Ratio
  116. * | | |This specifies the service ratio between Control and Bulk EDs
  117. * | | |Before processing any of the non-periodic lists, HC must compare the ratio specified with its internal count on how many nonempty Control EDs have been processed, in determining whether to continue serving another Control ED or switching to Bulk EDs
  118. * | | |The internal count will be retained when crossing the frame boundary
  119. * | | |In case of reset, HCD is responsible for restoring this
  120. * | | |Value.
  121. * | | |00 = Number of Control EDs over Bulk EDs served is 1:1.
  122. * | | |01 = Number of Control EDs over Bulk EDs served is 2:1.
  123. * | | |10 = Number of Control EDs over Bulk EDs served is 3:1.
  124. * | | |11 = Number of Control EDs over Bulk EDs served is 4:1.
  125. * |[2] |PLE |Periodic List Enable Bit
  126. * | | |When set, this bit enables processing of the Periodic (interrupt and isochronous) list
  127. * | | |The Host Controller checks this bit prior to attempting any periodic transfers in a frame.
  128. * | | |0 = Processing of the Periodic (Interrupt and Isochronous) list after next SOF (Start-Of-Frame) Disabled.
  129. * | | |1 = Processing of the Periodic (Interrupt and Isochronous) list in the next frame Enabled.
  130. * | | |Note: To enable the processing of the Isochronous list, user has to set both PLE and IE (HcControl[3]) high.
  131. * |[3] |IE |Isochronous List Enable Bit
  132. * | | |Both ISOEn and PLE (HcControl[2]) high enables Host Controller to process the Isochronous list
  133. * | | |Either ISOEn or PLE (HcControl[2]) is low disables Host Controller to process the Isochronous list.
  134. * | | |0 = Processing of the Isochronous list after next SOF (Start-Of-Frame) Disabled.
  135. * | | |1 = Processing of the Isochronous list in the next frame Enabled, if the PLE (HcControl[2]) is high, too.
  136. * |[4] |CLE |Control List Enable Bit
  137. * | | |0 = Processing of the Control list after next SOF (Start-Of-Frame) Disabled.
  138. * | | |1 = Processing of the Control list in the next frame Enabled.
  139. * |[5] |BLE |Bulk List Enable Bit
  140. * | | |0 = Processing of the Bulk list after next SOF (Start-Of-Frame) Disabled.
  141. * | | |1 = Processing of the Bulk list in the next frame Enabled.
  142. * |[7:6] |HCFS |Host Controller Functional State
  143. * | | |This field sets the Host Controller state
  144. * | | |The Controller may force a state change from USBSUSPEND to USBRESUME after detecting resume signaling from a downstream port
  145. * | | |States are:
  146. * | | |00 = USBSUSPEND.
  147. * | | |01 = USBOPERATIONAL.
  148. * | | |10 = USBRESUME.
  149. * | | |11 = USBRESET.
  150. * @var USBH_T::HcCommandStatus
  151. * Offset: 0x08 Host Controller Command Status Register
  152. * ---------------------------------------------------------------------------------------------------
  153. * |Bits |Field |Descriptions
  154. * | :----: | :----: | :---- |
  155. * |[0] |HCR |Host Controller Reset
  156. * | | |This bit is set to initiate the software reset of Host Controller
  157. * | | |This bit is cleared by the Host Controller, upon completed of the reset operation.
  158. * | | |This bit, when set, didn't reset the Root Hub and no subsequent reset signaling be asserted to its downstream ports.
  159. * | | |0 = Host Controller is not in software reset state.
  160. * | | |1 = Host Controller is in software reset state.
  161. * |[1] |CLF |Control List Filled
  162. * | | |Set high to indicate there is an active TD on the Control List
  163. * | | |It may be set by either software or the Host Controller and cleared by the Host Controller each time it begins processing the head of the Control List.
  164. * | | |0 = No active TD found or Host Controller begins to process the head of the Control list.
  165. * | | |1 = An active TD added or found on the Control list.
  166. * |[2] |BLF |Bulk List Filled
  167. * | | |Set high to indicate there is an active TD on the Bulk list
  168. * | | |This bit may be set by either software or the Host Controller and cleared by the Host Controller each time it begins processing the head of the Bulk list.
  169. * | | |0 = No active TD found or Host Controller begins to process the head of the Bulk list.
  170. * | | |1 = An active TD added or found on the Bulk list.
  171. * |[17:16] |SOC |Schedule Overrun Count
  172. * | | |These bits are incremented on each scheduling overrun error
  173. * | | |It is initialized to 00b and wraps around at 11b
  174. * | | |This will be incremented when a scheduling overrun is detected even if SO (HcInterruptStatus[0]) has already been set.
  175. * @var USBH_T::HcInterruptStatus
  176. * Offset: 0x0C Host Controller Interrupt Status Register
  177. * ---------------------------------------------------------------------------------------------------
  178. * |Bits |Field |Descriptions
  179. * | :----: | :----: | :---- |
  180. * |[0] |SO |Scheduling Overrun
  181. * | | |Set when the List Processor determines a Schedule Overrun has occurred.
  182. * | | |0 = Schedule Overrun didn't occur.
  183. * | | |1 = Schedule Overrun has occurred.
  184. * |[1] |WDH |Write Back Done Head
  185. * | | |Set after the Host Controller has written HcDoneHead to HccaDoneHead
  186. * | | |Further updates of the HccaDoneHead will not occur until this bit has been cleared.
  187. * | | |0 =.Host Controller didn't update HccaDoneHead.
  188. * | | |1 =.Host Controller has written HcDoneHead to HccaDoneHead.
  189. * |[2] |SF |Start of Frame
  190. * | | |Set when the Frame Management functional block signals a 'Start of Frame' event
  191. * | | |Host Control generates a SOF token at the same time.
  192. * | | |0 =.Not the start of a frame.
  193. * | | |1 =.Indicate the start of a frame and Host Controller generates a SOF token.
  194. * |[3] |RD |Resume Detected
  195. * | | |Set when Host Controller detects resume signaling on a downstream port.
  196. * | | |0 = No resume signaling detected on a downstream port.
  197. * | | |1 = Resume signaling detected on a downstream port.
  198. * |[5] |FNO |Frame Number Overflow
  199. * | | |This bit is set when bit 15 of Frame Number changes from 1 to 0 or from 0 to 1.
  200. * | | |0 = The bit 15 of Frame Number didn't change.
  201. * | | |1 = The bit 15 of Frame Number changes from 1 to 0 or from 0 to 1.
  202. * |[6] |RHSC |Root Hub Status Change
  203. * | | |This bit is set when the content of HcRhStatus or the content of HcRhPortStatus register has changed.
  204. * | | |0 = The content of HcRhStatus and the content of HcRhPortStatus register didn't change.
  205. * | | |1 = The content of HcRhStatus or the content of HcRhPortStatus register has changed.
  206. * @var USBH_T::HcInterruptEnable
  207. * Offset: 0x10 Host Controller Interrupt Enable Register
  208. * ---------------------------------------------------------------------------------------------------
  209. * |Bits |Field |Descriptions
  210. * | :----: | :----: | :---- |
  211. * |[0] |SO |Scheduling Overrun Enable Bit
  212. * | | |Write Operation:
  213. * | | |0 = No effect.
  214. * | | |1 = Interrupt generation due to SO (HcInterruptStatus[0]) Enabled.
  215. * | | |Read Operation:
  216. * | | |0 = Interrupt generation due to SO (HcInterruptStatus[0]) Disabled.
  217. * | | |1 = Interrupt generation due to SO (HcInterruptStatus[0]) Enabled.
  218. * |[1] |WDH |Write Back Done Head Enable Bit
  219. * | | |Write Operation:
  220. * | | |0 = No effect.
  221. * | | |1 = Interrupt generation due to WDH (HcInterruptStatus[1]) Enabled.
  222. * | | |Read Operation:
  223. * | | |0 = Interrupt generation due to WDH (HcInterruptStatus[1]) Disabled.
  224. * | | |1 = Interrupt generation due to WDH (HcInterruptStatus[1]) Enabled.
  225. * |[2] |SF |Start of Frame Enable Bit
  226. * | | |Write Operation:
  227. * | | |0 = No effect.
  228. * | | |1 = Interrupt generation due to SF (HcInterruptStatus[2]) Enabled.
  229. * | | |Read Operation:
  230. * | | |0 = Interrupt generation due to SF (HcInterruptStatus[2]) Disabled.
  231. * | | |1 = Interrupt generation due to SF (HcInterruptStatus[2]) Enabled.
  232. * |[3] |RD |Resume Detected Enable Bit
  233. * | | |Write Operation:
  234. * | | |0 = No effect.
  235. * | | |1 = Interrupt generation due to RD (HcInterruptStatus[3]) Enabled.
  236. * | | |Read Operation:
  237. * | | |0 = Interrupt generation due to RD (HcInterruptStatus[3]) Disabled.
  238. * | | |1 = Interrupt generation due to RD (HcInterruptStatus[3]) Enabled.
  239. * |[5] |FNO |Frame Number Overflow Enable Bit
  240. * | | |Write Operation:
  241. * | | |0 = No effect.
  242. * | | |1 = Interrupt generation due to FNO (HcInterruptStatus[5]) Enabled.
  243. * | | |Read Operation:
  244. * | | |0 = Interrupt generation due to FNO (HcInterruptStatus[5]) Disabled.
  245. * | | |1 = Interrupt generation due to FNO (HcInterruptStatus[5]) Enabled.
  246. * |[6] |RHSC |Root Hub Status Change Enable Bit
  247. * | | |Write Operation:
  248. * | | |0 = No effect.
  249. * | | |1 = Interrupt generation due to RHSC (HcInterruptStatus[6]) Enabled.
  250. * | | |Read Operation:
  251. * | | |0 = Interrupt generation due to RHSC (HcInterruptStatus[6]) Disabled.
  252. * | | |1 = Interrupt generation due to RHSC (HcInterruptStatus[6]) Enabled.
  253. * |[31] |MIE |Master Interrupt Enable Bit
  254. * | | |This bit is a global interrupt enable
  255. * | | |A write of '1' allows interrupts to be enabled via the specific enable bits listed above.
  256. * | | |Write Operation:
  257. * | | |0 = No effect.
  258. * | | |1 = Interrupt generation due to RHSC (HcInterruptStatus[6]), FNO (HcInterruptStatus[5]), RD (HcInterruptStatus[3]), SF (HcInterruptStatus[2]), WDH (HcInterruptStatus[1]) or SO (HcInterruptStatus[0]) Enabled if the corresponding bit in HcInterruptEnable is high.
  259. * | | |Read Operation:
  260. * | | |0 = Interrupt generation due to RHSC (HcInterruptStatus[6]), FNO (HcInterruptStatus[5]), RD (HcInterruptStatus[3]), SF (HcInterruptStatus[2]), WDH (HcInterruptStatus[1]) or SO (HcInterruptStatus[0]) Disabled even if the corresponding bit in HcInterruptEnable is high.
  261. * | | |1 = Interrupt generation due to RHSC (HcInterruptStatus[6]), FNO (HcInterruptStatus[5]), RD (HcInterruptStatus[3]), SF (HcInterruptStatus[2]), WDH (HcInterruptStatus[1]) or SO (HcInterruptStatus[0]) Enabled if the corresponding bit in HcInterruptEnable is high.
  262. * @var USBH_T::HcInterruptDisable
  263. * Offset: 0x14 Host Controller Interrupt Disable Register
  264. * ---------------------------------------------------------------------------------------------------
  265. * |Bits |Field |Descriptions
  266. * | :----: | :----: | :---- |
  267. * |[0] |SO |Scheduling Overrun Disable Bit
  268. * | | |Write Operation:
  269. * | | |0 = No effect.
  270. * | | |1 = Interrupt generation due to SO (HcInterruptStatus[0]) Disabled.
  271. * | | |Read Operation:
  272. * | | |0 = Interrupt generation due to SO (HcInterruptStatus[0]) Disabled.
  273. * | | |1 = Interrupt generation due to SO (HcInterruptStatus[0]) Enabled.
  274. * |[1] |WDH |Write Back Done Head Disable Bit
  275. * | | |Write Operation:
  276. * | | |0 = No effect.
  277. * | | |1 = Interrupt generation due to WDH (HcInterruptStatus[1]) Disabled.
  278. * | | |Read Operation:
  279. * | | |0 = Interrupt generation due to WDH (HcInterruptStatus[1]) Disabled.
  280. * | | |1 = Interrupt generation due to WDH (HcInterruptStatus[1]) Enabled.
  281. * |[2] |SF |Start of Frame Disable Bit
  282. * | | |Write Operation:
  283. * | | |0 = No effect.
  284. * | | |1 = Interrupt generation due to SF (HcInterruptStatus[2]) Disabled.
  285. * | | |Read Operation:
  286. * | | |0 = Interrupt generation due to SF (HcInterruptStatus[2]) Disabled.
  287. * | | |1 = Interrupt generation due to SF (HcInterruptStatus[2]) Enabled.
  288. * |[3] |RD |Resume Detected Disable Bit
  289. * | | |Write Operation:
  290. * | | |0 = No effect.
  291. * | | |1 = Interrupt generation due to RD (HcInterruptStatus[3]) Disabled.
  292. * | | |Read Operation:
  293. * | | |0 = Interrupt generation due to RD (HcInterruptStatus[3]) Disabled.
  294. * | | |1 = Interrupt generation due to RD (HcInterruptStatus[3]) Enabled.
  295. * |[5] |FNO |Frame Number Overflow Disable Bit
  296. * | | |Write Operation:
  297. * | | |0 = No effect.
  298. * | | |1 = Interrupt generation due to FNO (HcInterruptStatus[5]) Disabled.
  299. * | | |Read Operation:
  300. * | | |0 = Interrupt generation due to FNO (HcInterruptStatus[5]) Disabled.
  301. * | | |1 = Interrupt generation due to FNO (HcInterruptStatus[5]) Enabled.
  302. * |[6] |RHSC |Root Hub Status Change Disable Bit
  303. * | | |Write Operation:
  304. * | | |0 = No effect.
  305. * | | |1 = Interrupt generation due to RHSC (HcInterruptStatus[6]) Disabled.
  306. * | | |Read Operation:
  307. * | | |0 = Interrupt generation due to RHSC (HcInterruptStatus[6]) Disabled.
  308. * | | |1 = Interrupt generation due to RHSC (HcInterruptStatus[6]) Enabled.
  309. * |[31] |MIE |Master Interrupt Disable Bit
  310. * | | |Global interrupt disable. Writing '1' to disable all interrupts.
  311. * | | |Write Operation:
  312. * | | |0 = No effect.
  313. * | | |1 = Interrupt generation due to RHSC (HcInterruptStatus[6]), FNO (HcInterruptStatus[5]), RD (HcInterruptStatus[3]), SF (HcInterruptStatus[2]), WDH (HcInterruptStatus[1]) or SO (HcInterruptStatus[0]) Disabled if the corresponding bit in HcInterruptEnable is high.
  314. * | | |Read Operation:
  315. * | | |0 = Interrupt generation due to RHSC (HcInterruptStatus[6]), FNO (HcInterruptStatus[5]), RD (HcInterruptStatus[3]), SF (HcInterruptStatus[2]), WDH (HcInterruptStatus[1]) or SO (HcInterruptStatus[0]) Disabled even if the corresponding bit in HcInterruptEnable is high.
  316. * | | |1 = Interrupt generation due to RHSC (HcInterruptStatus[6]), FNO (HcInterruptStatus[5]), RD (HcInterruptStatus[3]), SF (HcInterruptStatus[2]), WDH (HcInterruptStatus[1]) or SO (HcInterruptStatus[0]) Enabled if the corresponding bit in HcInterruptEnable is high.
  317. * @var USBH_T::HcHCCA
  318. * Offset: 0x18 Host Controller Communication Area Register
  319. * ---------------------------------------------------------------------------------------------------
  320. * |Bits |Field |Descriptions
  321. * | :----: | :----: | :---- |
  322. * |[31:8] |HCCA |Host Controller Communication Area
  323. * | | |Pointer to indicate base address of the Host Controller Communication Area (HCCA).
  324. * @var USBH_T::HcPeriodCurrentED
  325. * Offset: 0x1C Host Controller Period Current ED Register
  326. * ---------------------------------------------------------------------------------------------------
  327. * |Bits |Field |Descriptions
  328. * | :----: | :----: | :---- |
  329. * |[31:4] |PCED |Periodic Current ED
  330. * | | |Pointer to indicate physical address of the current Isochronous or Interrupt Endpoint Descriptor.
  331. * @var USBH_T::HcControlHeadED
  332. * Offset: 0x20 Host Controller Control Head ED Register
  333. * ---------------------------------------------------------------------------------------------------
  334. * |Bits |Field |Descriptions
  335. * | :----: | :----: | :---- |
  336. * |[31:4] |CHED |Control Head ED
  337. * | | |Pointer to indicate physical address of the first Endpoint Descriptor of the Control list.
  338. * @var USBH_T::HcControlCurrentED
  339. * Offset: 0x24 Host Controller Control Current ED Register
  340. * ---------------------------------------------------------------------------------------------------
  341. * |Bits |Field |Descriptions
  342. * | :----: | :----: | :---- |
  343. * |[31:4] |CCED |Control Current Head ED
  344. * | | |Pointer to indicate the physical address of the current Endpoint Descriptor of the Control list.
  345. * @var USBH_T::HcBulkHeadED
  346. * Offset: 0x28 Host Controller Bulk Head ED Register
  347. * ---------------------------------------------------------------------------------------------------
  348. * |Bits |Field |Descriptions
  349. * | :----: | :----: | :---- |
  350. * |[31:4] |BHED |Bulk Head ED
  351. * | | |Pointer to indicate the physical address of the first Endpoint Descriptor of the Bulk list.
  352. * @var USBH_T::HcBulkCurrentED
  353. * Offset: 0x2C Host Controller Bulk Current ED Register
  354. * ---------------------------------------------------------------------------------------------------
  355. * |Bits |Field |Descriptions
  356. * | :----: | :----: | :---- |
  357. * |[31:4] |BCED |Bulk Current Head ED
  358. * | | |Pointer to indicate the physical address of the current endpoint of the Bulk list.
  359. * @var USBH_T::HcDoneHead
  360. * Offset: 0x30 Host Controller Done Head Register
  361. * ---------------------------------------------------------------------------------------------------
  362. * |Bits |Field |Descriptions
  363. * | :----: | :----: | :---- |
  364. * |[31:4] |DH |Done Head
  365. * | | |Pointer to indicate the physical address of the last completed Transfer Descriptor that was added to the Done queue.
  366. * @var USBH_T::HcFmInterval
  367. * Offset: 0x34 Host Controller Frame Interval Register
  368. * ---------------------------------------------------------------------------------------------------
  369. * |Bits |Field |Descriptions
  370. * | :----: | :----: | :---- |
  371. * |[13:0] |FI |Frame Interval
  372. * | | |This field specifies the length of a frame as (bit times - 1)
  373. * | | |For 12,000 bit times in a frame, a value of 11,999 is stored here.
  374. * |[30:16] |FSMPS |FS Largest Data Packet
  375. * | | |This field specifies a value that is loaded into the Largest Data Packet Counter at the beginning of each frame.
  376. * |[31] |FIT |Frame Interval Toggle
  377. * | | |This bit is toggled by Host Controller Driver when it loads a new value into FI (HcFmInterval[13:0]).
  378. * | | |0 = Host Controller Driver didn't load new value into FI (HcFmInterval[13:0]).
  379. * | | |1 = Host Controller Driver loads a new value into FI (HcFmInterval[13:0]).
  380. * @var USBH_T::HcFmRemaining
  381. * Offset: 0x38 Host Controller Frame Remaining Register
  382. * ---------------------------------------------------------------------------------------------------
  383. * |Bits |Field |Descriptions
  384. * | :----: | :----: | :---- |
  385. * |[13:0] |FR |Frame Remaining
  386. * | | |When the Host Controller is in the USBOPERATIONAL state, this 14-bit field decrements each 12 MHz clock period
  387. * | | |When the count reaches 0, (end of frame) the counter reloads with Frame Interval
  388. * | | |In addition, the counter loads when the Host Controller transitions into USBOPERATIONAL.
  389. * |[31] |FRT |Frame Remaining Toggle
  390. * | | |This bit is loaded from the FIT (HcFmInterval[31]) whenever FR (HcFmRemaining[13:0]) reaches 0.
  391. * @var USBH_T::HcFmNumber
  392. * Offset: 0x3C Host Controller Frame Number Register
  393. * ---------------------------------------------------------------------------------------------------
  394. * |Bits |Field |Descriptions
  395. * | :----: | :----: | :---- |
  396. * |[15:0] |FN |Frame Number
  397. * | | |This 16-bit incrementing counter field is incremented coincident with the re-load of FR (HcFmRemaining[13:0])
  398. * | | |The count rolls over from 'FFFFh' to '0h.'
  399. * @var USBH_T::HcPeriodicStart
  400. * Offset: 0x40 Host Controller Periodic Start Register
  401. * ---------------------------------------------------------------------------------------------------
  402. * |Bits |Field |Descriptions
  403. * | :----: | :----: | :---- |
  404. * |[13:0] |PS |Periodic Start
  405. * | | |This field contains a value used by the List Processor to determine where in a frame the Periodic List processing must begin.
  406. * @var USBH_T::HcLSThreshold
  407. * Offset: 0x44 Host Controller Low-speed Threshold Register
  408. * ---------------------------------------------------------------------------------------------------
  409. * |Bits |Field |Descriptions
  410. * | :----: | :----: | :---- |
  411. * |[11:0] |LST |Low-speed Threshold
  412. * | | |This field contains a value which is compared to the FR (HcFmRemaining[13:0]) field prior to initiating a Low-speed transaction
  413. * | | |The transaction is started only if FR (HcFmRemaining[13:0]) >= this field
  414. * | | |The value is calculated by Host Controller Driver with the consideration of transmission and setup overhead.
  415. * @var USBH_T::HcRhDescriptorA
  416. * Offset: 0x48 Host Controller Root Hub Descriptor A Register
  417. * ---------------------------------------------------------------------------------------------------
  418. * |Bits |Field |Descriptions
  419. * | :----: | :----: | :---- |
  420. * |[7:0] |NDP |Number Downstream Ports
  421. * | | |USB host control supports two downstream ports and only one port is available in this series of chip.
  422. * |[8] |PSM |Power Switching Mode
  423. * | | |This bit is used to specify how the power switching of the Root Hub ports is controlled.
  424. * | | |0 = Global Switching.
  425. * | | |1 = Individual Switching.
  426. * |[11] |OCPM |over Current Protection Mode
  427. * | | |This bit describes how the over current status for the Root Hub ports reported
  428. * | | |This bit is only valid when NOCP (HcRhDescriptorA[12]) is cleared.
  429. * | | |0 = Global Over current.
  430. * | | |1 = Individual Over current.
  431. * |[12] |NOCP |No over Current Protection
  432. * | | |This bit describes how the over current status for the Root Hub ports reported.
  433. * | | |0 = Over current status is reported.
  434. * | | |1 = Over current status is not reported.
  435. * @var USBH_T::HcRhDescriptorB
  436. * Offset: 0x4C Host Controller Root Hub Descriptor B Register
  437. * ---------------------------------------------------------------------------------------------------
  438. * |Bits |Field |Descriptions
  439. * | :----: | :----: | :---- |
  440. * |[31:16] |PPCM |Port Power Control Mask
  441. * | | |Global power switching
  442. * | | |This field is only valid if PowerSwitchingMode is set (individual port switching)
  443. * | | |When set, the port only responds to individual port power switching commands (Set/ClearPortPower)
  444. * | | |When cleared, the port only responds to global power switching commands (Set/ClearGlobalPower).
  445. * | | |0 = Port power controlled by global power switching.
  446. * | | |1 = Port power controlled by port power switching.
  447. * | | |Note: PPCM[15:2] and PPCM[0] are reserved.
  448. * @var USBH_T::HcRhStatus
  449. * Offset: 0x50 Host Controller Root Hub Status Register
  450. * ---------------------------------------------------------------------------------------------------
  451. * |Bits |Field |Descriptions
  452. * | :----: | :----: | :---- |
  453. * |[0] |LPS |Clear Global Power
  454. * | | |In global power mode (PSM (HcRhDescriptorA[8]) = 0), this bit is written to one to clear all ports' power.
  455. * | | |This bit always read as zero.
  456. * | | |Write Operation:
  457. * | | |0 = No effect.
  458. * | | |1 = Clear global power.
  459. * |[1] |OCI |over Current Indicator
  460. * | | |This bit reflects the state of the over current status pin
  461. * | | |This field is only valid if NOCP (HcRhDesA[12]) and OCPM (HcRhDesA[11]) are cleared.
  462. * | | |0 = No over current condition.
  463. * | | |1 = Over current condition.
  464. * |[15] |DRWE |Device Remote Wakeup Enable Bit
  465. * | | |This bit controls if port's Connect Status Change as a remote wake-up event.
  466. * | | |Write Operation:
  467. * | | |0 = No effect.
  468. * | | |1 = Connect Status Change as a remote wake-up event Enabled.
  469. * | | |Read Operation:
  470. * | | |0 = Connect Status Change as a remote wake-up event Disabled.
  471. * | | |1 = Connect Status Change as a remote wake-up event Enabled.
  472. * |[16] |LPSC |Set Global Power
  473. * | | |In global power mode (PSM (HcRhDescriptorA[8]) = 0), this bit is written to one to enable power to all ports.
  474. * | | |This bit always read as zero.
  475. * | | |Write Operation:
  476. * | | |0 = No effect.
  477. * | | |1 = Set global power.
  478. * |[17] |OCIC |over Current Indicator Change
  479. * | | |This bit is set by hardware when a change has occurred in OCI (HcRhStatus[1]).
  480. * | | |Write 1 to clear this bit to zero.
  481. * | | |0 = OCI (HcRhStatus[1]) didn't change.
  482. * | | |1 = OCI (HcRhStatus[1]) change.
  483. * |[31] |CRWE |Clear Remote Wake-up Enable Bit
  484. * | | |This bit is use to clear DRWE (HcRhStatus[15]).
  485. * | | |This bit always read as zero.
  486. * | | |Write Operation:
  487. * | | |0 = No effect.
  488. * | | |1 = Clear DRWE (HcRhStatus[15]).
  489. * @var USBH_T::HcRhPortStatus[2]
  490. * Offset: 0x54 Host Controller Root Hub Port Status
  491. * ---------------------------------------------------------------------------------------------------
  492. * |Bits |Field |Descriptions
  493. * | :----: | :----: | :---- |
  494. * |[0] |CCS |CurrentConnectStatus (Read) or ClearPortEnable Bit (Write)
  495. * | | |Write Operation:
  496. * | | |0 = No effect.
  497. * | | |1 = Clear port enable.
  498. * | | |Read Operation:
  499. * | | |0 = No device connected.
  500. * | | |1 = Device connected.
  501. * |[1] |PES |Port Enable Status
  502. * | | |Write Operation:
  503. * | | |0 = No effect.
  504. * | | |1 = Set port enable.
  505. * | | |Read Operation:
  506. * | | |0 = Port Disabled.
  507. * | | |1 = Port Enabled.
  508. * |[2] |PSS |Port Suspend Status
  509. * | | |This bit indicates the port is suspended
  510. * | | |Write Operation:
  511. * | | |0 = No effect.
  512. * | | |1 = Set port suspend.
  513. * | | |Read Operation:
  514. * | | |0 = Port is not suspended.
  515. * | | |1 = Port is selectively suspended.
  516. * |[3] |POCI |Port over Current Indicator (Read) or Clear Port Suspend (Write)
  517. * | | |This bit reflects the state of the over current status pin dedicated to this port
  518. * | | |This field is only valid if NOCP (HcRhDescriptorA[12]) is cleared and OCPM (HcRhDescriptorA[11]) is set.
  519. * | | |This bit is also used to initiate the selective result sequence for the port.
  520. * | | |Write Operation:
  521. * | | |0 = No effect.
  522. * | | |1 = Clear port suspend.
  523. * | | |Read Operation:
  524. * | | |0 = No over current condition.
  525. * | | |1 = Over current condition.
  526. * |[4] |PRS |Port Reset Status
  527. * | | |This bit reflects the reset state of the port.
  528. * | | |Write Operation:
  529. * | | |0 = No effect.
  530. * | | |1 = Set port reset.
  531. * | | |Read Operation
  532. * | | |0 = Port reset signal is not active.
  533. * | | |1 = Port reset signal is active.
  534. * |[8] |PPS |Port Power Status
  535. * | | |This bit reflects the power state of the port regardless of the power switching mode.
  536. * | | |Write Operation:
  537. * | | |0 = No effect.
  538. * | | |1 = Port Power Enabled.
  539. * | | |Read Operation:
  540. * | | |0 = Port power is Disabled.
  541. * | | |1 = Port power is Enabled.
  542. * |[9] |LSDA |Low Speed Device Attached (Read) or Clear Port Power (Write)
  543. * | | |This bit defines the speed (and bud idle) of the attached device
  544. * | | |It is only valid when CCS (HcRhPortStatus1[0]) is set.
  545. * | | |This bit is also used to clear port power.
  546. * | | |Write Operation:
  547. * | | |0 = No effect.
  548. * | | |1 = Clear PPS (HcRhPortStatus1[8]).
  549. * | | |Read Operation:
  550. * | | |0 = Full Speed device.
  551. * | | |1 = Low-speed device.
  552. * |[16] |CSC |Connect Status Change
  553. * | | |This bit indicates connect or disconnect event has been detected (CCS (HcRhPortStatus1[0]) changed).
  554. * | | |Write 1 to clear this bit to zero.
  555. * | | |0 = No connect/disconnect event (CCS (HcRhPortStatus1[0]) didn't change).
  556. * | | |1 = Hardware detection of connect/disconnect event (CCS (HcRhPortStatus1[0]) changed).
  557. * |[17] |PESC |Port Enable Status Change
  558. * | | |This bit indicates that the port has been disabled (PES (HcRhPortStatus1[1]) cleared) due to a hardware event.
  559. * | | |Write 1 to clear this bit to zero.
  560. * | | |0 = PES (HcRhPortStatus1[1]) didn't change.
  561. * | | |1 = PES (HcRhPortStatus1[1]) changed.
  562. * |[18] |PSSC |Port Suspend Status Change
  563. * | | |This bit indicates the completion of the selective resume sequence for the port.
  564. * | | |Write 1 to clear this bit to zero.
  565. * | | |0 = Port resume is not completed.
  566. * | | |1 = Port resume completed.
  567. * |[19] |OCIC |Port over Current Indicator Change
  568. * | | |This bit is set when POCI (HcRhPortStatus1[3]) changes.
  569. * | | |Write 1 to clear this bit to zero.
  570. * | | |0 = POCI (HcRhPortStatus1[3]) didn't change.
  571. * | | |1 = POCI (HcRhPortStatus1[3]) changes.
  572. * |[20] |PRSC |Port Reset Status Change
  573. * | | |This bit indicates that the port reset signal has completed.
  574. * | | |Write 1 to clear this bit to zero.
  575. * | | |0 = Port reset is not complete.
  576. * | | |1 = Port reset is complete.
  577. * @var USBH_T::HcPhyControl
  578. * Offset: 0x200 Host Controller PHY Control Register
  579. * ---------------------------------------------------------------------------------------------------
  580. * |Bits |Field |Descriptions
  581. * | :----: | :----: | :---- |
  582. * |[27] |STBYEN |USB Transceiver Standby Enable Bit
  583. * | | |This bit controls if USB transceiver could enter the standby mode to reduce power consumption.
  584. * | | |0 = The USB transceiver would never enter the standby mode.
  585. * | | |1 = The USB transceiver will enter standby mode while port is in power off state (port power is inactive).
  586. * @var USBH_T::HcMiscControl
  587. * Offset: 0x204 Host Controller Miscellaneous Control Register
  588. * ---------------------------------------------------------------------------------------------------
  589. * |Bits |Field |Descriptions
  590. * | :----: | :----: | :---- |
  591. * |[1] |ABORT |AHB Bus ERROR Response
  592. * | | |This bit indicates there is an ERROR response received in AHB bus.
  593. * | | |0 = No ERROR response received.
  594. * | | |1 = ERROR response received.
  595. * |[3] |OCAL |over Current Active Low
  596. * | | |This bit controls the polarity of over current flag from external power IC.
  597. * | | |0 = Over current flag is high active.
  598. * | | |1 = Over current flag is low active.
  599. * |[16] |DPRT1 |Disable Port 1
  600. * | | |This bit controls if the connection between USB host controller and transceiver of port 1 is disabled
  601. * | | |If the connection is disabled, the USB host controller will not recognize any event of USB bus.
  602. * | | |Set this bit high, the transceiver of port 1 will also be forced into the standby mode no matter what USB host controller operation is.
  603. * | | |0 = The connection between USB host controller and transceiver of port 1 Enabled.
  604. * | | |1 = The connection between USB host controller and transceiver of port 1 Disabled and the transceiver of port 1 will also be forced into the standby mode.
  605. */
  606. __I uint32_t HcRevision; /*!< [0x0000] Host Controller Revision Register */
  607. __IO uint32_t HcControl; /*!< [0x0004] Host Controller Control Register */
  608. __IO uint32_t HcCommandStatus; /*!< [0x0008] Host Controller Command Status Register */
  609. __IO uint32_t HcInterruptStatus; /*!< [0x000c] Host Controller Interrupt Status Register */
  610. __IO uint32_t HcInterruptEnable; /*!< [0x0010] Host Controller Interrupt Enable Register */
  611. __IO uint32_t HcInterruptDisable; /*!< [0x0014] Host Controller Interrupt Disable Register */
  612. __IO uint32_t HcHCCA; /*!< [0x0018] Host Controller Communication Area Register */
  613. __IO uint32_t HcPeriodCurrentED; /*!< [0x001c] Host Controller Period Current ED Register */
  614. __IO uint32_t HcControlHeadED; /*!< [0x0020] Host Controller Control Head ED Register */
  615. __IO uint32_t HcControlCurrentED; /*!< [0x0024] Host Controller Control Current ED Register */
  616. __IO uint32_t HcBulkHeadED; /*!< [0x0028] Host Controller Bulk Head ED Register */
  617. __IO uint32_t HcBulkCurrentED; /*!< [0x002c] Host Controller Bulk Current ED Register */
  618. __IO uint32_t HcDoneHead; /*!< [0x0030] Host Controller Done Head Register */
  619. __IO uint32_t HcFmInterval; /*!< [0x0034] Host Controller Frame Interval Register */
  620. __I uint32_t HcFmRemaining; /*!< [0x0038] Host Controller Frame Remaining Register */
  621. __I uint32_t HcFmNumber; /*!< [0x003c] Host Controller Frame Number Register */
  622. __IO uint32_t HcPeriodicStart; /*!< [0x0040] Host Controller Periodic Start Register */
  623. __IO uint32_t HcLSThreshold; /*!< [0x0044] Host Controller Low-speed Threshold Register */
  624. __IO uint32_t HcRhDescriptorA; /*!< [0x0048] Host Controller Root Hub Descriptor A Register */
  625. __IO uint32_t HcRhDescriptorB; /*!< [0x004c] Host Controller Root Hub Descriptor B Register */
  626. __IO uint32_t HcRhStatus; /*!< [0x0050] Host Controller Root Hub Status Register */
  627. __IO uint32_t HcRhPortStatus[2]; /*!< [0x0054] Host Controller Root Hub Port Status [1] */
  628. __I uint32_t RESERVE0[105];
  629. __IO uint32_t HcPhyControl; /*!< [0x0200] Host Controller PHY Control Register */
  630. __IO uint32_t HcMiscControl; /*!< [0x0204] Host Controller Miscellaneous Control Register */
  631. } USBH_T;
  632. /**
  633. @addtogroup USBH_CONST USBH Bit Field Definition
  634. Constant Definitions for USBH Controller
  635. @{ */
  636. #define USBH_HcRevision_REV_Pos (0) /*!< USBH_T::HcRevision: REV Position */
  637. #define USBH_HcRevision_REV_Msk (0xfful << USBH_HcRevision_REV_Pos) /*!< USBH_T::HcRevision: REV Mask */
  638. #define USBH_HcControl_CBSR_Pos (0) /*!< USBH_T::HcControl: CBSR Position */
  639. #define USBH_HcControl_CBSR_Msk (0x3ul << USBH_HcControl_CBSR_Pos) /*!< USBH_T::HcControl: CBSR Mask */
  640. #define USBH_HcControl_PLE_Pos (2) /*!< USBH_T::HcControl: PLE Position */
  641. #define USBH_HcControl_PLE_Msk (0x1ul << USBH_HcControl_PLE_Pos) /*!< USBH_T::HcControl: PLE Mask */
  642. #define USBH_HcControl_IE_Pos (3) /*!< USBH_T::HcControl: IE Position */
  643. #define USBH_HcControl_IE_Msk (0x1ul << USBH_HcControl_IE_Pos) /*!< USBH_T::HcControl: IE Mask */
  644. #define USBH_HcControl_CLE_Pos (4) /*!< USBH_T::HcControl: CLE Position */
  645. #define USBH_HcControl_CLE_Msk (0x1ul << USBH_HcControl_CLE_Pos) /*!< USBH_T::HcControl: CLE Mask */
  646. #define USBH_HcControl_BLE_Pos (5) /*!< USBH_T::HcControl: BLE Position */
  647. #define USBH_HcControl_BLE_Msk (0x1ul << USBH_HcControl_BLE_Pos) /*!< USBH_T::HcControl: BLE Mask */
  648. #define USBH_HcControl_HCFS_Pos (6) /*!< USBH_T::HcControl: HCFS Position */
  649. #define USBH_HcControl_HCFS_Msk (0x3ul << USBH_HcControl_HCFS_Pos) /*!< USBH_T::HcControl: HCFS Mask */
  650. #define USBH_HcCommandStatus_HCR_Pos (0) /*!< USBH_T::HcCommandStatus: HCR Position */
  651. #define USBH_HcCommandStatus_HCR_Msk (0x1ul << USBH_HcCommandStatus_HCR_Pos) /*!< USBH_T::HcCommandStatus: HCR Mask */
  652. #define USBH_HcCommandStatus_CLF_Pos (1) /*!< USBH_T::HcCommandStatus: CLF Position */
  653. #define USBH_HcCommandStatus_CLF_Msk (0x1ul << USBH_HcCommandStatus_CLF_Pos) /*!< USBH_T::HcCommandStatus: CLF Mask */
  654. #define USBH_HcCommandStatus_BLF_Pos (2) /*!< USBH_T::HcCommandStatus: BLF Position */
  655. #define USBH_HcCommandStatus_BLF_Msk (0x1ul << USBH_HcCommandStatus_BLF_Pos) /*!< USBH_T::HcCommandStatus: BLF Mask */
  656. #define USBH_HcCommandStatus_SOC_Pos (16) /*!< USBH_T::HcCommandStatus: SOC Position */
  657. #define USBH_HcCommandStatus_SOC_Msk (0x3ul << USBH_HcCommandStatus_SOC_Pos) /*!< USBH_T::HcCommandStatus: SOC Mask */
  658. #define USBH_HcInterruptStatus_SO_Pos (0) /*!< USBH_T::HcInterruptStatus: SO Position */
  659. #define USBH_HcInterruptStatus_SO_Msk (0x1ul << USBH_HcInterruptStatus_SO_Pos) /*!< USBH_T::HcInterruptStatus: SO Mask */
  660. #define USBH_HcInterruptStatus_WDH_Pos (1) /*!< USBH_T::HcInterruptStatus: WDH Position*/
  661. #define USBH_HcInterruptStatus_WDH_Msk (0x1ul << USBH_HcInterruptStatus_WDH_Pos) /*!< USBH_T::HcInterruptStatus: WDH Mask */
  662. #define USBH_HcInterruptStatus_SF_Pos (2) /*!< USBH_T::HcInterruptStatus: SF Position */
  663. #define USBH_HcInterruptStatus_SF_Msk (0x1ul << USBH_HcInterruptStatus_SF_Pos) /*!< USBH_T::HcInterruptStatus: SF Mask */
  664. #define USBH_HcInterruptStatus_RD_Pos (3) /*!< USBH_T::HcInterruptStatus: RD Position */
  665. #define USBH_HcInterruptStatus_RD_Msk (0x1ul << USBH_HcInterruptStatus_RD_Pos) /*!< USBH_T::HcInterruptStatus: RD Mask */
  666. #define USBH_HcInterruptStatus_FNO_Pos (5) /*!< USBH_T::HcInterruptStatus: FNO Position*/
  667. #define USBH_HcInterruptStatus_FNO_Msk (0x1ul << USBH_HcInterruptStatus_FNO_Pos) /*!< USBH_T::HcInterruptStatus: FNO Mask */
  668. #define USBH_HcInterruptStatus_RHSC_Pos (6) /*!< USBH_T::HcInterruptStatus: RHSC Position*/
  669. #define USBH_HcInterruptStatus_RHSC_Msk (0x1ul << USBH_HcInterruptStatus_RHSC_Pos) /*!< USBH_T::HcInterruptStatus: RHSC Mask */
  670. #define USBH_HcInterruptEnable_SO_Pos (0) /*!< USBH_T::HcInterruptEnable: SO Position */
  671. #define USBH_HcInterruptEnable_SO_Msk (0x1ul << USBH_HcInterruptEnable_SO_Pos) /*!< USBH_T::HcInterruptEnable: SO Mask */
  672. #define USBH_HcInterruptEnable_WDH_Pos (1) /*!< USBH_T::HcInterruptEnable: WDH Position*/
  673. #define USBH_HcInterruptEnable_WDH_Msk (0x1ul << USBH_HcInterruptEnable_WDH_Pos) /*!< USBH_T::HcInterruptEnable: WDH Mask */
  674. #define USBH_HcInterruptEnable_SF_Pos (2) /*!< USBH_T::HcInterruptEnable: SF Position */
  675. #define USBH_HcInterruptEnable_SF_Msk (0x1ul << USBH_HcInterruptEnable_SF_Pos) /*!< USBH_T::HcInterruptEnable: SF Mask */
  676. #define USBH_HcInterruptEnable_RD_Pos (3) /*!< USBH_T::HcInterruptEnable: RD Position */
  677. #define USBH_HcInterruptEnable_RD_Msk (0x1ul << USBH_HcInterruptEnable_RD_Pos) /*!< USBH_T::HcInterruptEnable: RD Mask */
  678. #define USBH_HcInterruptEnable_FNO_Pos (5) /*!< USBH_T::HcInterruptEnable: FNO Position*/
  679. #define USBH_HcInterruptEnable_FNO_Msk (0x1ul << USBH_HcInterruptEnable_FNO_Pos) /*!< USBH_T::HcInterruptEnable: FNO Mask */
  680. #define USBH_HcInterruptEnable_RHSC_Pos (6) /*!< USBH_T::HcInterruptEnable: RHSC Position*/
  681. #define USBH_HcInterruptEnable_RHSC_Msk (0x1ul << USBH_HcInterruptEnable_RHSC_Pos) /*!< USBH_T::HcInterruptEnable: RHSC Mask */
  682. #define USBH_HcInterruptEnable_MIE_Pos (31) /*!< USBH_T::HcInterruptEnable: MIE Position*/
  683. #define USBH_HcInterruptEnable_MIE_Msk (0x1ul << USBH_HcInterruptEnable_MIE_Pos) /*!< USBH_T::HcInterruptEnable: MIE Mask */
  684. #define USBH_HcInterruptDisable_SO_Pos (0) /*!< USBH_T::HcInterruptDisable: SO Position*/
  685. #define USBH_HcInterruptDisable_SO_Msk (0x1ul << USBH_HcInterruptDisable_SO_Pos) /*!< USBH_T::HcInterruptDisable: SO Mask */
  686. #define USBH_HcInterruptDisable_WDH_Pos (1) /*!< USBH_T::HcInterruptDisable: WDH Position*/
  687. #define USBH_HcInterruptDisable_WDH_Msk (0x1ul << USBH_HcInterruptDisable_WDH_Pos) /*!< USBH_T::HcInterruptDisable: WDH Mask */
  688. #define USBH_HcInterruptDisable_SF_Pos (2) /*!< USBH_T::HcInterruptDisable: SF Position*/
  689. #define USBH_HcInterruptDisable_SF_Msk (0x1ul << USBH_HcInterruptDisable_SF_Pos) /*!< USBH_T::HcInterruptDisable: SF Mask */
  690. #define USBH_HcInterruptDisable_RD_Pos (3) /*!< USBH_T::HcInterruptDisable: RD Position*/
  691. #define USBH_HcInterruptDisable_RD_Msk (0x1ul << USBH_HcInterruptDisable_RD_Pos) /*!< USBH_T::HcInterruptDisable: RD Mask */
  692. #define USBH_HcInterruptDisable_FNO_Pos (5) /*!< USBH_T::HcInterruptDisable: FNO Position*/
  693. #define USBH_HcInterruptDisable_FNO_Msk (0x1ul << USBH_HcInterruptDisable_FNO_Pos) /*!< USBH_T::HcInterruptDisable: FNO Mask */
  694. #define USBH_HcInterruptDisable_RHSC_Pos (6) /*!< USBH_T::HcInterruptDisable: RHSC Position*/
  695. #define USBH_HcInterruptDisable_RHSC_Msk (0x1ul << USBH_HcInterruptDisable_RHSC_Pos) /*!< USBH_T::HcInterruptDisable: RHSC Mask */
  696. #define USBH_HcInterruptDisable_MIE_Pos (31) /*!< USBH_T::HcInterruptDisable: MIE Position*/
  697. #define USBH_HcInterruptDisable_MIE_Msk (0x1ul << USBH_HcInterruptDisable_MIE_Pos) /*!< USBH_T::HcInterruptDisable: MIE Mask */
  698. #define USBH_HcHCCA_HCCA_Pos (8) /*!< USBH_T::HcHCCA: HCCA Position */
  699. #define USBH_HcHCCA_HCCA_Msk (0xfffffful << USBH_HcHCCA_HCCA_Pos) /*!< USBH_T::HcHCCA: HCCA Mask */
  700. #define USBH_HcPeriodCurrentED_PCED_Pos (4) /*!< USBH_T::HcPeriodCurrentED: PCED Position*/
  701. #define USBH_HcPeriodCurrentED_PCED_Msk (0xffffffful << USBH_HcPeriodCurrentED_PCED_Pos) /*!< USBH_T::HcPeriodCurrentED: PCED Mask */
  702. #define USBH_HcControlHeadED_CHED_Pos (4) /*!< USBH_T::HcControlHeadED: CHED Position */
  703. #define USBH_HcControlHeadED_CHED_Msk (0xffffffful << USBH_HcControlHeadED_CHED_Pos) /*!< USBH_T::HcControlHeadED: CHED Mask */
  704. #define USBH_HcControlCurrentED_CCED_Pos (4) /*!< USBH_T::HcControlCurrentED: CCED Position*/
  705. #define USBH_HcControlCurrentED_CCED_Msk (0xffffffful << USBH_HcControlCurrentED_CCED_Pos) /*!< USBH_T::HcControlCurrentED: CCED Mask */
  706. #define USBH_HcBulkHeadED_BHED_Pos (4) /*!< USBH_T::HcBulkHeadED: BHED Position */
  707. #define USBH_HcBulkHeadED_BHED_Msk (0xffffffful << USBH_HcBulkHeadED_BHED_Pos) /*!< USBH_T::HcBulkHeadED: BHED Mask */
  708. #define USBH_HcBulkCurrentED_BCED_Pos (4) /*!< USBH_T::HcBulkCurrentED: BCED Position */
  709. #define USBH_HcBulkCurrentED_BCED_Msk (0xffffffful << USBH_HcBulkCurrentED_BCED_Pos) /*!< USBH_T::HcBulkCurrentED: BCED Mask */
  710. #define USBH_HcDoneHead_DH_Pos (4) /*!< USBH_T::HcDoneHead: DH Position */
  711. #define USBH_HcDoneHead_DH_Msk (0xffffffful << USBH_HcDoneHead_DH_Pos) /*!< USBH_T::HcDoneHead: DH Mask */
  712. #define USBH_HcFmInterval_FI_Pos (0) /*!< USBH_T::HcFmInterval: FI Position */
  713. #define USBH_HcFmInterval_FI_Msk (0x3ffful << USBH_HcFmInterval_FI_Pos) /*!< USBH_T::HcFmInterval: FI Mask */
  714. #define USBH_HcFmInterval_FSMPS_Pos (16) /*!< USBH_T::HcFmInterval: FSMPS Position */
  715. #define USBH_HcFmInterval_FSMPS_Msk (0x7ffful << USBH_HcFmInterval_FSMPS_Pos) /*!< USBH_T::HcFmInterval: FSMPS Mask */
  716. #define USBH_HcFmInterval_FIT_Pos (31) /*!< USBH_T::HcFmInterval: FIT Position */
  717. #define USBH_HcFmInterval_FIT_Msk (0x1ul << USBH_HcFmInterval_FIT_Pos) /*!< USBH_T::HcFmInterval: FIT Mask */
  718. #define USBH_HcFmRemaining_FR_Pos (0) /*!< USBH_T::HcFmRemaining: FR Position */
  719. #define USBH_HcFmRemaining_FR_Msk (0x3ffful << USBH_HcFmRemaining_FR_Pos) /*!< USBH_T::HcFmRemaining: FR Mask */
  720. #define USBH_HcFmRemaining_FRT_Pos (31) /*!< USBH_T::HcFmRemaining: FRT Position */
  721. #define USBH_HcFmRemaining_FRT_Msk (0x1ul << USBH_HcFmRemaining_FRT_Pos) /*!< USBH_T::HcFmRemaining: FRT Mask */
  722. #define USBH_HcFmNumber_FN_Pos (0) /*!< USBH_T::HcFmNumber: FN Position */
  723. #define USBH_HcFmNumber_FN_Msk (0xfffful << USBH_HcFmNumber_FN_Pos) /*!< USBH_T::HcFmNumber: FN Mask */
  724. #define USBH_HcPeriodicStart_PS_Pos (0) /*!< USBH_T::HcPeriodicStart: PS Position */
  725. #define USBH_HcPeriodicStart_PS_Msk (0x3ffful << USBH_HcPeriodicStart_PS_Pos) /*!< USBH_T::HcPeriodicStart: PS Mask */
  726. #define USBH_HcLSThreshold_LST_Pos (0) /*!< USBH_T::HcLSThreshold: LST Position */
  727. #define USBH_HcLSThreshold_LST_Msk (0xffful << USBH_HcLSThreshold_LST_Pos) /*!< USBH_T::HcLSThreshold: LST Mask */
  728. #define USBH_HcRhDescriptorA_NDP_Pos (0) /*!< USBH_T::HcRhDescriptorA: NDP Position */
  729. #define USBH_HcRhDescriptorA_NDP_Msk (0xfful << USBH_HcRhDescriptorA_NDP_Pos) /*!< USBH_T::HcRhDescriptorA: NDP Mask */
  730. #define USBH_HcRhDescriptorA_PSM_Pos (8) /*!< USBH_T::HcRhDescriptorA: PSM Position */
  731. #define USBH_HcRhDescriptorA_PSM_Msk (0x1ul << USBH_HcRhDescriptorA_PSM_Pos) /*!< USBH_T::HcRhDescriptorA: PSM Mask */
  732. #define USBH_HcRhDescriptorA_OCPM_Pos (11) /*!< USBH_T::HcRhDescriptorA: OCPM Position */
  733. #define USBH_HcRhDescriptorA_OCPM_Msk (0x1ul << USBH_HcRhDescriptorA_OCPM_Pos) /*!< USBH_T::HcRhDescriptorA: OCPM Mask */
  734. #define USBH_HcRhDescriptorA_NOCP_Pos (12) /*!< USBH_T::HcRhDescriptorA: NOCP Position */
  735. #define USBH_HcRhDescriptorA_NOCP_Msk (0x1ul << USBH_HcRhDescriptorA_NOCP_Pos) /*!< USBH_T::HcRhDescriptorA: NOCP Mask */
  736. #define USBH_HcRhDescriptorB_PPCM_Pos (16) /*!< USBH_T::HcRhDescriptorB: PPCM Position */
  737. #define USBH_HcRhDescriptorB_PPCM_Msk (0xfffful << USBH_HcRhDescriptorB_PPCM_Pos) /*!< USBH_T::HcRhDescriptorB: PPCM Mask */
  738. #define USBH_HcRhStatus_LPS_Pos (0) /*!< USBH_T::HcRhStatus: LPS Position */
  739. #define USBH_HcRhStatus_LPS_Msk (0x1ul << USBH_HcRhStatus_LPS_Pos) /*!< USBH_T::HcRhStatus: LPS Mask */
  740. #define USBH_HcRhStatus_OCI_Pos (1) /*!< USBH_T::HcRhStatus: OCI Position */
  741. #define USBH_HcRhStatus_OCI_Msk (0x1ul << USBH_HcRhStatus_OCI_Pos) /*!< USBH_T::HcRhStatus: OCI Mask */
  742. #define USBH_HcRhStatus_DRWE_Pos (15) /*!< USBH_T::HcRhStatus: DRWE Position */
  743. #define USBH_HcRhStatus_DRWE_Msk (0x1ul << USBH_HcRhStatus_DRWE_Pos) /*!< USBH_T::HcRhStatus: DRWE Mask */
  744. #define USBH_HcRhStatus_LPSC_Pos (16) /*!< USBH_T::HcRhStatus: LPSC Position */
  745. #define USBH_HcRhStatus_LPSC_Msk (0x1ul << USBH_HcRhStatus_LPSC_Pos) /*!< USBH_T::HcRhStatus: LPSC Mask */
  746. #define USBH_HcRhStatus_OCIC_Pos (17) /*!< USBH_T::HcRhStatus: OCIC Position */
  747. #define USBH_HcRhStatus_OCIC_Msk (0x1ul << USBH_HcRhStatus_OCIC_Pos) /*!< USBH_T::HcRhStatus: OCIC Mask */
  748. #define USBH_HcRhStatus_CRWE_Pos (31) /*!< USBH_T::HcRhStatus: CRWE Position */
  749. #define USBH_HcRhStatus_CRWE_Msk (0x1ul << USBH_HcRhStatus_CRWE_Pos) /*!< USBH_T::HcRhStatus: CRWE Mask */
  750. #define USBH_HcRhPortStatus_CCS_Pos (0) /*!< USBH_T::HcRhPortStatus1: CCS Position */
  751. #define USBH_HcRhPortStatus_CCS_Msk (0x1ul << USBH_HcRhPortStatus_CCS_Pos) /*!< USBH_T::HcRhPortStatus1: CCS Mask */
  752. #define USBH_HcRhPortStatus_PES_Pos (1) /*!< USBH_T::HcRhPortStatus1: PES Position */
  753. #define USBH_HcRhPortStatus_PES_Msk (0x1ul << USBH_HcRhPortStatus_PES_Pos) /*!< USBH_T::HcRhPortStatus1: PES Mask */
  754. #define USBH_HcRhPortStatus_PSS_Pos (2) /*!< USBH_T::HcRhPortStatus1: PSS Position */
  755. #define USBH_HcRhPortStatus_PSS_Msk (0x1ul << USBH_HcRhPortStatus_PSS_Pos) /*!< USBH_T::HcRhPortStatus1: PSS Mask */
  756. #define USBH_HcRhPortStatus_POCI_Pos (3) /*!< USBH_T::HcRhPortStatus1: POCI Position */
  757. #define USBH_HcRhPortStatus_POCI_Msk (0x1ul << USBH_HcRhPortStatus_POCI_Pos) /*!< USBH_T::HcRhPortStatus1: POCI Mask */
  758. #define USBH_HcRhPortStatus_PRS_Pos (4) /*!< USBH_T::HcRhPortStatus1: PRS Position */
  759. #define USBH_HcRhPortStatus_PRS_Msk (0x1ul << USBH_HcRhPortStatus_PRS_Pos) /*!< USBH_T::HcRhPortStatus1: PRS Mask */
  760. #define USBH_HcRhPortStatus_PPS_Pos (8) /*!< USBH_T::HcRhPortStatus1: PPS Position */
  761. #define USBH_HcRhPortStatus_PPS_Msk (0x1ul << USBH_HcRhPortStatus_PPS_Pos) /*!< USBH_T::HcRhPortStatus1: PPS Mask */
  762. #define USBH_HcRhPortStatus_LSDA_Pos (9) /*!< USBH_T::HcRhPortStatus1: LSDA Position */
  763. #define USBH_HcRhPortStatus_LSDA_Msk (0x1ul << USBH_HcRhPortStatus_LSDA_Pos) /*!< USBH_T::HcRhPortStatus1: LSDA Mask */
  764. #define USBH_HcRhPortStatus_CSC_Pos (16) /*!< USBH_T::HcRhPortStatus1: CSC Position */
  765. #define USBH_HcRhPortStatus_CSC_Msk (0x1ul << USBH_HcRhPortStatus_CSC_Pos) /*!< USBH_T::HcRhPortStatus1: CSC Mask */
  766. #define USBH_HcRhPortStatus_PESC_Pos (17) /*!< USBH_T::HcRhPortStatus1: PESC Position */
  767. #define USBH_HcRhPortStatus_PESC_Msk (0x1ul << USBH_HcRhPortStatus_PESC_Pos) /*!< USBH_T::HcRhPortStatus1: PESC Mask */
  768. #define USBH_HcRhPortStatus_PSSC_Pos (18) /*!< USBH_T::HcRhPortStatus1: PSSC Position */
  769. #define USBH_HcRhPortStatus_PSSC_Msk (0x1ul << USBH_HcRhPortStatus_PSSC_Pos) /*!< USBH_T::HcRhPortStatus1: PSSC Mask */
  770. #define USBH_HcRhPortStatus_OCIC_Pos (19) /*!< USBH_T::HcRhPortStatus1: OCIC Position */
  771. #define USBH_HcRhPortStatus_OCIC_Msk (0x1ul << USBH_HcRhPortStatus_OCIC_Pos) /*!< USBH_T::HcRhPortStatus1: OCIC Mask */
  772. #define USBH_HcRhPortStatus_PRSC_Pos (20) /*!< USBH_T::HcRhPortStatus1: PRSC Position */
  773. #define USBH_HcRhPortStatus_PRSC_Msk (0x1ul << USBH_HcRhPortStatus_PRSC_Pos) /*!< USBH_T::HcRhPortStatus1: PRSC Mask */
  774. #define USBH_HcPhyControl_STBYEN_Pos (27) /*!< USBH_T::HcPhyControl: STBYEN Position */
  775. #define USBH_HcPhyControl_STBYEN_Msk (0x1ul << USBH_HcPhyControl_STBYEN_Pos) /*!< USBH_T::HcPhyControl: STBYEN Mask */
  776. #define USBH_HcMiscControl_ABORT_Pos (1) /*!< USBH_T::HcMiscControl: ABORT Position */
  777. #define USBH_HcMiscControl_ABORT_Msk (0x1ul << USBH_HcMiscControl_ABORT_Pos) /*!< USBH_T::HcMiscControl: ABORT Mask */
  778. #define USBH_HcMiscControl_OCAL_Pos (3) /*!< USBH_T::HcMiscControl: OCAL Position */
  779. #define USBH_HcMiscControl_OCAL_Msk (0x1ul << USBH_HcMiscControl_OCAL_Pos) /*!< USBH_T::HcMiscControl: OCAL Mask */
  780. #define USBH_HcMiscControl_DPRT1_Pos (16) /*!< USBH_T::HcMiscControl: DPRT1 Position */
  781. #define USBH_HcMiscControl_DPRT1_Msk (0x1ul << USBH_HcMiscControl_DPRT1_Pos) /*!< USBH_T::HcMiscControl: DPRT1 Mask */
  782. /**@}*/ /* USBH_CONST */
  783. /**@}*/ /* end of USBH register group */
  784. /*---------------------- HSUSBH HSUSB Host Controller -------------------------*/
  785. /**
  786. @addtogroup HSUSBH High Speed USB Host Controller (HSUSBH)
  787. Memory Mapped Structure for HSUSBH Controller
  788. @{ */
  789. typedef struct
  790. {
  791. /**
  792. * @var HSUSBH_T::EHCVNR
  793. * Offset: 0x00 EHCI Version Number Register
  794. * ---------------------------------------------------------------------------------------------------
  795. * |Bits |Field |Descriptions
  796. * | :----: | :----: | :---- |
  797. * |[7:0] |CRLEN |Capability Registers Length
  798. * | | |This register is used as an offset to add to register base to find the beginning of the Operational Register Space.
  799. * |[31:16] |VERSION |Host Controller Interface Version Number
  800. * | | |This is a two-byte register containing a BCD encoding of the EHCI revision number supported by this host controller
  801. * | | |The most significant byte of this register represents a major revision and the least significant byte is the minor revision.
  802. * @var HSUSBH_T::EHCSPR
  803. * Offset: 0x04 EHCI Structural Parameters Register
  804. * ---------------------------------------------------------------------------------------------------
  805. * |Bits |Field |Descriptions
  806. * | :----: | :----: | :---- |
  807. * |[3:0] |N_PORTS |Number of Physical Downstream Ports
  808. * | | |This field specifies the number of physical downstream ports implemented on this host controller
  809. * | | |The value of this field determines how many port registers are addressable in the Operational Register Space (see Table 2-8)
  810. * | | |Valid values are in the range of 1H to FH.
  811. * | | |A zero in this field is undefined.
  812. * |[4] |PPC |Port Power Control
  813. * | | |This field indicates whether the host controller implementation includes port power control
  814. * | | |A one in this bit indicates the ports have port power switches
  815. * | | |A zero in this bit indicates the port do not have port power stitches
  816. * | | |The value of this field affects the functionality of the Port Power field in each port status and control register.
  817. * |[11:8] |N_PCC |Number of Ports Per Companion Controller
  818. * | | |This field indicates the number of ports supported per companion host controller
  819. * | | |It is used to indicate the port routing configuration to system software.
  820. * | | |For example, if N_PORTS has a value of 6 and N_CC has a value of 2 then N_PCC could have a value of 3
  821. * | | |The convention is that the first N_PCC ports are assumed to be routed to companion controller 1, the next N_PCC ports to companion controller 2, etc
  822. * | | |In the previous example, the N_PCC could have been 4, where the first 4 are routed to companion controller 1 and the last two are routed to companion controller 2.
  823. * | | |The number in this field must be consistent with N_PORTS and N_CC.
  824. * |[15:12] |N_CC |Number of Companion Controller
  825. * | | |This field indicates the number of companion controllers associated with this USB 2.0 host controller.
  826. * | | |A zero in this field indicates there are no companion host controllers
  827. * | | |Port-ownership hand-off is not supported
  828. * | | |Only high-speed devices are supported on the host controller root ports.
  829. * | | |A value larger than zero in this field indicates there are companion USB 1.1 host controller(s)
  830. * | | |Port-ownership hand-offs are supported
  831. * | | |High, Full- and Low-speed devices are supported on the host controller root ports.
  832. * @var HSUSBH_T::EHCCPR
  833. * Offset: 0x08 EHCI Capability Parameters Register
  834. * ---------------------------------------------------------------------------------------------------
  835. * |Bits |Field |Descriptions
  836. * | :----: | :----: | :---- |
  837. * |[0] |AC64 |64-bit Addressing Capability
  838. * | | |0 = Data structure using 32-bit address memory pointers.
  839. * |[1] |PFLF |Programmable Frame List Flag
  840. * | | |0 = System software must use a frame list length of 1024 elements with this EHCI host controller.
  841. * |[2] |ASPC |Asynchronous Schedule Park Capability
  842. * | | |0 = This EHCI host controller doesn't support park feature of high-speed queue heads in the Asynchronous Schedule.
  843. * |[7:4] |IST |Isochronous Scheduling Threshold
  844. * | | |This field indicates, relative to the current position of the executing host controller, where software can reliably update the isochronous schedule.
  845. * | | |When bit [7] is zero, the value of the least significant 3 bits indicates the number of micro-frames a host controller can hold a set of isochronous data structures (one or more) before flushing the state.
  846. * |[15:8] |EECP |EHCI Extended Capabilities Pointer (EECP)
  847. * | | |0 = No extended capabilities are implemented.
  848. * @var HSUSBH_T::UCMDR
  849. * Offset: 0x20 USB Command Register
  850. * ---------------------------------------------------------------------------------------------------
  851. * |Bits |Field |Descriptions
  852. * | :----: | :----: | :---- |
  853. * |[0] |RUN |Run/Stop (R/W)
  854. * | | |When set to a 1, the Host Controller proceeds with execution of the schedule
  855. * | | |The Host Controller continues execution as long as this bit is set to a 1
  856. * | | |When this bit is set to 0, the Host Controller completes the current and any actively pipelined transactions on the USB and then halts
  857. * | | |The Host Controller must halt within 16 micro-frames after software clears the Run bit
  858. * | | |The HC Halted bit in the status register indicates when the Host Controller has finished its pending pipelined transactions and has entered the stopped state
  859. * | | |Software must not write a one to this field unless the host controller is in the Halted state (i.e.
  860. * | | |HCHalted in the USBSTS register is a one)
  861. * | | |Doing so will yield undefined results.
  862. * | | |0 = Stop.
  863. * | | |1 = Run.
  864. * |[1] |HCRST |Host Controller Reset (HCRESET) (R/W)
  865. * | | |This control bit is used by software to reset the host controller
  866. * | | |The effects of this on Root Hub registers are similar to a Chip Hardware Reset.
  867. * | | |When software writes a one to this bit, the Host Controller resets its internal pipelines, timers, counters, state machines, etc
  868. * | | |to their initial value
  869. * | | |Any transaction currently in progress on USB is immediately terminated
  870. * | | |A USB reset is not driven on downstream ports.
  871. * | | |All operational registers, including port registers and port state machines are set to their initial values
  872. * | | |Port ownership reverts to the companion host controller(s), with the side effects
  873. * | | |Software must reinitialize the host controller in order to return the host controller to an operational state.
  874. * | | |This bit is set to zero by the Host Controller when the reset process is complete
  875. * | | |Software cannot terminate the reset process early by writing a zero to this register.
  876. * | | |Software should not set this bit to a one when the HCHalted bit in the USBSTS register is a zero
  877. * | | |Attempting to reset an actively running host controller will result in undefined behavior.
  878. * |[3:2] |FLSZ |Frame List Size (R/W or RO)
  879. * | | |This field is R/W only if Programmable Frame List Flag in the HCCPARAMS registers is set to a one
  880. * | | |This field specifies the size of the frame list
  881. * | | |The size the frame list controls which bits in the Frame Index Register should be used for the Frame List Current index
  882. * | | |Values mean:
  883. * | | |00 = 1024 elements (4096 bytes) Default value.
  884. * | | |01 = 512 elements (2048 bytes).
  885. * | | |10 = 256 elements (1024 bytes) u2013 for resource-constrained environment.
  886. * | | |11 = Reserved.
  887. * |[4] |PSEN |Periodic Schedule Enable (R/W)
  888. * | | |This bit controls whether the host controller skips processing the Periodic Schedule. Values mean:
  889. * | | |0 = Do not process the Periodic Schedule.
  890. * | | |1 = Use the PERIODICLISTBASE register to access the Periodic Schedule.
  891. * |[5] |ASEN |Asynchronous Schedule Enable (R/W)
  892. * | | |This bit controls whether the host controller skips processing the Asynchronous Schedule. Values mean:
  893. * | | |0 = Do not process the Asynchronous Schedule.
  894. * | | |1 = Use the ASYNCLISTADDR register to access the Asynchronous Schedule.
  895. * |[6] |IAAD |Interrupt on Asynchronous Advance Doorbell (R/W)
  896. * | | |This bit is used as a doorbell by software to tell the host controller to issue an interrupt the next time it advances asynchronous schedule
  897. * | | |Software must write a 1 to this bit to ring the doorbell.
  898. * | | |When the host controller has evicted all appropriate cached schedule state, it sets the Interrupt on Asynchronous Advance status bit in the USBSTS register
  899. * | | |If the Interrupt on Asynchronous Advance Enable bit in the USBINTR register is a one then the host controller will assert an interrupt at the next interrupt threshold.
  900. * | | |The host controller sets this bit to a zero after it has set the Interrupt on Asynchronous Advance status bit in the USBSTS register to a one.
  901. * | | |Software should not write a one to this bit when the asynchronous schedule is disabled
  902. * | | |Doing so will yield undefined results.
  903. * |[23:16] |ITC |Interrupt Threshold Control (R/W)
  904. * | | |This field is used by system software to select the maximum rate at which the host controller will issue interrupts
  905. * | | |The only valid values are defined below
  906. * | | |If software writes an invalid value to this register, the results are undefined
  907. * | | |Value Maximum Interrupt Interval
  908. * | | |0x00 = Reserved.
  909. * | | |0x01 = 1 micro-frame.
  910. * | | |0x02 = 2 micro-frames.
  911. * | | |0x04 = 4 micro-frames.
  912. * | | |0x08 = 8 micro-frames (default, equates to 1 ms).
  913. * | | |0x10 = 16 micro-frames (2 ms).
  914. * | | |0x20 = 32 micro-frames (4 ms).
  915. * | | |0x40 = 64 micro-frames (8 ms).
  916. * | | |Any other value in this register yields undefined results.
  917. * | | |Software modifications to this bit while HCHalted bit is equal to zero results in undefined behavior.
  918. * @var HSUSBH_T::USTSR
  919. * Offset: 0x24 USB Status Register
  920. * ---------------------------------------------------------------------------------------------------
  921. * |Bits |Field |Descriptions
  922. * | :----: | :----: | :---- |
  923. * |[0] |USBINT |USB Interrupt (USBINT) (R/WC)
  924. * | | |The Host Controller sets this bit to 1 on the completion of a USB transaction, which results in the retirement of a Transfer Descriptor that had its IOC bit set.
  925. * | | |The Host Controller also sets this bit to 1 when a short packet is detected (actual number of bytes received was less than the expected number of bytes).
  926. * |[1] |UERRINT |USB Error Interrupt (USBERRINT) (R/WC)
  927. * | | |The Host Controller sets this bit to 1 when completion of a USB transaction results in an error condition (e.g., error counter underflow)
  928. * | | |If the TD on which the error interrupt occurred also had its IOC bit set, both this bit and USBINT bit are set.
  929. * |[2] |PCD |Port Change Detect (R/WC)
  930. * | | |The Host Controller sets this bit to a one when any port for which the Port Owner bit is set to zero has a change bit transition from a zero to a one or a Force Port Resume bit transition from a zero to a one as a result of a J-K transition detected on a suspended port
  931. * | | |This bit will also be set as a result of the Connect Status Change being set to a one after system software has relinquished ownership of a connected port by writing a one to a port's Port Owner bit.
  932. * | | |This bit is allowed to be maintained in the Auxiliary power well
  933. * | | |Alternatively, it is also acceptable that on a D3 to D0 transition of the EHCI HC device, this bit is loaded with the OR of all of the PORTSC change bits (including: Force port resume, over-current change, enable/disable change and connect status change).
  934. * |[3] |FLR |Frame List Rollover (R/WC)
  935. * | | |The Host Controller sets this bit to a one when the Frame List Index rolls over from its maximum value to zero
  936. * | | |The exact value at which the rollover occurs depends on the frame list size
  937. * | | |For example, if the frame list size (as programmed in the Frame List Size field of the USBCMD register) is 1024, the Frame Index Register rolls over every time FRINDEX[13] toggles
  938. * | | |Similarly, if the size is 512, the Host Controller sets this bit to a one every time FRINDEX[12] toggles.
  939. * |[4] |HSERR |Host System Error (R/WC)
  940. * | | |The Host Controller sets this bit to 1 when a serious error occurs during a host system access involving the Host Controller module.
  941. * |[5] |IAA |Interrupt on Asynchronous Advance (R/WC)
  942. * | | |System software can force the host controller to issue an interrupt the next time the host controller advances the asynchronous schedule by writing a one to the Interrupt on Asynchronous Advance Doorbell bit in the USBCMD register
  943. * | | |This status bit indicates the assertion of that interrupt source.
  944. * |[12] |HCHalted |HCHalted (RO)
  945. * | | |This bit is a zero whenever the Run/Stop bit is a one
  946. * | | |The Host Controller sets this bit to one after it has stopped executing as a result of the Run/Stop bit being set to 0, either by software or by the Host Controller hardware (e.g.
  947. * | | |internal error).
  948. * |[13] |RECLA |Reclamation (RO)
  949. * | | |This is a read-only status bit, which is used to detect an empty asynchronous schedule.
  950. * |[14] |PSS |Periodic Schedule Status (RO)
  951. * | | |The bit reports the current real status of the Periodic Schedule
  952. * | | |If this bit is a zero then the status of the Periodic Schedule is disabled
  953. * | | |If this bit is a one then the status of the Periodic Schedule is enabled
  954. * | | |The Host Controller is not required to immediately disable or enable the Periodic Schedule when software transitions the Periodic Schedule Enable bit in the USBCMD register
  955. * | | |When this bit and the Periodic Schedule Enable bit are the same value, the Periodic Schedule is either enabled (1) or disabled (0).
  956. * |[15] |ASS |Asynchronous Schedule Status (RO)
  957. * | | |The bit reports the current real status of the Asynchronous Schedule
  958. * | | |If this bit is a zero then the status of them Asynchronous Schedule is disabled
  959. * | | |If this bit is a one then the status of the Asynchronous Schedule is enabled
  960. * | | |The Host Controller is not required to immediately disable or enable the Asynchronous Schedule when software transitions the Asynchronous Schedule Enable bit in the USBCMD register
  961. * | | |When this bit and the Asynchronous Schedule Enable bit are the same value, the Asynchronous Schedule is either enabled (1) or disabled (0).
  962. * @var HSUSBH_T::UIENR
  963. * Offset: 0x28 USB Interrupt Enable Register
  964. * ---------------------------------------------------------------------------------------------------
  965. * |Bits |Field |Descriptions
  966. * | :----: | :----: | :---- |
  967. * |[0] |USBIEN |USB Interrupt Enable or Disable Bit
  968. * | | |When this bit is a one, and the USBINT bit in the USBSTS register is a one, the host controller will issue an interrupt at the next interrupt threshold
  969. * | | |The interrupt is acknowledged by software clearing the USBINT bit.
  970. * | | |0 = USB interrupt Disabled.
  971. * | | |1 = USB interrupt Enabled.
  972. * |[1] |UERRIEN |USB Error Interrupt Enable or Disable Bit
  973. * | | |When this bit is a one, and the USBERRINT bit in the USBSTS register is a one, the host t controller will issue an interrupt at the next interrupt threshold
  974. * | | |The interrupt is acknowledged by software clearing the USBERRINT bit.
  975. * | | |0 = USB Error interrupt Disabled.
  976. * | | |1 = USB Error interrupt Enabled.
  977. * |[2] |PCIEN |Port Change Interrupt Enable or Disable Bit
  978. * | | |When this bit is a one, and the Port Change Detect bit in the USBSTS register is a one, the host controller will issue an interrupt
  979. * | | |The interrupt is acknowledged by software clearing the Port Change Detect bit.
  980. * | | |0 = Port Change interrupt Disabled.
  981. * | | |1 = Port Change interrupt Enabled.
  982. * |[3] |FLREN |Frame List Rollover Enable or Disable Bit
  983. * | | |When this bit is a one, and the Frame List Rollover bit in the USBSTS register is a one, the host controller will issue an interrupt
  984. * | | |The interrupt is acknowledged by software clearing the Frame List Rollover bit.
  985. * | | |0 = Frame List Rollover interrupt Disabled.
  986. * | | |1 = Frame List Rollover interrupt Enabled.
  987. * |[4] |HSERREN |Host System Error Enable or Disable Bit
  988. * | | |When this bit is a one, and the Host System Error Status bit in the USBSTS register is a one, the host controller will issue an interrupt
  989. * | | |The interrupt is acknowledged by software clearing the Host System Error bit.
  990. * | | |0 = Host System Error interrupt Disabled.
  991. * | | |1 = Host System Error interrupt Enabled.
  992. * |[5] |IAAEN |Interrupt on Asynchronous Advance Enable or Disable Bit
  993. * | | |When this bit is a one, and the Interrupt on Asynchronous Advance bit in the USBSTS register is a one, the host controller will issue an interrupt at the next interrupt threshold
  994. * | | |The interrupt is acknowledged by software clearing the Interrupt on Asynchronous Advance bit.
  995. * | | |0 = Interrupt on Asynchronous Advance Disabled.
  996. * | | |1 = Interrupt on Asynchronous Advance Enabled.
  997. * @var HSUSBH_T::UFINDR
  998. * Offset: 0x2C USB Frame Index Register
  999. * ---------------------------------------------------------------------------------------------------
  1000. * |Bits |Field |Descriptions
  1001. * | :----: | :----: | :---- |
  1002. * |[13:0] |FI |Frame Index
  1003. * | | |The value in this register increment at the end of each time frame (e.g.
  1004. * | | |micro-frame)
  1005. * | | |Bits [N:3] are used for the Frame List current index
  1006. * | | |This means that each location of the frame list is accessed 8 times (frames or micro-frames) before moving to the next index
  1007. * | | |The following illustrates values of N based on the value of the Frame List Size field in the USBCMD register.
  1008. * | | |FLSZ (UCMDR[3:2] Number Elements N
  1009. * | | |0x0 1024 12
  1010. * | | |0x1 512 11
  1011. * | | |0x2 256 10
  1012. * | | |0x3 Reserved
  1013. * @var HSUSBH_T::UPFLBAR
  1014. * Offset: 0x34 USB Periodic Frame List Base Address Register
  1015. * ---------------------------------------------------------------------------------------------------
  1016. * |Bits |Field |Descriptions
  1017. * | :----: | :----: | :---- |
  1018. * |[31:12] |BADDR |Base Address
  1019. * | | |These bits correspond to memory address signals [31:12], respectively.
  1020. * @var HSUSBH_T::UCALAR
  1021. * Offset: 0x38 USB Current Asynchronous List Address Register
  1022. * ---------------------------------------------------------------------------------------------------
  1023. * |Bits |Field |Descriptions
  1024. * | :----: | :----: | :---- |
  1025. * |[31:5] |LPL |Link Pointer Low (LPL)
  1026. * | | |These bits correspond to memory address signals [31:5], respectively
  1027. * | | |This field may only reference a Queue Head (QH).
  1028. * @var HSUSBH_T::UASSTR
  1029. * Offset: 0x3C USB Asynchronous Schedule Sleep Timer Register
  1030. * ---------------------------------------------------------------------------------------------------
  1031. * |Bits |Field |Descriptions
  1032. * | :----: | :----: | :---- |
  1033. * |[11:0] |ASSTMR |Asynchronous Schedule Sleep Timer
  1034. * | | |This field defines the AsyncSchedSleepTime of EHCI spec.
  1035. * | | |The asynchronous schedule sleep timer is used to control how often the host controller fetches asynchronous schedule list from system memory while the asynchronous schedule is empty.
  1036. * | | |The default value of this timer is 12'hBD6
  1037. * | | |Because this timer is implemented in UTMI clock (30MHz) domain, the default sleeping time will be about 100us.
  1038. * @var HSUSBH_T::UCFGR
  1039. * Offset: 0x60 USB Configure Flag Register
  1040. * ---------------------------------------------------------------------------------------------------
  1041. * |Bits |Field |Descriptions
  1042. * | :----: | :----: | :---- |
  1043. * |[0] |CF |Configure Flag (CF)
  1044. * | | |Host software sets this bit as the last action in its process of configuring the Host Controller
  1045. * | | |This bit controls the default port-routing control logic
  1046. * | | |Bit values and side-effects are listed below.
  1047. * | | |0 = Port routing control logic default-routes each port to an implementation dependent classic host controller.
  1048. * | | |1 = Port routing control logic default-routes all ports to this host controller.
  1049. * @var HSUSBH_T::UPSCR[2]
  1050. * Offset: 0x64~0x68 USB Port 0~1 Status and Control Register
  1051. * ---------------------------------------------------------------------------------------------------
  1052. * |Bits |Field |Descriptions
  1053. * | :----: | :----: | :---- |
  1054. * |[0] |CCS |Current Connect Status (RO)
  1055. * | | |This value reflects the current state of the port, and may not correspond directly to the event that caused the Connect Status Change bit (Bit 1) to be set.
  1056. * | | |This field is zero if Port Power is zero.
  1057. * | | |0 = No device is present.
  1058. * | | |1 = Device is present on port.
  1059. * |[1] |CSC |Connect Status Change (R/W)
  1060. * | | |Indicates a change has occurred in the port's Current Connect Status
  1061. * | | |The host controller sets this bit for all changes to the port device connect status, even if system software has not cleared an existing connect status change
  1062. * | | |For example, the insertion status changes twice before system software has cleared the changed condition, hub hardware will be "setting" an already-set bit (i.e., the bit will remain set).Software sets this bit to 0 by writing a 1 to it.
  1063. * | | |This field is zero if Port Power is zero.
  1064. * | | |0 = No change.
  1065. * | | |1 = Change in Current Connect Status.
  1066. * |[2] |PE |Port Enabled/Disabled (R/W)
  1067. * | | |Ports can only be enabled by the host controller as a part of the reset and enable
  1068. * | | |Software cannot enable a port by writing a one to this field
  1069. * | | |The host controller will only set this bit to a one when the reset sequence determines that the attached device is a high-speed device.
  1070. * | | |Ports can be disabled by either a fault condition (disconnect event or other fault condition) or by host software
  1071. * | | |Note that the bit status does not change until the port state actually changes
  1072. * | | |There may be a delay in disabling or enabling a port due to other host controller and bus events.
  1073. * | | |When the port is disabled (0b) downstream propagation of data is blocked on this port, except for reset.
  1074. * | | |This field is zero if Port Power is zero.
  1075. * | | |0 = Port Disabled.
  1076. * | | |1 = Port Enabled.
  1077. * |[3] |PEC |Port Enable/Disable Change (R/WC)
  1078. * | | |For the root hub, this bit gets set to a one only when a port is disabled due to the appropriate conditions existing at the EOF2 point (See Chapter 11 of the USB Specification for the definition of a Port Error)
  1079. * | | |Software clears this bit by writing a 1 to it.
  1080. * | | |This field is zero if Port Power is zero.
  1081. * | | |0 = No change.
  1082. * | | |1 = Port enabled/disabled status has changed.
  1083. * |[4] |OCA |Over-current Active (RO)
  1084. * | | |This bit will automatically transition from a one to a zero when the over current condition is removed.
  1085. * | | |0 = This port does not have an over-current condition.
  1086. * | | |1 = This port currently has an over-current condition.
  1087. * |[5] |OCC |Over-current Change (R/WC)
  1088. * | | |1 = This bit gets set to a one when there is a change to Over-current Active
  1089. * | | |Software clears this bit by writing a one to this bit position.
  1090. * |[6] |FPR |Force Port Resume (R/W)
  1091. * | | |This functionality defined for manipulating this bit depends on the value of the Suspend bit
  1092. * | | |For example, if the port is not suspended (Suspend and Enabled bits are a one) and software transitions this bit to a one, then the effects on the bus are undefined.
  1093. * | | |Software sets this bit to a 1 to drive resume signaling
  1094. * | | |The Host Controller sets this bit to a 1 if a J-to-K transition is detected while the port is in the Suspend state
  1095. * | | |When this bit transitions to a one because a J-to-K transition is detected, the Port Change Detect bit in the USBSTS register is also set to a one
  1096. * | | |If software sets this bit to a one, the host controller must not set the Port Change Detect bit.
  1097. * | | |Note that when the EHCI controller owns the port, the resume sequence follows the defined sequence documented in the USB Specification Revision 2.0
  1098. * | | |The resume signaling (Full-speed 'K') is driven on the port as long as this bit remains a one
  1099. * | | |Software must appropriately time the Resume and set this bit to a zero when the appropriate amount of time has elapsed
  1100. * | | |Writing a zero (from one) causes the port to return to high-speed mode (forcing the bus below the port into a high-speed idle)
  1101. * | | |This bit will remain a one until the port has switched to the high-speed idle
  1102. * | | |The host controller must complete this transition within 2 milliseconds of software setting this bit to a zero.
  1103. * | | |This field is zero if Port Power is zero.
  1104. * | | |0 = No resume (K-state) detected/driven on port.
  1105. * | | |1 = Resume detected/driven on port.
  1106. * |[7] |SUSPEND |Suspend (R/W)
  1107. * | | |Port Enabled Bit and Suspend bit of this register define the port states as follows:
  1108. * | | |Port enable is 0 and suspend is 0 = Disable.
  1109. * | | |Port enable is 0 and suspend is 1 = Disable.
  1110. * | | |Port enable is 1 and suspend is 0 = Enable.
  1111. * | | |Port enable is 1 and suspend is 1 = Suspend.
  1112. * | | |When in suspend state, downstream propagation of data is blocked on this port, except for port reset
  1113. * | | |The blocking occurs at the end of the current transaction, if a transaction was in progress when this bit was written to 1
  1114. * | | |In the suspend state, the port is sensitive to resume detection
  1115. * | | |Note that the bit status does not change until the port is suspended and that there may be a delay in suspending a port if there is a transaction currently in progress on the USB.
  1116. * | | |A write of zero to this bit is ignored by the host controller
  1117. * | | |The host controller will unconditionally set this bit to a zero when:
  1118. * | | |Software sets the Force Port Resume bit to a zero (from a one).
  1119. * | | |Software sets the Port Reset bit to a one (from a zero).
  1120. * | | |If host software sets this bit to a one when the port is not enabled (i.e.
  1121. * | | |Port enabled bit is a zero) the results are undefined.
  1122. * | | |This field is zero if Port Power is zero.
  1123. * | | |0 = Port not in suspend state.
  1124. * | | |1 = Port in suspend state.
  1125. * |[8] |PRST |Port Reset (R/W)
  1126. * | | |When software writes a one to this bit (from a zero), the bus reset sequence as defined in the USB Specification Revision 2.0 is started
  1127. * | | |Software writes a zero to this bit to terminate the bus reset sequence
  1128. * | | |Software must keep this bit at a one long enough to ensure the reset sequence, as specified in the USB Specification Revision 2.0, completes
  1129. * | | |Note: when software writes this bit to a one, it must also write a zero to the Port Enable bit.
  1130. * | | |Note that when software writes a zero to this bit there may be a delay before the bit status changes to a zero
  1131. * | | |The bit status will not read as a zero until after the reset has completed
  1132. * | | |If the port is in high-speed mode after reset is complete, the host controller will automatically enable this port (e.g.
  1133. * | | |set the Port Enable bit to a one)
  1134. * | | |A host controller must terminate the reset and stabilize the state of the port within 2 milliseconds of software transitioning this bit from a one to a zero
  1135. * | | |For example: if the port detects that the attached device is high-speed during reset, then the host controller must have the port in the enabled state within 2ms of software writing this bit to a zero.
  1136. * | | |The HCHalted bit in the USBSTS register should be a zero before software attempts to use this bit
  1137. * | | |The host controller may hold Port Reset asserted to a one when the HCHalted bit is a one.
  1138. * | | |This field is zero if Port Power is zero.
  1139. * | | |0 = Port is not in Reset.
  1140. * | | |1 = Port is in Reset.
  1141. * |[11:10] |LSTS |Line Status (RO)
  1142. * | | |These bits reflect the current logical levels of the D+ (bit 11) and D- (bit 10) signal lines
  1143. * | | |These bits are used for detection of low-speed USB devices prior to the port reset and enable sequence
  1144. * | | |This field is valid only when the port enable bit is zero and the current connect status bit is set to a one.
  1145. * | | |The encoding of the bits are:
  1146. * | | |Bits[11:10] USB State Interpretation
  1147. * | | |00 = SE0 Not Low-speed device, perform EHCI reset.
  1148. * | | |01 = K-state Low-speed device, release ownership of port.
  1149. * | | |10 = J-state Not Low-speed device, perform EHCI reset.
  1150. * | | |11 = Undefined Not Low-speed device, perform EHCI reset.
  1151. * | | |This value of this field is undefined if Port Power is zero.
  1152. * |[12] |PP |Port Power (PP)
  1153. * | | |Host controller has port power control switches
  1154. * | | |This bit represents the Current setting of the switch (0 = off, 1 = on)
  1155. * | | |When power is not available on a port (i.e.
  1156. * | | |PP equals a 0), the port is nonfunctional and will not report attaches, detaches, etc.
  1157. * | | |When an over-current condition is detected on a powered port and PPC is a one, the PP bit in each affected port may be transitioned by the host controller from a 1 to 0 (removing power from the port).
  1158. * |[13] |PO |Port Owner (R/W)
  1159. * | | |This bit unconditionally goes to a 0b when the Configured bit in the CONFIGFLAG register makes a 0 to 1 transition
  1160. * | | |This bit unconditionally goes to 1 whenever the Configured bit is zero.
  1161. * | | |System software uses this field to release ownership of the port to a selected host controller (in the event that the attached device is not a high-speed device)
  1162. * | | |Software writes a one to this bit when the attached device is not a high-speed device
  1163. * | | |A one in this bit means that a companion host controller owns and controls the port.
  1164. * |[19:16] |PTC |Port Test Control (R/W)
  1165. * | | |When this field is zero, the port is NOT operating in a test mode
  1166. * | | |A non-zero value indicates that it is operating in test mode and the specific test mode is indicated by the specific value
  1167. * | | |The encoding of the test mode bits are (0x6 ~ 0xF are reserved):
  1168. * | | |Bits Test Mode
  1169. * | | |0x0 = Test mode not enabled.
  1170. * | | |0x1 = Test J_STATE.
  1171. * | | |0x2 = Test K_STATE.
  1172. * | | |0x3 = Test SE0_NAK.
  1173. * | | |0x4 = Test Packet.
  1174. * | | |0x5 = Test FORCE_ENABLE.
  1175. * @var HSUSBH_T::USBPCR0
  1176. * Offset: 0xC4 USB PHY 0 Control Register
  1177. * ---------------------------------------------------------------------------------------------------
  1178. * |Bits |Field |Descriptions
  1179. * | :----: | :----: | :---- |
  1180. * |[8] |SUSPEND |Suspend Assertion
  1181. * | | |This bit controls the suspend mode of USB PHY 0.
  1182. * | | |While PHY was suspended, all circuits of PHY were powered down and outputs are tri-state.
  1183. * | | |This bit is 1'b0 in default
  1184. * | | |This means the USB PHY 0 is suspended in default
  1185. * | | |It is necessary to set this bit 1'b1 to make USB PHY 0 leave suspend mode before doing configuration of USB host.
  1186. * | | |0 = USB PHY 0 was suspended.
  1187. * | | |1 = USB PHY 0 was not suspended.
  1188. * |[11] |CLKVALID |UTMI Clock Valid
  1189. * | | |This bit is a flag to indicate if the UTMI clock from USB 2.0 PHY is ready
  1190. * | | |S/W program must prevent to write other control registers before this UTMI clock valid flag is active.
  1191. * | | |0 = UTMI clock is not valid.
  1192. * | | |1 = UTMI clock is valid.
  1193. * @var HSUSBH_T::USBPCR1
  1194. * Offset: 0xC8 USB PHY 1 Control Register
  1195. * ---------------------------------------------------------------------------------------------------
  1196. * |Bits |Field |Descriptions
  1197. * | :----: | :----: | :---- |
  1198. * |[8] |SUSPEND |Suspend Assertion
  1199. * | | |This bit controls the suspend mode of USB PHY 1.
  1200. * | | |While PHY was suspended, all circuits of PHY were powered down and outputs are tri-state.
  1201. * | | |This bit is 1'b0 in default
  1202. * | | |This means the USB PHY 0 is suspended in default
  1203. * | | |It is necessary to set this bit 1'b1 to make USB PHY 0 leave suspend mode before doing configuration of USB host.
  1204. * | | |0 = USB PHY 1 was suspended.
  1205. * | | |1 = USB PHY 1 was not suspended.
  1206. */
  1207. __I uint32_t EHCVNR; /*!< [0x0000] EHCI Version Number Register */
  1208. __I uint32_t EHCSPR; /*!< [0x0004] EHCI Structural Parameters Register */
  1209. __I uint32_t EHCCPR; /*!< [0x0008] EHCI Capability Parameters Register */
  1210. __I uint32_t RESERVE0[5];
  1211. __IO uint32_t UCMDR; /*!< [0x0020] USB Command Register */
  1212. __IO uint32_t USTSR; /*!< [0x0024] USB Status Register */
  1213. __IO uint32_t UIENR; /*!< [0x0028] USB Interrupt Enable Register */
  1214. __IO uint32_t UFINDR; /*!< [0x002c] USB Frame Index Register */
  1215. __I uint32_t RESERVE1[1];
  1216. __IO uint32_t UPFLBAR; /*!< [0x0034] USB Periodic Frame List Base Address Register */
  1217. __IO uint32_t UCALAR; /*!< [0x0038] USB Current Asynchronous List Address Register */
  1218. __IO uint32_t UASSTR; /*!< [0x003c] USB Asynchronous Schedule Sleep Timer Register */
  1219. __I uint32_t RESERVE2[8];
  1220. __IO uint32_t UCFGR; /*!< [0x0060] USB Configure Flag Register */
  1221. __IO uint32_t UPSCR[2]; /*!< [0x0064] ~ [0x0068] USB Port 0 & 1 Status and Control Register */
  1222. __I uint32_t RESERVE3[22];
  1223. __IO uint32_t USBPCR0; /*!< [0x00c4] USB PHY 0 Control Register */
  1224. __IO uint32_t USBPCR1; /*!< [0x00c8] USB PHY 1 Control Register */
  1225. } HSUSBH_T;
  1226. /**
  1227. @addtogroup HSUSBH_CONST HSUSBH Bit Field Definition
  1228. Constant Definitions for HSUSBH Controller
  1229. @{ */
  1230. #define HSUSBH_EHCVNR_CRLEN_Pos (0) /*!< HSUSBH_T::EHCVNR: CRLEN Position */
  1231. #define HSUSBH_EHCVNR_CRLEN_Msk (0xfful << HSUSBH_EHCVNR_CRLEN_Pos) /*!< HSUSBH_T::EHCVNR: CRLEN Mask */
  1232. #define HSUSBH_EHCVNR_VERSION_Pos (16) /*!< HSUSBH_T::EHCVNR: VERSION Position */
  1233. #define HSUSBH_EHCVNR_VERSION_Msk (0xfffful << HSUSBH_EHCVNR_VERSION_Pos) /*!< HSUSBH_T::EHCVNR: VERSION Mask */
  1234. #define HSUSBH_EHCSPR_N_PORTS_Pos (0) /*!< HSUSBH_T::EHCSPR: N_PORTS Position */
  1235. #define HSUSBH_EHCSPR_N_PORTS_Msk (0xful << HSUSBH_EHCSPR_N_PORTS_Pos) /*!< HSUSBH_T::EHCSPR: N_PORTS Mask */
  1236. #define HSUSBH_EHCSPR_PPC_Pos (4) /*!< HSUSBH_T::EHCSPR: PPC Position */
  1237. #define HSUSBH_EHCSPR_PPC_Msk (0x1ul << HSUSBH_EHCSPR_PPC_Pos) /*!< HSUSBH_T::EHCSPR: PPC Mask */
  1238. #define HSUSBH_EHCSPR_N_PCC_Pos (8) /*!< HSUSBH_T::EHCSPR: N_PCC Position */
  1239. #define HSUSBH_EHCSPR_N_PCC_Msk (0xful << HSUSBH_EHCSPR_N_PCC_Pos) /*!< HSUSBH_T::EHCSPR: N_PCC Mask */
  1240. #define HSUSBH_EHCSPR_N_CC_Pos (12) /*!< HSUSBH_T::EHCSPR: N_CC Position */
  1241. #define HSUSBH_EHCSPR_N_CC_Msk (0xful << HSUSBH_EHCSPR_N_CC_Pos) /*!< HSUSBH_T::EHCSPR: N_CC Mask */
  1242. #define HSUSBH_EHCCPR_AC64_Pos (0) /*!< HSUSBH_T::EHCCPR: AC64 Position */
  1243. #define HSUSBH_EHCCPR_AC64_Msk (0x1ul << HSUSBH_EHCCPR_AC64_Pos) /*!< HSUSBH_T::EHCCPR: AC64 Mask */
  1244. #define HSUSBH_EHCCPR_PFLF_Pos (1) /*!< HSUSBH_T::EHCCPR: PFLF Position */
  1245. #define HSUSBH_EHCCPR_PFLF_Msk (0x1ul << HSUSBH_EHCCPR_PFLF_Pos) /*!< HSUSBH_T::EHCCPR: PFLF Mask */
  1246. #define HSUSBH_EHCCPR_ASPC_Pos (2) /*!< HSUSBH_T::EHCCPR: ASPC Position */
  1247. #define HSUSBH_EHCCPR_ASPC_Msk (0x1ul << HSUSBH_EHCCPR_ASPC_Pos) /*!< HSUSBH_T::EHCCPR: ASPC Mask */
  1248. #define HSUSBH_EHCCPR_IST_Pos (4) /*!< HSUSBH_T::EHCCPR: IST Position */
  1249. #define HSUSBH_EHCCPR_IST_Msk (0xful << HSUSBH_EHCCPR_IST_Pos) /*!< HSUSBH_T::EHCCPR: IST Mask */
  1250. #define HSUSBH_EHCCPR_EECP_Pos (8) /*!< HSUSBH_T::EHCCPR: EECP Position */
  1251. #define HSUSBH_EHCCPR_EECP_Msk (0xfful << HSUSBH_EHCCPR_EECP_Pos) /*!< HSUSBH_T::EHCCPR: EECP Mask */
  1252. #define HSUSBH_UCMDR_RUN_Pos (0) /*!< HSUSBH_T::UCMDR: RUN Position */
  1253. #define HSUSBH_UCMDR_RUN_Msk (0x1ul << HSUSBH_UCMDR_RUN_Pos) /*!< HSUSBH_T::UCMDR: RUN Mask */
  1254. #define HSUSBH_UCMDR_HCRST_Pos (1) /*!< HSUSBH_T::UCMDR: HCRST Position */
  1255. #define HSUSBH_UCMDR_HCRST_Msk (0x1ul << HSUSBH_UCMDR_HCRST_Pos) /*!< HSUSBH_T::UCMDR: HCRST Mask */
  1256. #define HSUSBH_UCMDR_FLSZ_Pos (2) /*!< HSUSBH_T::UCMDR: FLSZ Position */
  1257. #define HSUSBH_UCMDR_FLSZ_Msk (0x3ul << HSUSBH_UCMDR_FLSZ_Pos) /*!< HSUSBH_T::UCMDR: FLSZ Mask */
  1258. #define HSUSBH_UCMDR_PSEN_Pos (4) /*!< HSUSBH_T::UCMDR: PSEN Position */
  1259. #define HSUSBH_UCMDR_PSEN_Msk (0x1ul << HSUSBH_UCMDR_PSEN_Pos) /*!< HSUSBH_T::UCMDR: PSEN Mask */
  1260. #define HSUSBH_UCMDR_ASEN_Pos (5) /*!< HSUSBH_T::UCMDR: ASEN Position */
  1261. #define HSUSBH_UCMDR_ASEN_Msk (0x1ul << HSUSBH_UCMDR_ASEN_Pos) /*!< HSUSBH_T::UCMDR: ASEN Mask */
  1262. #define HSUSBH_UCMDR_IAAD_Pos (6) /*!< HSUSBH_T::UCMDR: IAAD Position */
  1263. #define HSUSBH_UCMDR_IAAD_Msk (0x1ul << HSUSBH_UCMDR_IAAD_Pos) /*!< HSUSBH_T::UCMDR: IAAD Mask */
  1264. #define HSUSBH_UCMDR_ITC_Pos (16) /*!< HSUSBH_T::UCMDR: ITC Position */
  1265. #define HSUSBH_UCMDR_ITC_Msk (0xfful << HSUSBH_UCMDR_ITC_Pos) /*!< HSUSBH_T::UCMDR: ITC Mask */
  1266. #define HSUSBH_USTSR_USBINT_Pos (0) /*!< HSUSBH_T::USTSR: USBINT Position */
  1267. #define HSUSBH_USTSR_USBINT_Msk (0x1ul << HSUSBH_USTSR_USBINT_Pos) /*!< HSUSBH_T::USTSR: USBINT Mask */
  1268. #define HSUSBH_USTSR_UERRINT_Pos (1) /*!< HSUSBH_T::USTSR: UERRINT Position */
  1269. #define HSUSBH_USTSR_UERRINT_Msk (0x1ul << HSUSBH_USTSR_UERRINT_Pos) /*!< HSUSBH_T::USTSR: UERRINT Mask */
  1270. #define HSUSBH_USTSR_PCD_Pos (2) /*!< HSUSBH_T::USTSR: PCD Position */
  1271. #define HSUSBH_USTSR_PCD_Msk (0x1ul << HSUSBH_USTSR_PCD_Pos) /*!< HSUSBH_T::USTSR: PCD Mask */
  1272. #define HSUSBH_USTSR_FLR_Pos (3) /*!< HSUSBH_T::USTSR: FLR Position */
  1273. #define HSUSBH_USTSR_FLR_Msk (0x1ul << HSUSBH_USTSR_FLR_Pos) /*!< HSUSBH_T::USTSR: FLR Mask */
  1274. #define HSUSBH_USTSR_HSERR_Pos (4) /*!< HSUSBH_T::USTSR: HSERR Position */
  1275. #define HSUSBH_USTSR_HSERR_Msk (0x1ul << HSUSBH_USTSR_HSERR_Pos) /*!< HSUSBH_T::USTSR: HSERR Mask */
  1276. #define HSUSBH_USTSR_IAA_Pos (5) /*!< HSUSBH_T::USTSR: IAA Position */
  1277. #define HSUSBH_USTSR_IAA_Msk (0x1ul << HSUSBH_USTSR_IAA_Pos) /*!< HSUSBH_T::USTSR: IAA Mask */
  1278. #define HSUSBH_USTSR_HCHalted_Pos (12) /*!< HSUSBH_T::USTSR: HCHalted Position */
  1279. #define HSUSBH_USTSR_HCHalted_Msk (0x1ul << HSUSBH_USTSR_HCHalted_Pos) /*!< HSUSBH_T::USTSR: HCHalted Mask */
  1280. #define HSUSBH_USTSR_RECLA_Pos (13) /*!< HSUSBH_T::USTSR: RECLA Position */
  1281. #define HSUSBH_USTSR_RECLA_Msk (0x1ul << HSUSBH_USTSR_RECLA_Pos) /*!< HSUSBH_T::USTSR: RECLA Mask */
  1282. #define HSUSBH_USTSR_PSS_Pos (14) /*!< HSUSBH_T::USTSR: PSS Position */
  1283. #define HSUSBH_USTSR_PSS_Msk (0x1ul << HSUSBH_USTSR_PSS_Pos) /*!< HSUSBH_T::USTSR: PSS Mask */
  1284. #define HSUSBH_USTSR_ASS_Pos (15) /*!< HSUSBH_T::USTSR: ASS Position */
  1285. #define HSUSBH_USTSR_ASS_Msk (0x1ul << HSUSBH_USTSR_ASS_Pos) /*!< HSUSBH_T::USTSR: ASS Mask */
  1286. #define HSUSBH_UIENR_USBIEN_Pos (0) /*!< HSUSBH_T::UIENR: USBIEN Position */
  1287. #define HSUSBH_UIENR_USBIEN_Msk (0x1ul << HSUSBH_UIENR_USBIEN_Pos) /*!< HSUSBH_T::UIENR: USBIEN Mask */
  1288. #define HSUSBH_UIENR_UERRIEN_Pos (1) /*!< HSUSBH_T::UIENR: UERRIEN Position */
  1289. #define HSUSBH_UIENR_UERRIEN_Msk (0x1ul << HSUSBH_UIENR_UERRIEN_Pos) /*!< HSUSBH_T::UIENR: UERRIEN Mask */
  1290. #define HSUSBH_UIENR_PCIEN_Pos (2) /*!< HSUSBH_T::UIENR: PCIEN Position */
  1291. #define HSUSBH_UIENR_PCIEN_Msk (0x1ul << HSUSBH_UIENR_PCIEN_Pos) /*!< HSUSBH_T::UIENR: PCIEN Mask */
  1292. #define HSUSBH_UIENR_FLREN_Pos (3) /*!< HSUSBH_T::UIENR: FLREN Position */
  1293. #define HSUSBH_UIENR_FLREN_Msk (0x1ul << HSUSBH_UIENR_FLREN_Pos) /*!< HSUSBH_T::UIENR: FLREN Mask */
  1294. #define HSUSBH_UIENR_HSERREN_Pos (4) /*!< HSUSBH_T::UIENR: HSERREN Position */
  1295. #define HSUSBH_UIENR_HSERREN_Msk (0x1ul << HSUSBH_UIENR_HSERREN_Pos) /*!< HSUSBH_T::UIENR: HSERREN Mask */
  1296. #define HSUSBH_UIENR_IAAEN_Pos (5) /*!< HSUSBH_T::UIENR: IAAEN Position */
  1297. #define HSUSBH_UIENR_IAAEN_Msk (0x1ul << HSUSBH_UIENR_IAAEN_Pos) /*!< HSUSBH_T::UIENR: IAAEN Mask */
  1298. #define HSUSBH_UFINDR_FI_Pos (0) /*!< HSUSBH_T::UFINDR: FI Position */
  1299. #define HSUSBH_UFINDR_FI_Msk (0x3ffful << HSUSBH_UFINDR_FI_Pos) /*!< HSUSBH_T::UFINDR: FI Mask */
  1300. #define HSUSBH_UPFLBAR_BADDR_Pos (12) /*!< HSUSBH_T::UPFLBAR: BADDR Position */
  1301. #define HSUSBH_UPFLBAR_BADDR_Msk (0xffffful << HSUSBH_UPFLBAR_BADDR_Pos) /*!< HSUSBH_T::UPFLBAR: BADDR Mask */
  1302. #define HSUSBH_UCALAR_LPL_Pos (5) /*!< HSUSBH_T::UCALAR: LPL Position */
  1303. #define HSUSBH_UCALAR_LPL_Msk (0x7fffffful << HSUSBH_UCALAR_LPL_Pos) /*!< HSUSBH_T::UCALAR: LPL Mask */
  1304. #define HSUSBH_UASSTR_ASSTMR_Pos (0) /*!< HSUSBH_T::UASSTR: ASSTMR Position */
  1305. #define HSUSBH_UASSTR_ASSTMR_Msk (0xffful << HSUSBH_UASSTR_ASSTMR_Pos) /*!< HSUSBH_T::UASSTR: ASSTMR Mask */
  1306. #define HSUSBH_UCFGR_CF_Pos (0) /*!< HSUSBH_T::UCFGR: CF Position */
  1307. #define HSUSBH_UCFGR_CF_Msk (0x1ul << HSUSBH_UCFGR_CF_Pos) /*!< HSUSBH_T::UCFGR: CF Mask */
  1308. #define HSUSBH_UPSCR_CCS_Pos (0) /*!< HSUSBH_T::UPSCR[2]: CCS Position */
  1309. #define HSUSBH_UPSCR_CCS_Msk (0x1ul << HSUSBH_UPSCR_CCS_Pos) /*!< HSUSBH_T::UPSCR[2]: CCS Mask */
  1310. #define HSUSBH_UPSCR_CSC_Pos (1) /*!< HSUSBH_T::UPSCR[2]: CSC Position */
  1311. #define HSUSBH_UPSCR_CSC_Msk (0x1ul << HSUSBH_UPSCR_CSC_Pos) /*!< HSUSBH_T::UPSCR[2]: CSC Mask */
  1312. #define HSUSBH_UPSCR_PE_Pos (2) /*!< HSUSBH_T::UPSCR[2]: PE Position */
  1313. #define HSUSBH_UPSCR_PE_Msk (0x1ul << HSUSBH_UPSCR_PE_Pos) /*!< HSUSBH_T::UPSCR[2]: PE Mask */
  1314. #define HSUSBH_UPSCR_PEC_Pos (3) /*!< HSUSBH_T::UPSCR[2]: PEC Position */
  1315. #define HSUSBH_UPSCR_PEC_Msk (0x1ul << HSUSBH_UPSCR_PEC_Pos) /*!< HSUSBH_T::UPSCR[2]: PEC Mask */
  1316. #define HSUSBH_UPSCR_OCA_Pos (4) /*!< HSUSBH_T::UPSCR[2]: OCA Position */
  1317. #define HSUSBH_UPSCR_OCA_Msk (0x1ul << HSUSBH_UPSCR_OCA_Pos) /*!< HSUSBH_T::UPSCR[2]: OCA Mask */
  1318. #define HSUSBH_UPSCR_OCC_Pos (5) /*!< HSUSBH_T::UPSCR[2]: OCC Position */
  1319. #define HSUSBH_UPSCR_OCC_Msk (0x1ul << HSUSBH_UPSCR_OCC_Pos) /*!< HSUSBH_T::UPSCR[2]: OCC Mask */
  1320. #define HSUSBH_UPSCR_FPR_Pos (6) /*!< HSUSBH_T::UPSCR[2]: FPR Position */
  1321. #define HSUSBH_UPSCR_FPR_Msk (0x1ul << HSUSBH_UPSCR_FPR_Pos) /*!< HSUSBH_T::UPSCR[2]: FPR Mask */
  1322. #define HSUSBH_UPSCR_SUSPEND_Pos (7) /*!< HSUSBH_T::UPSCR[2]: SUSPEND Position */
  1323. #define HSUSBH_UPSCR_SUSPEND_Msk (0x1ul << HSUSBH_UPSCR_SUSPEND_Pos) /*!< HSUSBH_T::UPSCR[2]: SUSPEND Mask */
  1324. #define HSUSBH_UPSCR_PRST_Pos (8) /*!< HSUSBH_T::UPSCR[2]: PRST Position */
  1325. #define HSUSBH_UPSCR_PRST_Msk (0x1ul << HSUSBH_UPSCR_PRST_Pos) /*!< HSUSBH_T::UPSCR[2]: PRST Mask */
  1326. #define HSUSBH_UPSCR_LSTS_Pos (10) /*!< HSUSBH_T::UPSCR[2]: LSTS Position */
  1327. #define HSUSBH_UPSCR_LSTS_Msk (0x3ul << HSUSBH_UPSCR_LSTS_Pos) /*!< HSUSBH_T::UPSCR[2]: LSTS Mask */
  1328. #define HSUSBH_UPSCR_PP_Pos (12) /*!< HSUSBH_T::UPSCR[2]: PP Position */
  1329. #define HSUSBH_UPSCR_PP_Msk (0x1ul << HSUSBH_UPSCR_PP_Pos) /*!< HSUSBH_T::UPSCR[2]: PP Mask */
  1330. #define HSUSBH_UPSCR_PO_Pos (13) /*!< HSUSBH_T::UPSCR[2]: PO Position */
  1331. #define HSUSBH_UPSCR_PO_Msk (0x1ul << HSUSBH_UPSCR_PO_Pos) /*!< HSUSBH_T::UPSCR[2]: PO Mask */
  1332. #define HSUSBH_UPSCR_PTC_Pos (16) /*!< HSUSBH_T::UPSCR[2]: PTC Position */
  1333. #define HSUSBH_UPSCR_PTC_Msk (0xful << HSUSBH_UPSCR_PTC_Pos) /*!< HSUSBH_T::UPSCR[2]: PTC Mask */
  1334. #define HSUSBH_USBPCR0_SUSPEND_Pos (8) /*!< HSUSBH_T::USBPCR0: SUSPEND Position */
  1335. #define HSUSBH_USBPCR0_SUSPEND_Msk (0x1ul << HSUSBH_USBPCR0_SUSPEND_Pos) /*!< HSUSBH_T::USBPCR0: SUSPEND Mask */
  1336. #define HSUSBH_USBPCR0_CLKVALID_Pos (11) /*!< HSUSBH_T::USBPCR0: CLKVALID Position */
  1337. #define HSUSBH_USBPCR0_CLKVALID_Msk (0x1ul << HSUSBH_USBPCR0_CLKVALID_Pos) /*!< HSUSBH_T::USBPCR0: CLKVALID Mask */
  1338. #define HSUSBH_USBPCR1_SUSPEND_Pos (8) /*!< HSUSBH_T::USBPCR1: SUSPEND Position */
  1339. #define HSUSBH_USBPCR1_SUSPEND_Msk (0x1ul << HSUSBH_USBPCR1_SUSPEND_Pos) /*!< HSUSBH_T::USBPCR1: SUSPEND Mask */
  1340. /**@}*/ /* HSUSBH_CONST */
  1341. /**@}*/ /* end of HSUSBH register group */
  1342. #define USBH ((USBH_T *)0xB0007000)
  1343. #define HSUSBH ((HSUSBH_T *)0xB0005000)
  1344. /// @endcond /*HIDDEN_SYMBOLS*/
  1345. #endif /* _USBH_CONFIG_H_ */
  1346. /*** (C) COPYRIGHT 2018 Nuvoton Technology Corp. ***/