DR
AFT
DR
AFT
DRAFT
DR
D
RAFT
DRAFT
DRA
FT DRAF
D
RAFT DRAFT DRAFT DRAFT DRAFT D
DRAFT
D
RAFT DRA
FT DRAFT DRAFT DRAFT DRA
UM10316_0
© NXP B.V. 2008. All rights reserved.
User manual
Rev. 00.06 — 17 December 2008
233 of 571
NXP Semiconductors
UM10316
Chapter 15: LPC29xx USB OTG interface
/* Wait for TDI to be set */
while (!(OTG_I2C_STS & TDI));
/* Clear TDI */
OTG_I2C_STS = TDI;
Add D+ pull-up
/* Add D+ pull-up through ISP1301 */
OTG_I2C_TX = 0x15A; // Send ISP1301 address, R/W=0
OTG_I2C_TX = 0x006; // Send OTG Control (Set) register address
OTG_I2C_TX = 0x201; // Set DP_PULLUP bit, send STOP condition
/* Wait for TDI to be set */
while (!(OTG_I2C_STS & TDI));
/* Clear TDI */
OTG_I2C_STS = TDI;
7.2 A-device: host to peripheral HNP switching
In this case, the role of the OTG controller is host (A-device), and the A-device switches
roles from host to peripheral.
The On-The-Go Supplement defines the behavior of a dual-role A-device during HNP
using a state machine diagram. The OTG software stack is responsible for implementing
all of the states in the Dual-Role A-Device State Diagram.
The OTG controller hardware provides support for the state transitions between a_host,
a_suspend, a_wait_vfall, and a_peripheral in the Dual-Role A-Device state diagram.
Setting A_HNP_TRACK in the OTGStCtrl register enables hardware support for switching
the A-device from the host state to the device state. The hardware actions after setting
this bit are shown in