EasyManuals Logo
Home>Texas Instruments>Microcontrollers>Tiva TM4C123GH6PM

Texas Instruments Tiva TM4C123GH6PM User Manual

Texas Instruments Tiva TM4C123GH6PM
352 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #298 background imageLoading...
Page #298 background image
USB Controller
// 64-576 - endpoint 1 IN (512 bytes).
//
// 576-1088 - endpoint 1 OUT (512 bytes).
//
// 1088-1600 - endpoint 2 IN (512 bytes).
//
//
// FIFO for endpoint 1 IN starts at address 64 and is 512 bytes in size.
//
ROM_USBFIFOConfigSet(USB0_BASE, USB_EP_1, 64, USB_FIFO_SZ_512,
USB_EP_DEV_IN);
//
// FIFO for endpoint 1 OUT starts at address 576 and is 512 bytes in size.
//
ROM_USBFIFOConfigSet(USB0_BASE, USB_EP_1, 576, USB_FIFO_SZ_512,
USB_EP_DEV_OUT);
//
// FIFO for endpoint 2 IN starts at address 1088 and is 512 bytes in size.
//
ROM_USBFIFOConfigSet(USB0_BASE, USB_EP_2, 1088, USB_FIFO_SZ_512,
USB_EP_DEV_IN);
24.2 Using USB with the uDMA Controller
The USB controller can be used with the uDMA for either sending or receiving data with both host
and device controllers. The uDMA controller cannot be used to access endpoint 0, however all
other endpoints are capable of using the uDMA controller. The uDMA channel numbers for USB
are defined by the following values:
UDMA_CHANNEL_USBEP1RX
UDMA_CHANNEL_USBEP1TX
UDMA_CHANNEL_USBEP2RX
UDMA_CHANNEL_USBEP2TX
UDMA_CHANNEL_USBEP3RX
UDMA_CHANNEL_USBEP3TX
Since the uDMA controller views transfers as either transmit or receive, and the USB controller
operates on IN/OUT transactions, some care must be taken to use the correct uDMA channel
with the correct endpoint. USB host IN and USB device OUT endpoints both use receive uDMA
channels while USB host OUT and USB device IN endpoints will use transmit uDMA channels.
When configuring the endpoint there are additional DMA settings needed. When calling
ROM_USBDevEndpointConfigSet() for an endpoint that will use uDMA, extra flags need to
be added to the ui32Flags parameter. These flags are one of USB_EP_DMA_MODE_0
or USB_EP_DMA_MODE_1 to control the mode of the DMA transaction, and likely
USB_EP_AUTO_SET to allow the data to be transmitted automatically once a packet is ready.
USB_EP_DMA_MODE_0 will generate an interrupt whenever there is more space available
in the FIFO. This allows the application code to perform operations between each packet.
USB_EP_DMA_MODE_1 will only interrupt when the DMA transfer complete or there is some
type of error condition. This can be used for larger transmissions that require no interaction be-
tween packets. USB_EP_AUTO_SET should normally be specified when using uDMA to prevent
the need for application code to start the actual transfer of data.
298 April 8, 2013

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Texas Instruments Tiva TM4C123GH6PM and is the answer not in the manual?

Texas Instruments Tiva TM4C123GH6PM Specifications

General IconGeneral
BrandTexas Instruments
ModelTiva TM4C123GH6PM
CategoryMicrocontrollers
LanguageEnglish

Related product manuals