Nxp semiconductors – NXP Semiconductors LPC24XX UM10237 User Manual

Page 349

Advertising
background image

UM10237_4

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

User manual

Rev. 04 — 26 August 2009

349 of 792

NXP Semiconductors

UM10237

Chapter 13: LPC24XX USB device controller

USBReEp |= (UInt32) ((0x1 << endpt));

/* Load Endpoint index Reg with physical endpoint no.*/

USBEpIn = (UInt32) endpointnumber;

/* load the max packet size Register */

USBEpMaxPSize = MPS;

/* check whether the EP_RLZED bit in the Device Interrupt Status register is set

*/

while (!(USBDevIntSt & EP_RLZED))

{

/* wait until endpoint realization is complete */

}

/* Clear the EP_RLZED bit */

Clear EP_RLZED bit in USBDevIntSt;

}

The device will not respond to any transactions to unrealized endpoints. The SIE
Configure Device command will only cause realized and enabled endpoints to respond to
transactions. For details see

Table 13–349

.

9.5.3 USB Endpoint Index register (USBEpIn - 0xFFE0 C248)

Each endpoint has a register carrying the MaxPacketSize value for that endpoint. This is
in fact a register array. Hence before writing, this register is addressed through the
USBEpIn register.

The USBEpIn register will hold the physical endpoint number. Writing to USBMaxPSize
will set the array element pointed to by USBEpIn. USBEpIn is a write only register.

9.5.4 USB MaxPacketSize register (USBMaxPSize - 0xFFE0 C24C)

On reset, the control endpoint is assigned the maximum packet size of 8 bytes. Other
endpoints are assigned 0. Modifying USBMaxPSize will cause the endpoint buffer
addresses within the EP_RAM to be recalculated. This is a multi-cycle process. At the
end, the EP_RLZED bit will be set in USBDevIntSt (

Table 13–298

). USBMaxPSize array

indexing is shown in

Figure 13–46

. USBMaxPSize is a read/write register.

[1]

Reset value for EP0 and EP1. All other endpoints have a reset value of 0x0.

Table 319. USB Endpoint Index register (USBEpIn - address 0xFFE0 C248) bit description

Bit

Symbol

Description

Reset value

4:0

PHY_EP

Physical endpoint number (0-31)

0

31:5

-

Reserved, user software should not write ones to reserved
bits. The value read from a reserved bit is not defined.

NA

Table 320. USB MaxPacketSize register (USBMaxPSize - address 0xFFE0 C24C) bit

description

Bit

Symbol

Description

Reset value

9:0

MPS

The maximum packet size value.

0x008

[1]

31:10

-

Reserved, user software should not write ones to reserved
bits. The value read from a reserved bit is not defined.

NA

Advertising