EasyManuals Logo

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 #301 background imageLoading...
Page #301 background image
USB Controller
by a call to ROM_uDMAChannelAttributeEnable() with the DMA_ATTR_USEBURST value.
Note:
All uDMA transfers used by the USB controller must use burst mode.
The final call sets the read access size to 8 bits wide, the source address increment to 0, the
destination address increment to 8 bits and the uDMA arbitration size to 64 bytes.
Example: Configure endpoint 1 transmit channel.
//
// Clear out any uDMA settings.
//
ROM_uDMAChannelAttributeDisable(UDMA_CHANNEL_USBEP1RX, UDMA_ATTR_ALL);
ROM_uDMAChannelAttributeEnable(UDMA_CHANNEL_USBEP1RX, UDMA_ATTR_USEBURST);
ROM_uDMAChannelControlSet(UDMA_CHANNEL_USBEP1RX,
(UDMA_SIZE_8 | UDMA_SRC_INC_NONE |
UDMA_DST_INC_8 | UDMA_ARB_64));
The next step is to actually start the uDMA transfer. Unlike the transfer side, if the application is
ready, this can be set up right away to wait for incoming data. Like the transmit case, these are
the only calls needed to start a new transfer, normally all of the previous uDMA configuration can
remain the same.
Example: Start requesting of data on endpoint 1.
//
// Configure the address and size of the data to transfer. The transfer
// is from the USB FIFO for endpoint 0 to g_DataBufferIn.
//
ROM_uDMAChannelTransferSet(UDMA_CHANNEL_USBEP1RX, UDMA_MODE_BASIC,
(void
*
)ROM_USBFIFOAddr(USB0_BASE, USB_EP_1),
g_DataBufferIn, 64);
//
// Enable the uDMA channel and wait for data.
//
ROM_uDMAChannelEnable(UDMA_CHANNEL_USBEP1RX);
The uDMA interrupt occurs on the same interrupt vector as any other USB interrupt, this means
that the application needs to check to see what was the actual source of the interrupt. It is possible
that the USB interrupt does not indicate that the USB transfer was complete. The interrupt could
also have been caused by a short packet, error, or even a transmit complete. This requires that the
application check both receive cases to determine if this is related to receiving data on the endpoint.
Because the USB has no status bit indicating that the interrupt was due to a uDMA complete, the
application must remember if a uDMA transaction was in progress.
Example: Interrupt handling with uDMA.
//
// Get the current interrupt status.
//
ui32Status = ROM_USBIntStatusEndpoint(USB0_BASE);
if(ui32Status & USB_INT_DEV_OUT_EP1)
{
//
April 8, 2013 301

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