USB Controller
24
USB Controller
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297
Using uDMA with USB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 298
Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302
24.1
Introduction
The USB APIs provide a set of functions that are used to access the USB device or host controllers.
The APIs are split into groups according to the functionality provided by the USB controller present
in the microcontroller. Because of this, the driver has to handle microcontrollers that have only a
USB device interface, a host and/or device interface, or microcontrollers that have an OTG interface,
The groups are the following: USBDev, USBHost, USBOTG, USBEndpoint, and USBFIFO. The
APIs in the USBDev group are only used with microcontrollers that have a USB device controller.
The APIs in the USBHost group can only be used with microcontrollers that have a USB host
controller. The USBOTG APIs are used by microcontrollers with an OTG interface. With USB OTG
controllers, once the mode of the USB controller is configured, the device or host APIs should be
used. The remainder of the APIs are used for both USB host and USB device controllers. The
USBEndpoint APIs are used to configure and access the endpoints while the USBFIFO APIs are
used to configure the size and location of the FIFOs.
The USB APIs abstract the IN/OUT nature of endpoints based on the type of USB controller that is
in use. Any API that uses the IN/OUT terminology will comply with the standard USB interpretation
of these terms. For example, an OUT endpoint on a microcontroller that has only a device interface
will actually receive data on this endpoint, while a microcontroller that has a host interface will
actually transmit data on an OUT endpoint.
Another important fact to understand is that all endpoints in the USB controller, whether host or
device, have two “sides” to them. This allows each endpoint to both transmit and receive data. An
application can use a single endpoint for both and IN and OUT transactions. For example: In device
mode, endpoint 1 could be configured to have BULK IN and BULK OUT handled by endpoint 1. It
is important to note that the endpoint number used is the endpoint number reported to the host.
For microcontrollers with host controllers, the application can use an endpoint communicate with
both IN and OUT endpoints of different types as well. For example: Endpoint 2 could be used to
communicate with one device’s interrupt IN endpoint and another device’s bulk OUT endpoint at
the same time. This effectively gives the application one dedicated control endpoint for IN or OUT
control transactions on endpoint 0, and three IN endpoints and three OUT endpoints.
The USB controller has a configurable FIFOs in devices that have a USB device controller as well as
those that have a host controller. The overall size of the FIFO RAM is 4096 bytes. It is important to
note that the first 64 bytes of this memory are dedicated to endpoint 0 for control transactions. The
remaining 4032 bytes are configurable however the application desires. The FIFO configuration is
usually set at the beginning of the application and not modified once the USB controller is in use.
The FIFO configuration uses the
API to set the starting address and
the size of the FIFOs that are dedicated to each endpoint.
Example: FIFO Configuration
//
// 0-64
- endpoint 0 IN/OUT (64 bytes).
//
April 8, 2013
297
Summary of Contents for Tiva TM4C123GH6PM
Page 26: ...Boot Loader 26 April 8 2013...
Page 68: ...Controller Area Network CAN 68 April 8 2013...
Page 122: ...Hibernation Module 122 April 8 2013...
Page 136: ...Inter Integrated Circuit I2C 136 April 8 2013...
Page 152: ...Memory Protection Unit MPU 152 April 8 2013...
Page 174: ...Pulse Width Modulator PWM Returns None 174 April 8 2013...
Page 196: ...Synchronous Serial Interface SSI 196 April 8 2013...
Page 222: ...System Control 222 April 8 2013...
Page 270: ...UART 270 April 8 2013...
Page 296: ...uDMA Controller 296 April 8 2013...
Page 351: ...April 8 2013 351...