
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
168 of 368
11.1 How to read this chapter
The USB device controller is available on parts LPC1342 and LPC1343 only.
11.2 Introduction
The boot ROM contains a USB driver to simplify the USB application development. The
USB driver implements the Human Interface Device (HID) and the Mass Storage Device
(MSC) device class. Only one device function, either HID or MSC, can be used by the
application software. The USB enumeration and commands are handled by the boot ROM
code. The application software only needs to provide the callback functions to handle the
data sent or requested by the host.
11.3 USB driver functions
The following four functions of the USB driver software are exposed to the user
application:
1. Clock and pin initialization
2. USB initialization
3. USB connect
4. USB interrupt handler
11.3.1 Clock and pin initialization
This function configures the LPC134x assuming an external crystal with 12 MHz clock
frequency:
•
The system PLL is configured to output a 48 MHz clock.
•
The main clock is connected to the system PLL output, and the input to the USB clock
divider is connected to the main clock.
•
The USB bit in the AHB clock divider is set to 1.
•
The USB pins are connected to the USB block, and the USB PHY is enabled.
•
The USB clock divider is set to 1.
•
The USB PLL is enabled.
Calling this function is optional if application software implements an equivalent
initialization routine which includes setting up the USB clock to 48 MHz and connecting
USB_DM and USB_DP pins to the USB peripheral. After reset the USB_DM and USB_DP
pins are connected to the GPIO peripheral.
UM10375
Chapter 11: LPC13xx USB on-chip drivers
Rev. 3 — 14 June 2011
User manual