
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
170 of 368
NXP Semiconductors
UM10375
Chapter 11: LPC13xx USB on-chip drivers
11.4.1 USB mass storage driver
The following steps illustrate the USB mass storage driver usage. A complete example is
available in the LPC13xx code bundle.
1. Map the pointer to the on chip driver table:
ROM ** rom = (ROM **) 0x1fff1ff8;
2. Enable 32-bit timer 1 (CT32B1) and IOCONFIG block:
LPC_SYSCON->SYSAHBCLKCTRL |= (EN_TIMER32_1 | EN_IOCON);
3. Initialize USB clock and pins:
(*rom)->pUSBD->init_clk_pins();
4. Set up device type and information:
USB_DEV_INFO DeviceInfo;
MSC_DEVICE_INFO MscDevInfo;
MscDevInfo.idVendor = USB_VENDOR_ID;
MscDevInfo.idProduct = USB_PROD_ID;
MscDevInfo.bcdDevice = USB_DEVICE;
MscDevInfo.StrDescPtr = (uint32_t)&USB_StringDescriptor[0];
MscDevInfo.MSCInquiryStr = (uint32_t)&InquiryStr[0];
MscDevInfo.BlockSize = MSC_BlockSize;
MscDevInfo.BlockCount = MSC_BlockCount;
MscDevInfo.MemorySize = MSC_MemorySize;
MscDevInfo.MSC_Read = MSC_MemoryRead;
Fig 19. USB device driver pointer structure
Ptr to ROM Driver table
Ptr to Device Table 3
Ptr to USB Driver Table 1
Ptr to Device Table 2
Ptr to Device Table n
init_clk_pins
isr
connect
Ptr to Function 3
Ptr to Function 1
Ptr to Function 2
Ptr to Function n
USB Driver
Device 2
ROM Driver Table
0x1FFF 1FF8
init