1
0

usb.h 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433
  1. //*****************************************************************************
  2. //
  3. // usb.h - Prototypes for the USB Interface Driver.
  4. //
  5. // Copyright (c) 2007-2009 Luminary Micro, Inc. All rights reserved.
  6. // Software License Agreement
  7. //
  8. // Luminary Micro, Inc. (LMI) is supplying this software for use solely and
  9. // exclusively on LMI's microcontroller products.
  10. //
  11. // The software is owned by LMI and/or its suppliers, and is protected under
  12. // applicable copyright laws. All rights are reserved. You may not combine
  13. // this software with "viral" open-source software in order to form a larger
  14. // program. Any use in violation of the foregoing restrictions may subject
  15. // the user to criminal sanctions under applicable laws, as well as to civil
  16. // liability for the breach of the terms and conditions of this license.
  17. //
  18. // THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED
  19. // OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
  20. // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
  21. // LMI SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR
  22. // CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
  23. //
  24. // This is part of revision 4694 of the Stellaris Peripheral Driver Library.
  25. //
  26. //*****************************************************************************
  27. #ifndef __USB_H__
  28. #define __USB_H__
  29. //*****************************************************************************
  30. //
  31. // If building with a C++ compiler, make all of the definitions in this header
  32. // have a C binding.
  33. //
  34. //*****************************************************************************
  35. #ifdef __cplusplus
  36. extern "C"
  37. {
  38. #endif
  39. //*****************************************************************************
  40. //
  41. // The following are values that can be passed to USBIntEnable(),
  42. // USBIntDisable(), and USBIntClear() as the ulIntFlags parameter, and which
  43. // are returned from USBIntStatus().
  44. //
  45. //*****************************************************************************
  46. #define USB_INT_ALL 0xFF030E0F // All Interrupt sources
  47. #define USB_INT_STATUS 0xFF000000 // Status Interrupts
  48. #define USB_INT_VBUS_ERR 0x80000000 // VBUS Error
  49. #define USB_INT_SESSION_START 0x40000000 // Session Start Detected
  50. #define USB_INT_SESSION_END 0x20000000 // Session End Detected
  51. #define USB_INT_DISCONNECT 0x20000000 // Disconnect Detected
  52. #define USB_INT_CONNECT 0x10000000 // Device Connect Detected
  53. #define USB_INT_SOF 0x08000000 // Start of Frame Detected
  54. #define USB_INT_BABBLE 0x04000000 // Babble signaled
  55. #define USB_INT_RESET 0x04000000 // Reset signaled
  56. #define USB_INT_RESUME 0x02000000 // Resume detected
  57. #define USB_INT_SUSPEND 0x01000000 // Suspend detected
  58. #define USB_INT_MODE_DETECT 0x00020000 // Mode value valid
  59. #define USB_INT_POWER_FAULT 0x00010000 // Power Fault detected
  60. #define USB_INT_HOST_IN 0x00000E00 // Host IN Interrupts
  61. #define USB_INT_DEV_OUT 0x00000E00 // Device OUT Interrupts
  62. #define USB_INT_HOST_IN_EP3 0x00000800 // Endpoint 3 Host IN Interrupt
  63. #define USB_INT_HOST_IN_EP2 0x00000400 // Endpoint 2 Host IN Interrupt
  64. #define USB_INT_HOST_IN_EP1 0x00000200 // Endpoint 1 Host IN Interrupt
  65. #define USB_INT_DEV_OUT_EP3 0x00000800 // Endpoint 3 Device OUT Interrupt
  66. #define USB_INT_DEV_OUT_EP2 0x00000400 // Endpoint 2 Device OUT Interrupt
  67. #define USB_INT_DEV_OUT_EP1 0x00000200 // Endpoint 1 Device OUT Interrupt
  68. #define USB_INT_HOST_OUT 0x0000000E // Host OUT Interrupts
  69. #define USB_INT_DEV_IN 0x0000000E // Device IN Interrupts
  70. #define USB_INT_HOST_OUT_EP3 0x00000008 // Endpoint 3 HOST_OUT Interrupt
  71. #define USB_INT_HOST_OUT_EP2 0x00000004 // Endpoint 2 HOST_OUT Interrupt
  72. #define USB_INT_HOST_OUT_EP1 0x00000002 // Endpoint 1 HOST_OUT Interrupt
  73. #define USB_INT_DEV_IN_EP3 0x00000008 // Endpoint 3 DEV_IN Interrupt
  74. #define USB_INT_DEV_IN_EP2 0x00000004 // Endpoint 2 DEV_IN Interrupt
  75. #define USB_INT_DEV_IN_EP1 0x00000002 // Endpoint 1 DEV_IN Interrupt
  76. #define USB_INT_EP0 0x00000001 // Endpoint 0 Interrupt
  77. //*****************************************************************************
  78. //
  79. // The following are values that are returned from USBSpeedGet().
  80. //
  81. //*****************************************************************************
  82. #define USB_UNDEF_SPEED 0x80000000 // Current speed is undefined
  83. #define USB_FULL_SPEED 0x00000001 // Current speed is Full Speed
  84. #define USB_LOW_SPEED 0x00000000 // Current speed is Low Speed
  85. //*****************************************************************************
  86. //
  87. // The following are values that are returned from USBEndpointStatus(). The
  88. // USB_HOST_* values are used when the USB controller is in host mode and the
  89. // USB_DEV_* values are used when the USB controller is in device mode.
  90. //
  91. //*****************************************************************************
  92. #define USB_HOST_IN_PID_ERROR 0x01000000 // Stall on this endpoint received
  93. #define USB_HOST_IN_NOT_COMP 0x00100000 // Device failed to respond
  94. #define USB_HOST_IN_STALL 0x00400000 // Stall on this endpoint received
  95. #define USB_HOST_IN_DATA_ERROR 0x00080000 // CRC or bit-stuff error
  96. // (ISOC Mode)
  97. #define USB_HOST_IN_NAK_TO 0x00080000 // NAK received for more than the
  98. // specified timeout period
  99. #define USB_HOST_IN_ERROR 0x00040000 // Failed to communicate with a
  100. // device
  101. #define USB_HOST_IN_FIFO_FULL 0x00020000 // RX FIFO full
  102. #define USB_HOST_IN_PKTRDY 0x00010000 // Data packet ready
  103. #define USB_HOST_OUT_NAK_TO 0x00000080 // NAK received for more than the
  104. // specified timeout period
  105. #define USB_HOST_OUT_NOT_COMP 0x00000080 // No response from device
  106. // (ISOC mode)
  107. #define USB_HOST_OUT_STALL 0x00000020 // Stall on this endpoint received
  108. #define USB_HOST_OUT_ERROR 0x00000004 // Failed to communicate with a
  109. // device
  110. #define USB_HOST_OUT_FIFO_NE 0x00000002 // TX FIFO is not empty
  111. #define USB_HOST_OUT_PKTPEND 0x00000001 // Transmit still being transmitted
  112. #define USB_HOST_EP0_NAK_TO 0x00000080 // NAK received for more than the
  113. // specified timeout period
  114. #define USB_HOST_EP0_STATUS 0x00000040 // This was a status packet
  115. #define USB_HOST_EP0_ERROR 0x00000010 // Failed to communicate with a
  116. // device
  117. #define USB_HOST_EP0_RX_STALL 0x00000004 // Stall on this endpoint received
  118. #define USB_HOST_EP0_RXPKTRDY 0x00000001 // Receive data packet ready
  119. #define USB_DEV_RX_SENT_STALL 0x00400000 // Stall was sent on this endpoint
  120. #define USB_DEV_RX_DATA_ERROR 0x00080000 // CRC error on the data
  121. #define USB_DEV_RX_OVERRUN 0x00040000 // OUT packet was not loaded due to
  122. // a full FIFO
  123. #define USB_DEV_RX_FIFO_FULL 0x00020000 // RX FIFO full
  124. #define USB_DEV_RX_PKT_RDY 0x00010000 // Data packet ready
  125. #define USB_DEV_TX_NOT_COMP 0x00000080 // Large packet split up, more data
  126. // to come
  127. #define USB_DEV_TX_SENT_STALL 0x00000020 // Stall was sent on this endpoint
  128. #define USB_DEV_TX_UNDERRUN 0x00000004 // IN received with no data ready
  129. #define USB_DEV_TX_FIFO_NE 0x00000002 // The TX FIFO is not empty
  130. #define USB_DEV_TX_TXPKTRDY 0x00000001 // Transmit still being transmitted
  131. #define USB_DEV_EP0_SETUP_END 0x00000010 // Control transaction ended before
  132. // Data End seen
  133. #define USB_DEV_EP0_SENT_STALL 0x00000004 // Stall was sent on this endpoint
  134. #define USB_DEV_EP0_IN_PKTPEND 0x00000002 // Transmit data packet pending
  135. #define USB_DEV_EP0_OUT_PKTRDY 0x00000001 // Receive data packet ready
  136. //*****************************************************************************
  137. //
  138. // The following are values that can be passed to USBHostEndpointConfig() and
  139. // USBDevEndpointConfig() as the ulFlags parameter.
  140. //
  141. //*****************************************************************************
  142. #define USB_EP_AUTO_SET 0x00000001 // Auto set feature enabled
  143. #define USB_EP_AUTO_REQUEST 0x00000002 // Auto request feature enabled
  144. #define USB_EP_AUTO_CLEAR 0x00000004 // Auto clear feature enabled
  145. #define USB_EP_DMA_MODE_0 0x00000008 // Enable DMA access using mode 0
  146. #define USB_EP_DMA_MODE_1 0x00000010 // Enable DMA access using mode 1
  147. #define USB_EP_MODE_ISOC 0x00000000 // Isochronous endpoint
  148. #define USB_EP_MODE_BULK 0x00000100 // Bulk endpoint
  149. #define USB_EP_MODE_INT 0x00000200 // Interrupt endpoint
  150. #define USB_EP_MODE_CTRL 0x00000300 // Control endpoint
  151. #define USB_EP_MODE_MASK 0x00000300 // Mode Mask
  152. #define USB_EP_SPEED_LOW 0x00000000 // Low Speed
  153. #define USB_EP_SPEED_FULL 0x00001000 // Full Speed
  154. #define USB_EP_HOST_EP0 0x00002000 // Host endpoint 0
  155. #define USB_EP_HOST_IN 0x00001000 // Host IN endpoint
  156. #define USB_EP_HOST_OUT 0x00002000 // Host OUT endpoint
  157. #define USB_EP_DEV_EP0 0x00002000 // Device endpoint 0
  158. #define USB_EP_DEV_IN 0x00002000 // Device IN endpoint
  159. #define USB_EP_DEV_OUT 0x00001000 // Device OUT endpoint
  160. //*****************************************************************************
  161. //
  162. // The following are values that can be passed to USBHostPwrFaultConfig() as
  163. // the ulFlags parameter.
  164. //
  165. //*****************************************************************************
  166. #define USB_HOST_PWRFLT_LOW 0x00000010
  167. #define USB_HOST_PWRFLT_HIGH 0x00000030
  168. #define USB_HOST_PWRFLT_EP_NONE 0x00000000
  169. #define USB_HOST_PWRFLT_EP_TRI 0x00000140
  170. #define USB_HOST_PWRFLT_EP_LOW 0x00000240
  171. #define USB_HOST_PWRFLT_EP_HIGH 0x00000340
  172. #define USB_HOST_PWREN_LOW 0x00000000
  173. #define USB_HOST_PWREN_HIGH 0x00000001
  174. #define USB_HOST_PWREN_VBLOW 0x00000002
  175. #define USB_HOST_PWREN_VBHIGH 0x00000003
  176. //*****************************************************************************
  177. //
  178. // The following are special values that can be passed to
  179. // USBHostEndpointConfig() as the ulNAKPollInterval parameter.
  180. //
  181. //*****************************************************************************
  182. #define MAX_NAK_LIMIT 31 // Maximum NAK interval
  183. #define DISABLE_NAK_LIMIT 0 // No NAK timeouts
  184. //*****************************************************************************
  185. //
  186. // This value specifies the maximum size of transfers on endpoint 0 as 64
  187. // bytes. This value is fixed in hardware as the FIFO size for endpoint 0.
  188. //
  189. //*****************************************************************************
  190. #define MAX_PACKET_SIZE_EP0 64
  191. //*****************************************************************************
  192. //
  193. // These values are used to indicate which endpoint to access.
  194. //
  195. //*****************************************************************************
  196. #define USB_EP_0 0x00000000 // Endpoint 0
  197. #define USB_EP_1 0x00000010 // Endpoint 1
  198. #define USB_EP_2 0x00000020 // Endpoint 2
  199. #define USB_EP_3 0x00000030 // Endpoint 3
  200. #define USB_EP_4 0x00000040 // Endpoint 4
  201. #define USB_EP_5 0x00000050 // Endpoint 5
  202. #define USB_EP_6 0x00000060 // Endpoint 6
  203. #define USB_EP_7 0x00000070 // Endpoint 7
  204. #define USB_EP_8 0x00000080 // Endpoint 8
  205. #define USB_EP_9 0x00000090 // Endpoint 9
  206. #define USB_EP_10 0x000000A0 // Endpoint 10
  207. #define USB_EP_11 0x000000B0 // Endpoint 11
  208. #define USB_EP_12 0x000000C0 // Endpoint 12
  209. #define USB_EP_13 0x000000D0 // Endpoint 13
  210. #define USB_EP_14 0x000000E0 // Endpoint 14
  211. #define USB_EP_15 0x000000F0 // Endpoint 15
  212. #define NUM_USB_EP 16 // Number of supported endpoints
  213. //*****************************************************************************
  214. //
  215. // These macros allow conversion between 0-based endpoint indices and the
  216. // USB_EP_x values required when calling various USB APIs.
  217. //
  218. //*****************************************************************************
  219. #define INDEX_TO_USB_EP(x) ((x) << 4)
  220. #define USB_EP_TO_INDEX(x) ((x) >> 4)
  221. //*****************************************************************************
  222. //
  223. // The following are values that can be passed to USBFIFOConfigSet() as the
  224. // ulFIFOSize parameter.
  225. //
  226. //*****************************************************************************
  227. #define USB_FIFO_SZ_8 0x00000000 // 8 byte FIFO
  228. #define USB_FIFO_SZ_16 0x00000001 // 16 byte FIFO
  229. #define USB_FIFO_SZ_32 0x00000002 // 32 byte FIFO
  230. #define USB_FIFO_SZ_64 0x00000003 // 64 byte FIFO
  231. #define USB_FIFO_SZ_128 0x00000004 // 128 byte FIFO
  232. #define USB_FIFO_SZ_256 0x00000005 // 256 byte FIFO
  233. #define USB_FIFO_SZ_512 0x00000006 // 512 byte FIFO
  234. #define USB_FIFO_SZ_1024 0x00000007 // 1024 byte FIFO
  235. #define USB_FIFO_SZ_2048 0x00000008 // 2048 byte FIFO
  236. #define USB_FIFO_SZ_4096 0x00000009 // 4096 byte FIFO
  237. #define USB_FIFO_SZ_8_DB 0x00000010 // 8 byte double buffered FIFO
  238. // (occupying 16 bytes)
  239. #define USB_FIFO_SZ_16_DB 0x00000011 // 16 byte double buffered FIFO
  240. // (occupying 32 bytes)
  241. #define USB_FIFO_SZ_32_DB 0x00000012 // 32 byte double buffered FIFO
  242. // (occupying 64 bytes)
  243. #define USB_FIFO_SZ_64_DB 0x00000013 // 64 byte double buffered FIFO
  244. // (occupying 128 bytes)
  245. #define USB_FIFO_SZ_128_DB 0x00000014 // 128 byte double buffered FIFO
  246. // (occupying 256 bytes)
  247. #define USB_FIFO_SZ_256_DB 0x00000015 // 256 byte double buffered FIFO
  248. // (occupying 512 bytes)
  249. #define USB_FIFO_SZ_512_DB 0x00000016 // 512 byte double buffered FIFO
  250. // (occupying 1024 bytes)
  251. #define USB_FIFO_SZ_1024_DB 0x00000017 // 1024 byte double buffered FIFO
  252. // (occupying 2048 bytes)
  253. #define USB_FIFO_SZ_2048_DB 0x00000018 // 2048 byte double buffered FIFO
  254. // (occupying 4096 bytes)
  255. //*****************************************************************************
  256. //
  257. // This macro allow conversion from a FIFO size label as defined above to
  258. // a number of bytes
  259. //
  260. //*****************************************************************************
  261. #define USB_FIFO_SIZE_DB_FLAG 0x00000010
  262. #define USB_FIFO_SZ_TO_BYTES(x) ((8 << ((x) & ~ USB_FIFO_SIZE_DB_FLAG)) * \
  263. (((x) & USB_FIFO_SIZE_DB_FLAG) ? 2 : 1))
  264. //*****************************************************************************
  265. //
  266. // The following are values that can be passed to USBEndpointDataSend() as the
  267. // ulTransType parameter.
  268. //
  269. //*****************************************************************************
  270. #define USB_TRANS_OUT 0x00000102 // Normal OUT transaction
  271. #define USB_TRANS_IN 0x00000102 // Normal IN transaction
  272. #define USB_TRANS_IN_LAST 0x0000010a // Final IN transaction (for
  273. // endpoint 0 in device mode)
  274. #define USB_TRANS_SETUP 0x0000110a // Setup transaction (for endpoint
  275. // 0)
  276. #define USB_TRANS_STATUS 0x00000142 // Status transaction (for endpoint
  277. // 0)
  278. //*****************************************************************************
  279. //
  280. // The following are values are returned by the USBModeGet function.
  281. //
  282. //*****************************************************************************
  283. #define USB_DUAL_MODE_HOST 0x00000001 // Dual mode controller is in Host
  284. // mode.
  285. #define USB_DUAL_MODE_DEVICE 0x00000081 // Dual mode controller is in
  286. // Device mode.
  287. #define USB_DUAL_MODE_NONE 0x00000080 // Dual mode controller mode is not
  288. // set.
  289. #define USB_OTG_MODE_ASIDE_HOST 0x0000001d // OTG controller on the A side of
  290. // the cable.
  291. #define USB_OTG_MODE_ASIDE_NPWR 0x00000001 // OTG controller on the A side of
  292. // the cable.
  293. #define USB_OTG_MODE_ASIDE_DEV 0x00000019 // OTG controller on the A side of
  294. // the cable.
  295. #define USB_OTG_MODE_BSIDE_HOST 0x0000009d // OTG controller on the B side of
  296. // the cable.
  297. #define USB_OTG_MODE_BSIDE_DEV 0x00000099 // OTG controller on the B side of
  298. // the cable.
  299. #define USB_OTG_MODE_BSIDE_NPWR 0x00000081 // OTG controller on the B side of
  300. // the cable.
  301. #define USB_OTG_MODE_NONE 0x00000080 // OTG controller mode is not set.
  302. //*****************************************************************************
  303. //
  304. // Prototypes for the APIs.
  305. //
  306. //*****************************************************************************
  307. extern unsigned long USBDevAddrGet(unsigned long ulBase);
  308. extern void USBDevAddrSet(unsigned long ulBase, unsigned long ulAddress);
  309. extern void USBDevConnect(unsigned long ulBase);
  310. extern void USBDevDisconnect(unsigned long ulBase);
  311. extern void USBDevEndpointConfig(unsigned long ulBase,
  312. unsigned long ulEndpoint,
  313. unsigned long ulMaxPacketSize,
  314. unsigned long ulFlags);
  315. extern void USBDevEndpointConfigGet(unsigned long ulBase,
  316. unsigned long ulEndpoint,
  317. unsigned long *pulMaxPacketSize,
  318. unsigned long *pulFlags);
  319. extern void USBDevEndpointDataAck(unsigned long ulBase,
  320. unsigned long ulEndpoint,
  321. tBoolean bIsLastPacket);
  322. extern void USBDevEndpointStall(unsigned long ulBase, unsigned long ulEndpoint,
  323. unsigned long ulFlags);
  324. extern void USBDevEndpointStallClear(unsigned long ulBase,
  325. unsigned long ulEndpoint,
  326. unsigned long ulFlags);
  327. extern void USBDevEndpointStatusClear(unsigned long ulBase,
  328. unsigned long ulEndpoint,
  329. unsigned long ulFlags);
  330. extern unsigned long USBEndpointDataAvail(unsigned long ulBase,
  331. unsigned long ulEndpoint);
  332. extern void USBEndpointDMAEnable(unsigned long ulBase, unsigned long ulEndpoint,
  333. unsigned long ulFlags);
  334. extern void USBEndpointDMADisable(unsigned long ulBase,
  335. unsigned long ulEndpoint,
  336. unsigned long ulFlags);
  337. extern long USBEndpointDataGet(unsigned long ulBase, unsigned long ulEndpoint,
  338. unsigned char *pucData, unsigned long *pulSize);
  339. extern long USBEndpointDataPut(unsigned long ulBase, unsigned long ulEndpoint,
  340. unsigned char *pucData, unsigned long ulSize);
  341. extern long USBEndpointDataSend(unsigned long ulBase, unsigned long ulEndpoint,
  342. unsigned long ulTransType);
  343. extern void USBEndpointDataToggleClear(unsigned long ulBase,
  344. unsigned long ulEndpoint,
  345. unsigned long ulFlags);
  346. extern unsigned long USBEndpointStatus(unsigned long ulBase,
  347. unsigned long ulEndpoint);
  348. extern unsigned long USBFIFOAddrGet(unsigned long ulBase,
  349. unsigned long ulEndpoint);
  350. extern void USBFIFOConfigGet(unsigned long ulBase, unsigned long ulEndpoint,
  351. unsigned long *pulFIFOAddress,
  352. unsigned long *pulFIFOSize,
  353. unsigned long ulFlags);
  354. extern void USBFIFOConfigSet(unsigned long ulBase, unsigned long ulEndpoint,
  355. unsigned long ulFIFOAddress,
  356. unsigned long ulFIFOSize, unsigned long ulFlags);
  357. extern void USBFIFOFlush(unsigned long ulBase, unsigned long ulEndpoint,
  358. unsigned long ulFlags);
  359. extern unsigned long USBFrameNumberGet(unsigned long ulBase);
  360. extern unsigned long USBHostAddrGet(unsigned long ulBase,
  361. unsigned long ulEndpoint,
  362. unsigned long ulFlags);
  363. extern void USBHostAddrSet(unsigned long ulBase, unsigned long ulEndpoint,
  364. unsigned long ulAddr, unsigned long ulFlags);
  365. extern void USBHostEndpointConfig(unsigned long ulBase,
  366. unsigned long ulEndpoint,
  367. unsigned long ulMaxPacketSize,
  368. unsigned long ulNAKPollInterval,
  369. unsigned long ulTargetEndpoint,
  370. unsigned long ulFlags);
  371. extern void USBHostEndpointDataAck(unsigned long ulBase,
  372. unsigned long ulEndpoint);
  373. extern void USBHostEndpointDataToggle(unsigned long ulBase,
  374. unsigned long ulEndpoint,
  375. tBoolean bDataToggle,
  376. unsigned long ulFlags);
  377. extern void USBHostEndpointStatusClear(unsigned long ulBase,
  378. unsigned long ulEndpoint,
  379. unsigned long ulFlags);
  380. extern unsigned long USBHostHubAddrGet(unsigned long ulBase,
  381. unsigned long ulEndpoint,
  382. unsigned long ulFlags);
  383. extern void USBHostHubAddrSet(unsigned long ulBase, unsigned long ulEndpoint,
  384. unsigned long ulAddr, unsigned long ulFlags);
  385. extern void USBHostPwrDisable(unsigned long ulBase);
  386. extern void USBHostPwrEnable(unsigned long ulBase);
  387. extern void USBHostPwrFaultConfig(unsigned long ulBase, unsigned long ulFlags);
  388. extern void USBHostPwrFaultDisable(unsigned long ulBase);
  389. extern void USBHostPwrFaultEnable(unsigned long ulBase);
  390. extern void USBHostRequestIN(unsigned long ulBase, unsigned long ulEndpoint);
  391. extern void USBHostRequestStatus(unsigned long ulBase);
  392. extern void USBHostReset(unsigned long ulBase, tBoolean bStart);
  393. extern void USBHostResume(unsigned long ulBase, tBoolean bStart);
  394. extern unsigned long USBHostSpeedGet(unsigned long ulBase);
  395. extern void USBHostSuspend(unsigned long ulBase);
  396. extern void USBIntDisable(unsigned long ulBase, unsigned long ulIntFlags);
  397. extern void USBIntEnable(unsigned long ulBase, unsigned long ulIntFlags);
  398. extern void USBIntRegister(unsigned long ulBase, void(*pfnHandler)(void));
  399. extern unsigned long USBIntStatus(unsigned long ulBase);
  400. extern void USBIntUnregister(unsigned long ulBase);
  401. extern void USBOTGSessionRequest(unsigned long ulBase, tBoolean bStart);
  402. extern unsigned long USBModeGet(unsigned long ulBase);
  403. extern void USBEndpointDMAChannel(unsigned long ulBase,
  404. unsigned long ulEndpoint,
  405. unsigned long ulChannel);
  406. extern void USBHostMode(unsigned long ulBase);
  407. //*****************************************************************************
  408. //
  409. // Mark the end of the C bindings section for C++ compilers.
  410. //
  411. //*****************************************************************************
  412. #ifdef __cplusplus
  413. }
  414. #endif
  415. #endif // __USB_H__