2 a-device: host to peripheral hnp switching – NXP Semiconductors LPC24XX UM10237 User Manual

Page 415

Advertising
background image

UM10237_4

© NXP B.V. 2009. All rights reserved.

User manual

Rev. 04 — 26 August 2009

415 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 ISP1302 */

OTG_I2C_TX = 0x15A; // Send ISP1302 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

Figure 15–62

.

Advertising