Nxp Semiconductors UM10237 ユーザーズマニュアル

ページ / 792
UM10237_2
© NXP B.V. 2008. All rights reserved.
User manual
Rev. 02 — 19 December 2008 
414 of 792
NXP Semiconductors
UM10237
Chapter 15: LPC24XX USB OTG controller
/* 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;
8.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 
.