
Universal Serial Bus Interface – On-The-Go Module
21-54
Freescale Semiconductor
21.5.3
Device Operation
The device controller performs data transfers using a set of linked list transfer descriptors pointed to by a
queue head. The next sections explain the use of the device controller from the device controller driver
(DCD) point-of-view and further describe how specific USB bus events relate to status changes in the
device controller programmer's interface.
21.5.3.1
Device Controller Initialization
After hardware reset, USB OTG is disabled until the run/stop bit in the USBCMD register is set. At
minimum, it is necessary to have the queue heads set up for endpoint 0 before the device attach occurs.
Shortly after the device is enabled, a USB reset occurs followed by setup packet arriving at endpoint 0. A
queue head must be prepared so the device controller can store the incoming setup packet.
To initialize a device, the software must:
1. Optionally set streaming disable in the USBMODE[SDIS] bit.
2. Optionally modify the BURSTSIZE register.
3. Program the PORTSC1[PTS] field if using a non-ULPI PHY.
4. Write the appropriate value to the USBINTR to enable the desired interrupts. For device operation,
setting UE, UEE, PCE, URE, and SLE is recommended.
For a list of available interrupts, refer to
Section 21.3.3.3, “USB Interrupt Enable Register
Section 21.3.3.2, “USB Status Register (USBSTS).”
5. Set the USBMODE[CM] field to enable device mode, and set the USBMODE[ES] bit for big
endian operation.
6. Optionally write the USBCMD register to set the desired interrupt threshold.
7. Set USBMODE[SLOM] to disable setup lockouts.
8. Initialize the EPLISTADDR.
9. Create two dQHs for endpoint 0—one for IN transactions and one for OUT transactions.
For information on device queue heads, refer to
Section 21.5.2.1, “Endpoint Queue Head.”
10. Set the CCM’s UOCSR[BVLD] bit to allow device to connect to a host.
11. Set the USBCMD[RS] bit.
After the run/stop bit is set, a device reset occurs. The DCD must monitor the reset event and set the
DEVICEADDR and EPCR
n
registers,
and adjust the software state as described in
NOTE
Endpoint 0 is a control endpoint only and does not need to configured using
the EPCR0 register.
It is not necessary to initially prime endpoint 0 because the first packet received is always a setup packet.
The contents of the first setup packet requires a response in accordance with USB device framework
command set.
MCF5329 Reference Manual, Rev 3
Содержание MCF5329
Страница 106: ...ColdFire Core 3 32 Freescale Semiconductor MCF5329 Reference Manual Rev 3...
Страница 126: ...Enhanced Multiply Accumulate Unit EMAC 4 20 Freescale Semiconductor MCF5329 Reference Manual Rev 3...
Страница 148: ...Cache 5 22 Freescale Semiconductor MCF5329 Reference Manual Rev 3...
Страница 154: ...Static RAM SRAM 6 6 Freescale Semiconductor MCF5329 Reference Manual Rev 3...
Страница 184: ...Power Management 8 18 Freescale Semiconductor MCF5329 Reference Manual Rev 3...
Страница 204: ...Reset Controller Module 10 8 Freescale Semiconductor MCF5329 Reference Manual Rev 3...
Страница 220: ...System Control Module SCM 11 16 Freescale Semiconductor MCF5329 Reference Manual Rev 3...
Страница 228: ...Crossbar Switch XBS 12 8 Freescale Semiconductor MCF5329 Reference Manual Rev 3...
Страница 268: ...General Purpose I O Module 13 40 Freescale Semiconductor MCF5329 Reference Manual Rev 3...
Страница 392: ...SDRAM Controller SDRAMC 18 30 Freescale Semiconductor MCF5329 Reference Manual Rev 3...
Страница 436: ...Fast Ethernet Controller FEC 19 44 Freescale Semiconductor MCF5329 Reference Manual Rev 3...
Страница 564: ...Liquid Crystal Display Controller LCDC 22 44 Freescale Semiconductor MCF5329 Reference Manual Rev 3...
Страница 594: ...FlexCAN 23 30 Freescale Semiconductor MCF5329 Reference Manual Rev 3...
Страница 678: ...Pulse Width Modulation PWM Module 26 22 Freescale Semiconductor MCF5329 Reference Manual Rev 3...
Страница 684: ...Watchdog Timer Module 27 6 Freescale Semiconductor MCF5329 Reference Manual Rev 3...
Страница 692: ...Programmable Interrupt Timers PIT0 PIT3 28 8 Freescale Semiconductor MCF5329 Reference Manual Rev 3...
Страница 704: ...DMA Timers DTIM0 DTIM3 29 12 Freescale Semiconductor MCF5329 Reference Manual Rev 3...
Страница 720: ...Queued Serial Peripheral Interface QSPI 30 16 Freescale Semiconductor MCF5329 Reference Manual Rev 3...
Страница 754: ...UART Modules 31 34 Freescale Semiconductor MCF5329 Reference Manual Rev 3...
Страница 770: ...I2 C Interface 32 16 Freescale Semiconductor MCF5329 Reference Manual Rev 3...
Страница 790: ...Message Digest Hardware Accelerator MDHA 33 20 Freescale Semiconductor MCF5329 Reference Manual Rev 3...
Страница 866: ...Debug Module 36 50 Freescale Semiconductor MCF5329 Reference Manual Rev 3...
Страница 902: ...Register Memory Map Quick Reference A 26 Freescale Semiconductor MCF5329 Reference Manual Rev 3...