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
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
Содержание Tiva TM4C123GH6PM
Страница 26: ...Boot Loader 26 April 8 2013...
Страница 68: ...Controller Area Network CAN 68 April 8 2013...
Страница 122: ...Hibernation Module 122 April 8 2013...
Страница 136: ...Inter Integrated Circuit I2C 136 April 8 2013...
Страница 152: ...Memory Protection Unit MPU 152 April 8 2013...
Страница 174: ...Pulse Width Modulator PWM Returns None 174 April 8 2013...
Страница 196: ...Synchronous Serial Interface SSI 196 April 8 2013...
Страница 222: ...System Control 222 April 8 2013...
Страница 270: ...UART 270 April 8 2013...
Страница 296: ...uDMA Controller 296 April 8 2013...
Страница 351: ...April 8 2013 351...