Tiva Driver Lib
usb.h
1 //*****************************************************************************
2 //
3 // usb.h - Prototypes for the USB Interface Driver.
4 //
5 // Copyright (c) 2007-2013 Texas Instruments Incorporated. All rights reserved.
6 // Software License Agreement
7 //
8 // Redistribution and use in source and binary forms, with or without
9 // modification, are permitted provided that the following conditions
10 // are met:
11 //
12 // Redistributions of source code must retain the above copyright
13 // notice, this list of conditions and the following disclaimer.
14 //
15 // Redistributions in binary form must reproduce the above copyright
16 // notice, this list of conditions and the following disclaimer in the
17 // documentation and/or other materials provided with the
18 // distribution.
19 //
20 // Neither the name of Texas Instruments Incorporated nor the names of
21 // its contributors may be used to endorse or promote products derived
22 // from this software without specific prior written permission.
23 //
24 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
25 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
26 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
27 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
28 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
29 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
30 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
31 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
32 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
33 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
34 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35 //
36 // This is part of revision 1.1 of the Tiva Peripheral Driver Library.
37 //
38 //*****************************************************************************
39 
40 #ifndef __DRIVERLIB_USB_H__
41 #define __DRIVERLIB_USB_H__
42 
43 //*****************************************************************************
44 //
45 // If building with a C++ compiler, make all of the definitions in this header
46 // have a C binding.
47 //
48 //*****************************************************************************
49 #ifdef __cplusplus
50 extern "C"
51 {
52 #endif
53 
54 //*****************************************************************************
55 //
56 // The following are values that can be passed to USBIntEnableControl() and
57 // USBIntDisableControl() as the ui32Flags parameter, and are returned from
58 // USBIntStatusControl().
59 //
60 //*****************************************************************************
61 #define USB_INTCTRL_ALL 0x000003FF // All control interrupt sources
62 #define USB_INTCTRL_STATUS 0x000000FF // Status Interrupts
63 #define USB_INTCTRL_VBUS_ERR 0x00000080 // VBUS Error
64 #define USB_INTCTRL_SESSION 0x00000040 // Session Start Detected
65 #define USB_INTCTRL_SESSION_END 0x00000040 // Session End Detected
66 #define USB_INTCTRL_DISCONNECT 0x00000020 // Disconnect Detected
67 #define USB_INTCTRL_CONNECT 0x00000010 // Device Connect Detected
68 #define USB_INTCTRL_SOF 0x00000008 // Start of Frame Detected
69 #define USB_INTCTRL_BABBLE 0x00000004 // Babble signaled
70 #define USB_INTCTRL_RESET 0x00000004 // Reset signaled
71 #define USB_INTCTRL_RESUME 0x00000002 // Resume detected
72 #define USB_INTCTRL_SUSPEND 0x00000001 // Suspend detected
73 #define USB_INTCTRL_MODE_DETECT 0x00000200 // Mode value valid
74 #define USB_INTCTRL_POWER_FAULT 0x00000100 // Power Fault detected
75 
76 //*****************************************************************************
77 //
78 // The following are values that can be passed to USBIntEnableEndpoint() and
79 // USBIntDisableEndpoint() as the ui32Flags parameter, and are returned from
80 // USBIntStatusEndpoint().
81 //
82 //*****************************************************************************
83 #define USB_INTEP_ALL 0xFFFFFFFF // Host IN Interrupts
84 #define USB_INTEP_HOST_IN 0xFFFE0000 // Host IN Interrupts
85 #define USB_INTEP_HOST_IN_15 0x80000000 // Endpoint 15 Host IN Interrupt
86 #define USB_INTEP_HOST_IN_14 0x40000000 // Endpoint 14 Host IN Interrupt
87 #define USB_INTEP_HOST_IN_13 0x20000000 // Endpoint 13 Host IN Interrupt
88 #define USB_INTEP_HOST_IN_12 0x10000000 // Endpoint 12 Host IN Interrupt
89 #define USB_INTEP_HOST_IN_11 0x08000000 // Endpoint 11 Host IN Interrupt
90 #define USB_INTEP_HOST_IN_10 0x04000000 // Endpoint 10 Host IN Interrupt
91 #define USB_INTEP_HOST_IN_9 0x02000000 // Endpoint 9 Host IN Interrupt
92 #define USB_INTEP_HOST_IN_8 0x01000000 // Endpoint 8 Host IN Interrupt
93 #define USB_INTEP_HOST_IN_7 0x00800000 // Endpoint 7 Host IN Interrupt
94 #define USB_INTEP_HOST_IN_6 0x00400000 // Endpoint 6 Host IN Interrupt
95 #define USB_INTEP_HOST_IN_5 0x00200000 // Endpoint 5 Host IN Interrupt
96 #define USB_INTEP_HOST_IN_4 0x00100000 // Endpoint 4 Host IN Interrupt
97 #define USB_INTEP_HOST_IN_3 0x00080000 // Endpoint 3 Host IN Interrupt
98 #define USB_INTEP_HOST_IN_2 0x00040000 // Endpoint 2 Host IN Interrupt
99 #define USB_INTEP_HOST_IN_1 0x00020000 // Endpoint 1 Host IN Interrupt
100 
101 #define USB_INTEP_DEV_OUT 0xFFFE0000 // Device OUT Interrupts
102 #define USB_INTEP_DEV_OUT_15 0x80000000 // Endpoint 15 Device OUT Interrupt
103 #define USB_INTEP_DEV_OUT_14 0x40000000 // Endpoint 14 Device OUT Interrupt
104 #define USB_INTEP_DEV_OUT_13 0x20000000 // Endpoint 13 Device OUT Interrupt
105 #define USB_INTEP_DEV_OUT_12 0x10000000 // Endpoint 12 Device OUT Interrupt
106 #define USB_INTEP_DEV_OUT_11 0x08000000 // Endpoint 11 Device OUT Interrupt
107 #define USB_INTEP_DEV_OUT_10 0x04000000 // Endpoint 10 Device OUT Interrupt
108 #define USB_INTEP_DEV_OUT_9 0x02000000 // Endpoint 9 Device OUT Interrupt
109 #define USB_INTEP_DEV_OUT_8 0x01000000 // Endpoint 8 Device OUT Interrupt
110 #define USB_INTEP_DEV_OUT_7 0x00800000 // Endpoint 7 Device OUT Interrupt
111 #define USB_INTEP_DEV_OUT_6 0x00400000 // Endpoint 6 Device OUT Interrupt
112 #define USB_INTEP_DEV_OUT_5 0x00200000 // Endpoint 5 Device OUT Interrupt
113 #define USB_INTEP_DEV_OUT_4 0x00100000 // Endpoint 4 Device OUT Interrupt
114 #define USB_INTEP_DEV_OUT_3 0x00080000 // Endpoint 3 Device OUT Interrupt
115 #define USB_INTEP_DEV_OUT_2 0x00040000 // Endpoint 2 Device OUT Interrupt
116 #define USB_INTEP_DEV_OUT_1 0x00020000 // Endpoint 1 Device OUT Interrupt
117 
118 #define USB_INTEP_HOST_OUT 0x0000FFFE // Host OUT Interrupts
119 #define USB_INTEP_HOST_OUT_15 0x00008000 // Endpoint 15 Host OUT Interrupt
120 #define USB_INTEP_HOST_OUT_14 0x00004000 // Endpoint 14 Host OUT Interrupt
121 #define USB_INTEP_HOST_OUT_13 0x00002000 // Endpoint 13 Host OUT Interrupt
122 #define USB_INTEP_HOST_OUT_12 0x00001000 // Endpoint 12 Host OUT Interrupt
123 #define USB_INTEP_HOST_OUT_11 0x00000800 // Endpoint 11 Host OUT Interrupt
124 #define USB_INTEP_HOST_OUT_10 0x00000400 // Endpoint 10 Host OUT Interrupt
125 #define USB_INTEP_HOST_OUT_9 0x00000200 // Endpoint 9 Host OUT Interrupt
126 #define USB_INTEP_HOST_OUT_8 0x00000100 // Endpoint 8 Host OUT Interrupt
127 #define USB_INTEP_HOST_OUT_7 0x00000080 // Endpoint 7 Host OUT Interrupt
128 #define USB_INTEP_HOST_OUT_6 0x00000040 // Endpoint 6 Host OUT Interrupt
129 #define USB_INTEP_HOST_OUT_5 0x00000020 // Endpoint 5 Host OUT Interrupt
130 #define USB_INTEP_HOST_OUT_4 0x00000010 // Endpoint 4 Host OUT Interrupt
131 #define USB_INTEP_HOST_OUT_3 0x00000008 // Endpoint 3 Host OUT Interrupt
132 #define USB_INTEP_HOST_OUT_2 0x00000004 // Endpoint 2 Host OUT Interrupt
133 #define USB_INTEP_HOST_OUT_1 0x00000002 // Endpoint 1 Host OUT Interrupt
134 
135 #define USB_INTEP_DEV_IN 0x0000FFFE // Device IN Interrupts
136 #define USB_INTEP_DEV_IN_15 0x00008000 // Endpoint 15 Device IN Interrupt
137 #define USB_INTEP_DEV_IN_14 0x00004000 // Endpoint 14 Device IN Interrupt
138 #define USB_INTEP_DEV_IN_13 0x00002000 // Endpoint 13 Device IN Interrupt
139 #define USB_INTEP_DEV_IN_12 0x00001000 // Endpoint 12 Device IN Interrupt
140 #define USB_INTEP_DEV_IN_11 0x00000800 // Endpoint 11 Device IN Interrupt
141 #define USB_INTEP_DEV_IN_10 0x00000400 // Endpoint 10 Device IN Interrupt
142 #define USB_INTEP_DEV_IN_9 0x00000200 // Endpoint 9 Device IN Interrupt
143 #define USB_INTEP_DEV_IN_8 0x00000100 // Endpoint 8 Device IN Interrupt
144 #define USB_INTEP_DEV_IN_7 0x00000080 // Endpoint 7 Device IN Interrupt
145 #define USB_INTEP_DEV_IN_6 0x00000040 // Endpoint 6 Device IN Interrupt
146 #define USB_INTEP_DEV_IN_5 0x00000020 // Endpoint 5 Device IN Interrupt
147 #define USB_INTEP_DEV_IN_4 0x00000010 // Endpoint 4 Device IN Interrupt
148 #define USB_INTEP_DEV_IN_3 0x00000008 // Endpoint 3 Device IN Interrupt
149 #define USB_INTEP_DEV_IN_2 0x00000004 // Endpoint 2 Device IN Interrupt
150 #define USB_INTEP_DEV_IN_1 0x00000002 // Endpoint 1 Device IN Interrupt
151 
152 #define USB_INTEP_0 0x00000001 // Endpoint 0 Interrupt
153 
154 //*****************************************************************************
155 //
156 // The following are values that are returned from USBSpeedGet().
157 //
158 //*****************************************************************************
159 #define USB_UNDEF_SPEED 0x80000000 // Current speed is undefined
160 #define USB_FULL_SPEED 0x00000001 // Current speed is Full Speed
161 #define USB_LOW_SPEED 0x00000000 // Current speed is Low Speed
162 
163 //*****************************************************************************
164 //
165 // The following are values that are returned from USBEndpointStatus(). The
166 // USB_HOST_* values are used when the USB controller is in host mode and the
167 // USB_DEV_* values are used when the USB controller is in device mode.
168 //
169 //*****************************************************************************
170 #define USB_HOST_IN_STATUS 0xFFFF0000 // Mask of all host IN interrupts
171 #define USB_HOST_IN_PID_ERROR 0x10000000 // Stall on this endpoint received
172 #define USB_HOST_IN_NOT_COMP 0x01000000 // Device failed to respond
173 #define USB_HOST_IN_STALL 0x00400000 // Stall on this endpoint received
174 #define USB_HOST_IN_DATA_ERROR 0x00080000 // CRC or bit-stuff error
175  // (ISOC Mode)
176 #define USB_HOST_IN_NAK_TO 0x00080000 // NAK received for more than the
177  // specified timeout period
178 #define USB_HOST_IN_ERROR 0x00040000 // Failed to communicate with a
179  // device
180 #define USB_HOST_IN_FIFO_FULL 0x00020000 // RX FIFO full
181 #define USB_HOST_IN_PKTRDY 0x00010000 // Data packet ready
182 #define USB_HOST_OUT_STATUS 0x0000FFFF // Mask of all host OUT interrupts
183 #define USB_HOST_OUT_NAK_TO 0x00000080 // NAK received for more than the
184  // specified timeout period
185 #define USB_HOST_OUT_NOT_COMP 0x00000080 // No response from device
186  // (ISOC mode)
187 #define USB_HOST_OUT_STALL 0x00000020 // Stall on this endpoint received
188 #define USB_HOST_OUT_ERROR 0x00000004 // Failed to communicate with a
189  // device
190 #define USB_HOST_OUT_FIFO_NE 0x00000002 // TX FIFO is not empty
191 #define USB_HOST_OUT_PKTPEND 0x00000001 // Transmit still being transmitted
192 #define USB_HOST_EP0_NAK_TO 0x00000080 // NAK received for more than the
193  // specified timeout period
194 #define USB_HOST_EP0_STATUS 0x00000040 // This was a status packet
195 #define USB_HOST_EP0_ERROR 0x00000010 // Failed to communicate with a
196  // device
197 #define USB_HOST_EP0_RX_STALL 0x00000004 // Stall on this endpoint received
198 #define USB_HOST_EP0_RXPKTRDY 0x00000001 // Receive data packet ready
199 #define USB_DEV_RX_PID_ERROR 0x01000000 // PID error in isochronous
200  // transfer
201 #define USB_DEV_RX_SENT_STALL 0x00400000 // Stall was sent on this endpoint
202 #define USB_DEV_RX_DATA_ERROR 0x00080000 // CRC error on the data
203 #define USB_DEV_RX_OVERRUN 0x00040000 // OUT packet was not loaded due to
204  // a full FIFO
205 #define USB_DEV_RX_FIFO_FULL 0x00020000 // RX FIFO full
206 #define USB_DEV_RX_PKT_RDY 0x00010000 // Data packet ready
207 #define USB_DEV_TX_NOT_COMP 0x00000080 // Large packet split up, more data
208  // to come
209 #define USB_DEV_TX_SENT_STALL 0x00000020 // Stall was sent on this endpoint
210 #define USB_DEV_TX_UNDERRUN 0x00000004 // IN received with no data ready
211 #define USB_DEV_TX_FIFO_NE 0x00000002 // The TX FIFO is not empty
212 #define USB_DEV_TX_TXPKTRDY 0x00000001 // Transmit still being transmitted
213 #define USB_DEV_EP0_SETUP_END 0x00000010 // Control transaction ended before
214  // Data End seen
215 #define USB_DEV_EP0_SENT_STALL 0x00000004 // Stall was sent on this endpoint
216 #define USB_DEV_EP0_IN_PKTPEND 0x00000002 // Transmit data packet pending
217 #define USB_DEV_EP0_OUT_PKTRDY 0x00000001 // Receive data packet ready
218 
219 //*****************************************************************************
220 //
221 // The following are values that can be passed to USBHostEndpointConfig() and
222 // USBDevEndpointConfigSet() as the ui32Flags parameter.
223 //
224 //*****************************************************************************
225 #define USB_EP_AUTO_SET 0x00000001 // Auto set feature enabled
226 #define USB_EP_AUTO_REQUEST 0x00000002 // Auto request feature enabled
227 #define USB_EP_AUTO_CLEAR 0x00000004 // Auto clear feature enabled
228 #define USB_EP_DMA_MODE_0 0x00000008 // Enable DMA access using mode 0
229 #define USB_EP_DMA_MODE_1 0x00000010 // Enable DMA access using mode 1
230 #define USB_EP_MODE_ISOC 0x00000000 // Isochronous endpoint
231 #define USB_EP_MODE_BULK 0x00000100 // Bulk endpoint
232 #define USB_EP_MODE_INT 0x00000200 // Interrupt endpoint
233 #define USB_EP_MODE_CTRL 0x00000300 // Control endpoint
234 #define USB_EP_MODE_MASK 0x00000300 // Mode Mask
235 #define USB_EP_SPEED_LOW 0x00000000 // Low Speed
236 #define USB_EP_SPEED_FULL 0x00001000 // Full Speed
237 #define USB_EP_HOST_IN 0x00000000 // Host IN endpoint
238 #define USB_EP_HOST_OUT 0x00002000 // Host OUT endpoint
239 #define USB_EP_DEV_IN 0x00002000 // Device IN endpoint
240 #define USB_EP_DEV_OUT 0x00000000 // Device OUT endpoint
241 
242 //*****************************************************************************
243 //
244 // The following are values that can be passed to USBHostPwrConfig() as the
245 // ui32Flags parameter.
246 //
247 //*****************************************************************************
248 #define USB_HOST_PWRFLT_LOW 0x00000010
249 #define USB_HOST_PWRFLT_HIGH 0x00000030
250 #define USB_HOST_PWRFLT_EP_NONE 0x00000000
251 #define USB_HOST_PWRFLT_EP_TRI 0x00000140
252 #define USB_HOST_PWRFLT_EP_LOW 0x00000240
253 #define USB_HOST_PWRFLT_EP_HIGH 0x00000340
254 #define USB_HOST_PWREN_MAN_LOW 0x00000000
255 #define USB_HOST_PWREN_MAN_HIGH 0x00000001
256 #define USB_HOST_PWREN_AUTOLOW 0x00000002
257 #define USB_HOST_PWREN_AUTOHIGH 0x00000003
258 #define USB_HOST_PWREN_FILTER 0x00010000
259 
260 //*****************************************************************************
261 //
262 // The following are special values that can be passed to
263 // USBHostEndpointConfig() as the ui32NAKPollInterval parameter.
264 //
265 //*****************************************************************************
266 #define MAX_NAK_LIMIT 31 // Maximum NAK interval
267 #define DISABLE_NAK_LIMIT 0 // No NAK timeouts
268 
269 //*****************************************************************************
270 //
271 // This value specifies the maximum size of transfers on endpoint 0 as 64
272 // bytes. This value is fixed in hardware as the FIFO size for endpoint 0.
273 //
274 //*****************************************************************************
275 #define MAX_PACKET_SIZE_EP0 64
276 
277 //*****************************************************************************
278 //
279 // These values are used to indicate which endpoint to access.
280 //
281 //*****************************************************************************
282 #define USB_EP_0 0x00000000 // Endpoint 0
283 #define USB_EP_1 0x00000010 // Endpoint 1
284 #define USB_EP_2 0x00000020 // Endpoint 2
285 #define USB_EP_3 0x00000030 // Endpoint 3
286 #define USB_EP_4 0x00000040 // Endpoint 4
287 #define USB_EP_5 0x00000050 // Endpoint 5
288 #define USB_EP_6 0x00000060 // Endpoint 6
289 #define USB_EP_7 0x00000070 // Endpoint 7
290 #define NUM_USB_EP 8 // Number of supported endpoints
291 
292 //*****************************************************************************
293 //
294 // These macros allow conversion between 0-based endpoint indices and the
295 // USB_EP_x values required when calling various USB APIs.
296 //
297 //*****************************************************************************
298 #define IndexToUSBEP(x) ((x) << 4)
299 #define USBEPToIndex(x) ((x) >> 4)
300 
301 //*****************************************************************************
302 //
303 // The following are values that can be passed to USBFIFOConfigSet() as the
304 // ui32FIFOSize parameter.
305 //
306 //*****************************************************************************
307 #define USB_FIFO_SZ_8 0x00000000 // 8 byte FIFO
308 #define USB_FIFO_SZ_16 0x00000001 // 16 byte FIFO
309 #define USB_FIFO_SZ_32 0x00000002 // 32 byte FIFO
310 #define USB_FIFO_SZ_64 0x00000003 // 64 byte FIFO
311 #define USB_FIFO_SZ_128 0x00000004 // 128 byte FIFO
312 #define USB_FIFO_SZ_256 0x00000005 // 256 byte FIFO
313 #define USB_FIFO_SZ_512 0x00000006 // 512 byte FIFO
314 #define USB_FIFO_SZ_1024 0x00000007 // 1024 byte FIFO
315 #define USB_FIFO_SZ_2048 0x00000008 // 2048 byte FIFO
316 
317 //*****************************************************************************
318 //
319 // This macro allow conversion from a FIFO size label as defined above to
320 // a number of bytes
321 //
322 //*****************************************************************************
323 #define USBFIFOSizeToBytes(x) (8 << (x))
324 
325 //*****************************************************************************
326 //
327 // The following are values that can be passed to USBEndpointDataSend() as the
328 // ui32TransType parameter.
329 //
330 //*****************************************************************************
331 #define USB_TRANS_OUT 0x00000102 // Normal OUT transaction
332 #define USB_TRANS_IN 0x00000102 // Normal IN transaction
333 #define USB_TRANS_IN_LAST 0x0000010a // Final IN transaction (for
334  // endpoint 0 in device mode)
335 #define USB_TRANS_SETUP 0x0000110a // Setup transaction (for endpoint
336  // 0)
337 #define USB_TRANS_STATUS 0x00000142 // Status transaction (for endpoint
338  // 0)
339 
340 //*****************************************************************************
341 //
342 // The following are values are returned by the USBModeGet function.
343 //
344 //*****************************************************************************
345 #define USB_DUAL_MODE_HOST 0x00000001 // Dual mode controller is in Host
346  // mode.
347 #define USB_DUAL_MODE_DEVICE 0x00000081 // Dual mode controller is in
348  // Device mode.
349 #define USB_DUAL_MODE_NONE 0x00000080 // Dual mode controller mode is not
350  // set.
351 #define USB_OTG_MODE_ASIDE_HOST 0x0000001d // OTG controller on the A side of
352  // the cable.
353 #define USB_OTG_MODE_ASIDE_NPWR 0x00000001 // OTG controller on the A side of
354  // the cable.
355 #define USB_OTG_MODE_ASIDE_SESS 0x00000009 // OTG controller on the A side of
356  // the cable Session Valid.
357 #define USB_OTG_MODE_ASIDE_AVAL 0x00000011 // OTG controller on the A side of
358  // the cable A valid.
359 #define USB_OTG_MODE_ASIDE_DEV 0x00000019 // OTG controller on the A side of
360  // the cable.
361 #define USB_OTG_MODE_BSIDE_HOST 0x0000009d // OTG controller on the B side of
362  // the cable.
363 #define USB_OTG_MODE_BSIDE_DEV 0x00000099 // OTG controller on the B side of
364  // the cable.
365 #define USB_OTG_MODE_BSIDE_NPWR 0x00000081 // OTG controller on the B side of
366  // the cable.
367 #define USB_OTG_MODE_NONE 0x00000080 // OTG controller mode is not set.
368 
369 //*****************************************************************************
370 //
371 // Prototypes for the APIs.
372 //
373 //*****************************************************************************
374 extern uint32_t USBDevAddrGet(uint32_t ui32Base);
375 extern void USBDevAddrSet(uint32_t ui32Base, uint32_t ui32Address);
376 extern void USBDevConnect(uint32_t ui32Base);
377 extern void USBDevDisconnect(uint32_t ui32Base);
378 extern void USBDevEndpointConfigSet(uint32_t ui32Base, uint32_t ui32Endpoint,
379  uint32_t ui32MaxPacketSize,
380  uint32_t ui32Flags);
381 extern void USBDevEndpointConfigGet(uint32_t ui32Base, uint32_t ui32Endpoint,
382  uint32_t *pui32MaxPacketSize,
383  uint32_t *pui32Flags);
384 extern void USBDevEndpointDataAck(uint32_t ui32Base, uint32_t ui32Endpoint,
385  bool bIsLastPacket);
386 extern void USBDevEndpointStall(uint32_t ui32Base, uint32_t ui32Endpoint,
387  uint32_t ui32Flags);
388 extern void USBDevEndpointStallClear(uint32_t ui32Base, uint32_t ui32Endpoint,
389  uint32_t ui32Flags);
390 extern void USBDevEndpointStatusClear(uint32_t ui32Base, uint32_t ui32Endpoint,
391  uint32_t ui32Flags);
392 extern uint32_t USBEndpointDataAvail(uint32_t ui32Base, uint32_t ui32Endpoint);
393 extern void USBEndpointDMAEnable(uint32_t ui32Base, uint32_t ui32Endpoint,
394  uint32_t ui32Flags);
395 extern void USBEndpointDMADisable(uint32_t ui32Base, uint32_t ui32Endpoint,
396  uint32_t ui32Flags);
397 extern void USBEndpointDMAConfigSet(uint32_t ui32Base, uint32_t ui32Endpoint,
398  uint32_t ui32Config);
399 extern int32_t USBEndpointDataGet(uint32_t ui32Base, uint32_t ui32Endpoint,
400  uint8_t *pui8Data, uint32_t *pui32Size);
401 extern int32_t USBEndpointDataPut(uint32_t ui32Base, uint32_t ui32Endpoint,
402  uint8_t *pui8Data, uint32_t ui32Size);
403 extern int32_t USBEndpointDataSend(uint32_t ui32Base, uint32_t ui32Endpoint,
404  uint32_t ui32TransType);
405 extern void USBEndpointDataToggleClear(uint32_t ui32Base,
406  uint32_t ui32Endpoint,
407  uint32_t ui32Flags);
408 extern void USBEndpointPacketCountSet(uint32_t ui32Base, uint32_t ui32Endpoint,
409  uint32_t ui32Count);
410 extern uint32_t USBEndpointStatus(uint32_t ui32Base, uint32_t ui32Endpoint);
411 extern uint32_t USBFIFOAddrGet(uint32_t ui32Base, uint32_t ui32Endpoint);
412 extern void USBFIFOConfigGet(uint32_t ui32Base, uint32_t ui32Endpoint,
413  uint32_t *pui32FIFOAddress,
414  uint32_t *pui32FIFOSize, uint32_t ui32Flags);
415 extern void USBFIFOConfigSet(uint32_t ui32Base, uint32_t ui32Endpoint,
416  uint32_t ui32FIFOAddress, uint32_t ui32FIFOSize,
417  uint32_t ui32Flags);
418 extern void USBFIFOFlush(uint32_t ui32Base, uint32_t ui32Endpoint,
419  uint32_t ui32Flags);
420 extern uint32_t USBFrameNumberGet(uint32_t ui32Base);
421 extern uint32_t USBHostAddrGet(uint32_t ui32Base, uint32_t ui32Endpoint,
422  uint32_t ui32Flags);
423 extern void USBHostAddrSet(uint32_t ui32Base, uint32_t ui32Endpoint,
424  uint32_t ui32Addr, uint32_t ui32Flags);
425 extern void USBHostEndpointConfig(uint32_t ui32Base, uint32_t ui32Endpoint,
426  uint32_t ui32MaxPacketSize,
427  uint32_t ui32NAKPollInterval,
428  uint32_t ui32TargetEndpoint,
429  uint32_t ui32Flags);
430 extern void USBHostEndpointDataAck(uint32_t ui32Base,
431  uint32_t ui32Endpoint);
432 extern void USBHostEndpointDataToggle(uint32_t ui32Base, uint32_t ui32Endpoint,
433  bool bDataToggle, uint32_t ui32Flags);
434 extern void USBHostEndpointStatusClear(uint32_t ui32Base,
435  uint32_t ui32Endpoint,
436  uint32_t ui32Flags);
437 extern uint32_t USBHostHubAddrGet(uint32_t ui32Base, uint32_t ui32Endpoint,
438  uint32_t ui32Flags);
439 extern void USBHostHubAddrSet(uint32_t ui32Base, uint32_t ui32Endpoint,
440  uint32_t ui32Addr, uint32_t ui32Flags);
441 extern void USBHostPwrDisable(uint32_t ui32Base);
442 extern void USBHostPwrEnable(uint32_t ui32Base);
443 extern void USBHostPwrConfig(uint32_t ui32Base, uint32_t ui32Flags);
444 extern void USBHostPwrFaultDisable(uint32_t ui32Base);
445 extern void USBHostPwrFaultEnable(uint32_t ui32Base);
446 extern void USBHostRequestIN(uint32_t ui32Base, uint32_t ui32Endpoint);
447 extern void USBHostRequestINClear(uint32_t ui32Base, uint32_t ui32Endpoint);
448 extern void USBHostRequestStatus(uint32_t ui32Base);
449 extern void USBHostReset(uint32_t ui32Base, bool bStart);
450 extern void USBHostResume(uint32_t ui32Base, bool bStart);
451 extern uint32_t USBHostSpeedGet(uint32_t ui32Base);
452 extern void USBHostSuspend(uint32_t ui32Base);
453 extern void USBIntDisableControl(uint32_t ui32Base, uint32_t ui32IntFlags);
454 extern void USBIntEnableControl(uint32_t ui32Base, uint32_t ui32IntFlags);
455 extern uint32_t USBIntStatusControl(uint32_t ui32Base);
456 extern void USBIntDisableEndpoint(uint32_t ui32Base, uint32_t ui32IntFlags);
457 extern void USBIntEnableEndpoint(uint32_t ui32Base, uint32_t ui32IntFlags);
458 extern uint32_t USBIntStatusEndpoint(uint32_t ui32Base);
459 extern void USBIntRegister(uint32_t ui32Base, void (*pfnHandler)(void));
460 extern void USBIntUnregister(uint32_t ui32Base);
461 extern void USBOTGSessionRequest(uint32_t ui32Base, bool bStart);
462 extern uint32_t USBModeGet(uint32_t ui32Base);
463 extern void USBEndpointDMAChannel(uint32_t ui32Base, uint32_t ui32Endpoint,
464  uint32_t ui32Channel);
465 extern void USBHostMode(uint32_t ui32Base);
466 extern void USBDevMode(uint32_t ui32Base);
467 extern void USBOTGMode(uint32_t ui32Base);
468 extern void USBPHYPowerOff(uint32_t ui32Base);
469 extern void USBPHYPowerOn(uint32_t ui32Base);
470 extern uint32_t USBNumEndpointsGet(uint32_t ui32Base);
471 
472 //*****************************************************************************
473 //
474 // Mark the end of the C bindings section for C++ compilers.
475 //
476 //*****************************************************************************
477 #ifdef __cplusplus
478 }
479 #endif
480 
481 #endif // __DRIVERLIB_USB_H__
void USBDevEndpointStall(uint32_t ui32Base, uint32_t ui32Endpoint, uint32_t ui32Flags)
Definition: usb.c:1201
int32_t USBEndpointDataPut(uint32_t ui32Base, uint32_t ui32Endpoint, uint8_t *pui8Data, uint32_t ui32Size)
Definition: usb.c:2696
void USBIntEnableEndpoint(uint32_t ui32Base, uint32_t ui32IntFlags)
Definition: usb.c:632
void USBPHYPowerOn(uint32_t ui32Base)
Definition: usb.c:3802
void USBHostAddrSet(uint32_t ui32Base, uint32_t ui32Endpoint, uint32_t ui32Addr, uint32_t ui32Flags)
Definition: usb.c:3064
void USBHostEndpointDataAck(uint32_t ui32Base, uint32_t ui32Endpoint)
Definition: usb.c:2650
void USBEndpointDMAEnable(uint32_t ui32Base, uint32_t ui32Endpoint, uint32_t ui32Flags)
Definition: usb.c:2351
uint32_t USBModeGet(uint32_t ui32Base)
Definition: usb.c:3596
void USBIntDisableControl(uint32_t ui32Base, uint32_t ui32IntFlags)
Definition: usb.c:399
void USBEndpointDMAChannel(uint32_t ui32Base, uint32_t ui32Endpoint, uint32_t ui32Channel)
Definition: usb.c:3642
void USBHostRequestStatus(uint32_t ui32Base)
Definition: usb.c:3029
void USBHostEndpointDataToggle(uint32_t ui32Base, uint32_t ui32Endpoint, bool bDataToggle, uint32_t ui32Flags)
Definition: usb.c:1059
void USBHostEndpointStatusClear(uint32_t ui32Base, uint32_t ui32Endpoint, uint32_t ui32Flags)
Definition: usb.c:929
uint32_t USBEndpointDataAvail(uint32_t ui32Base, uint32_t ui32Endpoint)
Definition: usb.c:2433
uint32_t USBFIFOAddrGet(uint32_t ui32Base, uint32_t ui32Endpoint)
Definition: usb.c:3536
void USBHostPwrEnable(uint32_t ui32Base)
Definition: usb.c:3419
uint32_t USBEndpointStatus(uint32_t ui32Base, uint32_t ui32Endpoint)
Definition: usb.c:880
void USBIntDisableEndpoint(uint32_t ui32Base, uint32_t ui32IntFlags)
Definition: usb.c:592
void USBDevMode(uint32_t ui32Base)
Definition: usb.c:3726
void USBHostPwrFaultDisable(uint32_t ui32Base)
Definition: usb.c:3391
uint32_t USBFrameNumberGet(uint32_t ui32Base)
Definition: usb.c:3472
void USBHostSuspend(uint32_t ui32Base)
Definition: usb.c:232
void USBFIFOFlush(uint32_t ui32Base, uint32_t ui32Endpoint, uint32_t ui32Flags)
Definition: usb.c:2847
int32_t USBEndpointDataGet(uint32_t ui32Base, uint32_t ui32Endpoint, uint8_t *pui8Data, uint32_t *pui32Size)
Definition: usb.c:2497
void USBEndpointPacketCountSet(uint32_t ui32Base, uint32_t ui32Endpoint, uint32_t ui32Count)
Definition: usb.c:3831
void USBDevConnect(uint32_t ui32Base)
Definition: usb.c:1331
void USBHostMode(uint32_t ui32Base)
Definition: usb.c:3695
void USBHostPwrDisable(uint32_t ui32Base)
Definition: usb.c:3447
void USBHostResume(uint32_t ui32Base, bool bStart)
Definition: usb.c:309
void USBOTGMode(uint32_t ui32Base)
Definition: usb.c:3752
void USBEndpointDataToggleClear(uint32_t ui32Base, uint32_t ui32Endpoint, uint32_t ui32Flags)
Definition: usb.c:1154
void USBHostPwrConfig(uint32_t ui32Base, uint32_t ui32Flags)
Definition: usb.c:3323
uint32_t USBHostSpeedGet(uint32_t ui32Base)
Definition: usb.c:353
void USBEndpointDMADisable(uint32_t ui32Base, uint32_t ui32Endpoint, uint32_t ui32Flags)
Definition: usb.c:2391
void USBIntUnregister(uint32_t ui32Base)
Definition: usb.c:785
void USBDevEndpointDataAck(uint32_t ui32Base, uint32_t ui32Endpoint, bool bIsLastPacket)
Definition: usb.c:2599
uint32_t USBNumEndpointsGet(uint32_t ui32Base)
Definition: usb.c:3854
void USBDevEndpointStatusClear(uint32_t ui32Base, uint32_t ui32Endpoint, uint32_t ui32Flags)
Definition: usb.c:975
void USBHostPwrFaultEnable(uint32_t ui32Base)
Definition: usb.c:3364
void USBFIFOConfigGet(uint32_t ui32Base, uint32_t ui32Endpoint, uint32_t *pui32FIFOAddress, uint32_t *pui32FIFOSize, uint32_t ui32Flags)
Definition: usb.c:2160
void USBDevEndpointConfigSet(uint32_t ui32Base, uint32_t ui32Endpoint, uint32_t ui32MaxPacketSize, uint32_t ui32Flags)
Definition: usb.c:1766
void USBDevEndpointConfigGet(uint32_t ui32Base, uint32_t ui32Endpoint, uint32_t *pui32MaxPacketSize, uint32_t *pui32Flags)
Definition: usb.c:1917
void USBIntEnableControl(uint32_t ui32Base, uint32_t ui32IntFlags)
Definition: usb.c:450
uint32_t USBHostHubAddrGet(uint32_t ui32Base, uint32_t ui32Endpoint, uint32_t ui32Flags)
Definition: usb.c:3236
void USBHostReset(uint32_t ui32Base, bool bStart)
Definition: usb.c:264
uint32_t USBIntStatusEndpoint(uint32_t ui32Base)
Definition: usb.c:673
void USBHostRequestIN(uint32_t ui32Base, uint32_t ui32Endpoint)
Definition: usb.c:2931
int32_t USBEndpointDataSend(uint32_t ui32Base, uint32_t ui32Endpoint, uint32_t ui32TransType)
Definition: usb.c:2777
void USBOTGSessionRequest(uint32_t ui32Base, bool bStart)
Definition: usb.c:3500
uint32_t USBHostAddrGet(uint32_t ui32Base, uint32_t ui32Endpoint, uint32_t ui32Flags)
Definition: usb.c:3114
void USBHostRequestINClear(uint32_t ui32Base, uint32_t ui32Endpoint)
Definition: usb.c:2981
uint32_t USBDevAddrGet(uint32_t ui32Base)
Definition: usb.c:1417
void USBHostHubAddrSet(uint32_t ui32Base, uint32_t ui32Endpoint, uint32_t ui32Addr, uint32_t ui32Flags)
Definition: usb.c:3168
void USBIntRegister(uint32_t ui32Base, void(*pfnHandler)(void))
Definition: usb.c:745
void USBDevEndpointStallClear(uint32_t ui32Base, uint32_t ui32Endpoint, uint32_t ui32Flags)
Definition: usb.c:1263
void USBDevDisconnect(uint32_t ui32Base)
Definition: usb.c:1360
void USBFIFOConfigSet(uint32_t ui32Base, uint32_t ui32Endpoint, uint32_t ui32FIFOAddress, uint32_t ui32FIFOSize, uint32_t ui32Flags)
Definition: usb.c:2097
void USBDevAddrSet(uint32_t ui32Base, uint32_t ui32Address)
Definition: usb.c:1389
uint32_t USBIntStatusControl(uint32_t ui32Base)
Definition: usb.c:525
void USBHostEndpointConfig(uint32_t ui32Base, uint32_t ui32Endpoint, uint32_t ui32MaxPacketSize, uint32_t ui32NAKPollInterval, uint32_t ui32TargetEndpoint, uint32_t ui32Flags)
Definition: usb.c:1504
void USBEndpointDMAConfigSet(uint32_t ui32Base, uint32_t ui32Endpoint, uint32_t ui32Config)
Definition: usb.c:2278
void USBPHYPowerOff(uint32_t ui32Base)
Definition: usb.c:3780