UM10375 All information provided in this document is subject to legal disclaimers. © NXP B.V. 2011. All rights reserved.
User manual Rev. 3 — 14 June 2011 363 of 368
NXP Semiconductors
UM10375
Chapter 23: LPC13xx Supplementary information
10.10.1.1 USB Device Interrupt Status register
(USBDevIntSt - 0x4002 0000) . . . . . . . . . . . 143
10.10.1.2 USB Device Interrupt Enable register
(USBDevIntEn - 0x4002 0004). . . . . . . . . . . 144
10.10.1.3 USB Device Interrupt Clear register
(USBDevIntClr - 0x4002 0008). . . . . . . . . . . 146
10.10.1.4 USB Device Interrupt Set register (USBDevIntSet
- 0x4002 000C). . . . . . . . . . . . . . . . . . . . . . . 147
10.10.2 SIE command code registers . . . . . . . . . . . . 149
10.10.2.1 USB Command Code register (USBCmdCode -
0x4001 8010) . . . . . . . . . . . . . . . . . . . . . . . . 149
10.10.2.2 USB Command Data register (USBCmdData -
0x4002 0014) . . . . . . . . . . . . . . . . . . . . . . . . 150
10.10.3 USB data transfer registers . . . . . . . . . . . . . 150
10.10.3.1 USB Receive Data register (USBRxData - 0x4002
0018) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
10.10.3.2 USB Transmit Data register (USBTxData - 0x4002
021C) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
10.10.3.3 USB Receive Packet Length register
(USBRxPLen - 0x4002 0020) . . . . . . . . . . . . 150
10.10.3.4 USB Transmit Packet Length register
(USBTxPLen - 0x4002 0024) . . . . . . . . . . . . 151
10.10.3.5 USB Control register (USBCtrl -
0x4002 0028) . . . . . . . . . . . . . . . . . . . . . . . . 151
10.10.3.5.1 Data transfer. . . . . . . . . . . . . . . . . . . . . . . . 152
10.10.4 Miscellaneous registers . . . . . . . . . . . . . . . . 153
10.10.4.1 USB Device FIQ Select register (USBDevFIQSel
- 0x4002 002C). . . . . . . . . . . . . . . . . . . . . . . 153
10.11 Serial interface engine command
description . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
10.11.1 Set Address (Command: 0xD0, Data: write
1 byte). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
10.11.2 Configure Device (Command: 0xD8, Data: write 1
byte) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
10.11.3 Set Mode (Command: 0xF3, Data: write
1 byte). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
10.11.4 Read Interrupt Status (Command: 0xF4, Data:
read 2 bytes) . . . . . . . . . . . . . . . . . . . . . . . . 156
10.11.5 Read Current Frame Number (Command: 0xF5,
Data: read 1 or 2 bytes) . . . . . . . . . . . . . . . . 157
10.11.6 Read Chip ID (Command: 0xFD, Data: read 2
bytes) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
10.11.7 Set Device Status (Command: 0xFE, Data: write 1
byte). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
10.11.8 Get Device Status (Command: 0xFE, Data: read 1
byte). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158
10.11.9 Get Error Code (Command: 0xFF, Data: read 1
byte). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
10.11.10 Select Endpoint (Command: 0x00 - 0x09 Data:
read 1 byte (optional)) . . . . . . . . . . . . . . . . . 159
10.11.11 Select Endpoint/Clear Interrupt (Command:
0x40 - 0x47, Data: read 1 byte) . . . . . . . . . . 160
10.11.12 Set Endpoint Status (Command: 0x40 - 0x49,
Data: write 1 byte (optional)) . . . . . . . . . . . . 161
10.11.13 Clear Buffer (Command: 0xF2, Data: read 1 byte
(optional)). . . . . . . . . . . . . . . . . . . . . . . . . . . 161
10.11.14 Validate Buffer (Command: 0xFA, Data:
none) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
10.12 USB device controller initialization. . . . . . . 162
10.12.1 USB clock configuration. . . . . . . . . . . . . . . . 162
10.12.2 USB device controller initialization. . . . . . . . 163
10.13 Functional description . . . . . . . . . . . . . . . . . 163
10.13.1 Data flow from the Host to the Device . . . . . 163
10.13.2 Data flow from the Device to the Host . . . . . 164
10.13.3 Interrupt based transfer . . . . . . . . . . . . . . . . 164
10.13.4 Isochronous transfer . . . . . . . . . . . . . . . . . . 164
10.13.5 Automatic stall feature . . . . . . . . . . . . . . . . . 165
10.14 Double-buffered endpoint operation. . . . . . 165
10.14.1 Bulk endpoints . . . . . . . . . . . . . . . . . . . . . . . 165
10.14.2 Isochronous endpoints. . . . . . . . . . . . . . . . . 167
Chapter 11: LPC13xx USB on-chip drivers
11.1 How to read this chapter. . . . . . . . . . . . . . . . 168
11.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . 168
11.3 USB driver functions. . . . . . . . . . . . . . . . . . . 168
11.3.1 Clock and pin initialization . . . . . . . . . . . . . . 168
11.3.2 USB initialization. . . . . . . . . . . . . . . . . . . . . . 169
11.3.3 USB connect. . . . . . . . . . . . . . . . . . . . . . . . . 169
11.3.4 USB interrupt handler. . . . . . . . . . . . . . . . . . 169
11.4 Calling the USB device driver. . . . . . . . . . . . 169
11.4.1 USB mass storage driver . . . . . . . . . . . . . . . 170
11.4.2 USB human interface driver . . . . . . . . . . . . . 171
11.5 USB driver structure definitions. . . . . . . . . . 172
11.5.1 ROM driver table. . . . . . . . . . . . . . . . . . . . . . 172
11.5.2 USB driver table . . . . . . . . . . . . . . . . . . . . . . 172
11.5.3 USB device information . . . . . . . . . . . . . . . . 172
11.5.4 Mass storage device information . . . . . . . . . 173
11.5.5 Human interface device information . . . . . . 174
11.6 USB descriptors . . . . . . . . . . . . . . . . . . . . . . 175
11.6.1 Standard descriptor . . . . . . . . . . . . . . . . . . . 175
11.6.2 Mass storage configuration, interface, and
endpoint descriptors. . . . . . . . . . . . . . . . . . . 176
11.6.3 HID configuration, interface, class, endpoint, and
report descriptor. . . . . . . . . . . . . . . . . . . . . . 176
11.6.4 Example descriptors . . . . . . . . . . . . . . . . . . 178
Example HID descriptor. . . . . . . . . . . . . . . . . 178
Example MSC descriptor . . . . . . . . . . . . . . . . 179
Chapter 12: LPC13xx UART
12.1 How to read this chapter. . . . . . . . . . . . . . . . 180
12.2 Basic configuration . . . . . . . . . . . . . . . . . . . . 180
12.3 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180
12.4 Pin description . . . . . . . . . . . . . . . . . . . . . . . 180