UM10360 All information provided in this document is subject to legal disclaimers. © NXP B.V. 2013. All rights reserved.
User manual Rev. 3 — 19 December 2013 235 of 841
NXP Semiconductors
UM10360
Chapter 11: LPC176x/5x USB device controller
11.10.5.4 USB Transmit Packet Length register (USBTxPLen - 0x5000 C224)
This register contains the number of bytes transferred from the CPU to the selected
endpoint buffer. Before writing data to USBTxData, software should first write the packet
length (ï‚£ï€ MaxPacketSize) to this register. After each write to USBTxData, hardware
decrements USBTxPLen by 4. The WR_EN bit and LOG_ENDPOINT field of the USBCtrl
register should be set to select the desired endpoint buffer before starting this process.
For data buffers larger than the endpoint’s MaxPacketSize, software should submit data in
packets of MaxPacketSize, and send the remaining extra bytes in the last packet. For
example, if the MaxPacketSize is 64 bytes and the data buffer to be transferred is of
length 130 bytes, then the software sends two 64-byte packets and the remaining 2 bytes
in the last packet. So, a total of 3 packets are sent on USB. USBTxPLen is a write-only
register.
11.10.5.5 USB Control register (USBCtrl - 0x5000 C228)
This register controls the data transfer operation of the USB device. It selects the endpoint
buffer that is accessed by the USBRxData and USBTxData registers, and enables
reading and writing them. USBCtrl is a read/write register.
Table 217. USB Transmit Data register (USBTxData - address 0x5000 C21C) bit description
Bit Symbol Description Reset value
31:0 TX_DATA Transmit Data. 0x0000 0000
Table 218. USB Transmit Packet Length register (USBTxPLen - address 0x5000 C224) bit description
Bit Symbol Value Description Reset value
9:0 PKT_LNGTH - The remaining number of bytes to be written to the selected endpoint buffer.
This field is decremented by 4 by hardware after each write to USBTxData.
When this field decrements to 0, the TxENDPKT bit will be set in
USBDevIntSt.
0x000
31:10 - - Reserved, user software should not write ones to reserved bits. The value
read from a reserved bit is not defined.
NA
Table 219. USB Control register (USBCtrl - address 0x5000 C228) bit description
Bit Symbol Value Description Reset value
0 RD_EN Read mode control. Enables reading data from the OUT endpoint buffer
for the endpoint specified in the LOG_ENDPOINT field using the
USBRxData register. This bit is cleared by hardware when the last word
of the current packet is read from USBRxData.
0
0 Read mode is disabled.
1 Read mode is enabled.
1 WR_EN Write mode control. Enables writing data to the IN endpoint buffer for the
endpoint specified in the LOG_ENDPOINT field using the USBTxData
register. This bit is cleared by hardware when the number of bytes in
USBTxLen have been sent.
0
0 Write mode is disabled.
1 Write mode is enabled.
5:2 LOG_ENDPOINT - Logical Endpoint number. 0x0
31:6 - - Reserved, user software should not write ones to reserved bits. The
value read from a reserved bit is not defined.
NA