These are the examples provided for [[/users/frank26080115/libraries/LPC1700CMSIS_Lib/]] Note, the entire "program" is not compilable!

Committer:
frank26080115
Date:
Sun Mar 20 05:38:56 2011 +0000
Revision:
0:bf7b9fba3924

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
frank26080115 0:bf7b9fba3924 1 /*----------------------------------------------------------------------------
frank26080115 0:bf7b9fba3924 2 * U S B - K e r n e l
frank26080115 0:bf7b9fba3924 3 *----------------------------------------------------------------------------
frank26080115 0:bf7b9fba3924 4 * Name: USBDESC.C
frank26080115 0:bf7b9fba3924 5 * Purpose: USB Descriptors
frank26080115 0:bf7b9fba3924 6 * Version: V1.10
frank26080115 0:bf7b9fba3924 7 *----------------------------------------------------------------------------
frank26080115 0:bf7b9fba3924 8 * This software is supplied "AS IS" without any warranties, express,
frank26080115 0:bf7b9fba3924 9 * implied or statutory, including but not limited to the implied
frank26080115 0:bf7b9fba3924 10 * warranties of fitness for purpose, satisfactory quality and
frank26080115 0:bf7b9fba3924 11 * noninfringement. Keil extends you a royalty-free right to reproduce
frank26080115 0:bf7b9fba3924 12 * and distribute executable files created using this software for use
frank26080115 0:bf7b9fba3924 13 * on NXP Semiconductors LPC family microcontroller devices only. Nothing
frank26080115 0:bf7b9fba3924 14 * else gives you the right to use this software.
frank26080115 0:bf7b9fba3924 15 *
frank26080115 0:bf7b9fba3924 16 * Copyright (c) 2005-2009 Keil Software.
frank26080115 0:bf7b9fba3924 17 *---------------------------------------------------------------------------*/
frank26080115 0:bf7b9fba3924 18
frank26080115 0:bf7b9fba3924 19 #include "lpc_types.h"
frank26080115 0:bf7b9fba3924 20
frank26080115 0:bf7b9fba3924 21 #include "usb.h"
frank26080115 0:bf7b9fba3924 22 #include "msc.h"
frank26080115 0:bf7b9fba3924 23 #include "usbcfg.h"
frank26080115 0:bf7b9fba3924 24 #include "usbdesc.h"
frank26080115 0:bf7b9fba3924 25
frank26080115 0:bf7b9fba3924 26
frank26080115 0:bf7b9fba3924 27 /* USB Standard Device Descriptor */
frank26080115 0:bf7b9fba3924 28 const uint8_t USB_DeviceDescriptor[] = {
frank26080115 0:bf7b9fba3924 29 USB_DEVICE_DESC_SIZE, /* bLength */
frank26080115 0:bf7b9fba3924 30 USB_DEVICE_DESCRIPTOR_TYPE, /* bDescriptorType */
frank26080115 0:bf7b9fba3924 31 WBVAL(0x0200), /* 2.00 */ /* bcdUSB */
frank26080115 0:bf7b9fba3924 32 0x00, /* bDeviceClass */
frank26080115 0:bf7b9fba3924 33 0x00, /* bDeviceSubClass */
frank26080115 0:bf7b9fba3924 34 0x00, /* bDeviceProtocol */
frank26080115 0:bf7b9fba3924 35 USB_MAX_PACKET0, /* bMaxPacketSize0 */
frank26080115 0:bf7b9fba3924 36 WBVAL(0xC251), /* idVendor */
frank26080115 0:bf7b9fba3924 37 WBVAL(0x1303), /* idProduct */
frank26080115 0:bf7b9fba3924 38 WBVAL(0x0100), /* 1.00 */ /* bcdDevice */
frank26080115 0:bf7b9fba3924 39 0x04, /* iManufacturer */
frank26080115 0:bf7b9fba3924 40 0x20, /* iProduct */
frank26080115 0:bf7b9fba3924 41 0x48, /* iSerialNumber */
frank26080115 0:bf7b9fba3924 42 0x01 /* bNumConfigurations */
frank26080115 0:bf7b9fba3924 43 };
frank26080115 0:bf7b9fba3924 44
frank26080115 0:bf7b9fba3924 45 /* USB Configuration Descriptor */
frank26080115 0:bf7b9fba3924 46 /* All Descriptors (Configuration, Interface, Endpoint, Class, Vendor */
frank26080115 0:bf7b9fba3924 47 const uint8_t USB_ConfigDescriptor[] = {
frank26080115 0:bf7b9fba3924 48 /* Configuration 1 */
frank26080115 0:bf7b9fba3924 49 USB_CONFIGUARTION_DESC_SIZE, /* bDescriptorType */
frank26080115 0:bf7b9fba3924 50 USB_CONFIGURATION_DESCRIPTOR_TYPE, /* bDescriptorType */
frank26080115 0:bf7b9fba3924 51 WBVAL( /* wTotalLength */
frank26080115 0:bf7b9fba3924 52 1*USB_CONFIGUARTION_DESC_SIZE +
frank26080115 0:bf7b9fba3924 53 1*USB_INTERFACE_DESC_SIZE +
frank26080115 0:bf7b9fba3924 54 2*USB_ENDPOINT_DESC_SIZE
frank26080115 0:bf7b9fba3924 55 ),
frank26080115 0:bf7b9fba3924 56 0x01, /* bNumInterfaces */
frank26080115 0:bf7b9fba3924 57 0x01, /* bConfigurationValue */
frank26080115 0:bf7b9fba3924 58 0x00, /* iConfiguration */
frank26080115 0:bf7b9fba3924 59 USB_CONFIG_BUS_POWERED /*|*/ /* bmAttributes */
frank26080115 0:bf7b9fba3924 60 /*USB_CONFIG_REMOTE_WAKEUP*/,
frank26080115 0:bf7b9fba3924 61 USB_CONFIG_POWER_MA(100), /* bMaxPower */
frank26080115 0:bf7b9fba3924 62 /* Interface 0, Alternate Setting 0, MSC Class */
frank26080115 0:bf7b9fba3924 63 USB_INTERFACE_DESC_SIZE, /* bLength */
frank26080115 0:bf7b9fba3924 64 USB_INTERFACE_DESCRIPTOR_TYPE, /* bDescriptorType */
frank26080115 0:bf7b9fba3924 65 0x00, /* bInterfaceNumber */
frank26080115 0:bf7b9fba3924 66 0x00, /* bAlternateSetting */
frank26080115 0:bf7b9fba3924 67 0x02, /* bNumEndpoints */
frank26080115 0:bf7b9fba3924 68 USB_DEVICE_CLASS_STORAGE, /* bInterfaceClass */
frank26080115 0:bf7b9fba3924 69 MSC_SUBCLASS_SCSI, /* bInterfaceSubClass */
frank26080115 0:bf7b9fba3924 70 MSC_PROTOCOL_BULK_ONLY, /* bInterfaceProtocol */
frank26080115 0:bf7b9fba3924 71 0x62, /* iInterface */
frank26080115 0:bf7b9fba3924 72 /* Bulk In Endpoint */
frank26080115 0:bf7b9fba3924 73 USB_ENDPOINT_DESC_SIZE, /* bLength */
frank26080115 0:bf7b9fba3924 74 USB_ENDPOINT_DESCRIPTOR_TYPE, /* bDescriptorType */
frank26080115 0:bf7b9fba3924 75 USB_ENDPOINT_IN(2), /* bEndpointAddress */
frank26080115 0:bf7b9fba3924 76 USB_ENDPOINT_TYPE_BULK, /* bmAttributes */
frank26080115 0:bf7b9fba3924 77 WBVAL(0x0040), /* wMaxPacketSize */
frank26080115 0:bf7b9fba3924 78 0, /* bInterval */
frank26080115 0:bf7b9fba3924 79 /* Bulk Out Endpoint */
frank26080115 0:bf7b9fba3924 80 USB_ENDPOINT_DESC_SIZE, /* bLength */
frank26080115 0:bf7b9fba3924 81 USB_ENDPOINT_DESCRIPTOR_TYPE, /* bDescriptorType */
frank26080115 0:bf7b9fba3924 82 USB_ENDPOINT_OUT(2), /* bEndpointAddress */
frank26080115 0:bf7b9fba3924 83 USB_ENDPOINT_TYPE_BULK, /* bmAttributes */
frank26080115 0:bf7b9fba3924 84 WBVAL(0x0040), /* wMaxPacketSize */
frank26080115 0:bf7b9fba3924 85 0, /* bInterval */
frank26080115 0:bf7b9fba3924 86 /* Terminator */
frank26080115 0:bf7b9fba3924 87 0 /* bLength */
frank26080115 0:bf7b9fba3924 88 };
frank26080115 0:bf7b9fba3924 89
frank26080115 0:bf7b9fba3924 90 /* USB String Descriptor (optional) */
frank26080115 0:bf7b9fba3924 91 const uint8_t USB_StringDescriptor[] = {
frank26080115 0:bf7b9fba3924 92 /* Index 0x00: LANGID Codes */
frank26080115 0:bf7b9fba3924 93 0x04, /* bLength */
frank26080115 0:bf7b9fba3924 94 USB_STRING_DESCRIPTOR_TYPE, /* bDescriptorType */
frank26080115 0:bf7b9fba3924 95 WBVAL(0x0409), /* US English */ /* wLANGID */
frank26080115 0:bf7b9fba3924 96 /* Index 0x04: Manufacturer */
frank26080115 0:bf7b9fba3924 97 0x1C, /* bLength */
frank26080115 0:bf7b9fba3924 98 USB_STRING_DESCRIPTOR_TYPE, /* bDescriptorType */
frank26080115 0:bf7b9fba3924 99 'N',0,
frank26080115 0:bf7b9fba3924 100 'X',0,
frank26080115 0:bf7b9fba3924 101 'P',0,
frank26080115 0:bf7b9fba3924 102 ' ',0,
frank26080115 0:bf7b9fba3924 103 'S',0,
frank26080115 0:bf7b9fba3924 104 'e',0,
frank26080115 0:bf7b9fba3924 105 'm',0,
frank26080115 0:bf7b9fba3924 106 'i',0,
frank26080115 0:bf7b9fba3924 107 'c',0,
frank26080115 0:bf7b9fba3924 108 'o',0,
frank26080115 0:bf7b9fba3924 109 'n',0,
frank26080115 0:bf7b9fba3924 110 'd',0,
frank26080115 0:bf7b9fba3924 111 ' ',0,
frank26080115 0:bf7b9fba3924 112 /* Index 0x20: Product */
frank26080115 0:bf7b9fba3924 113 0x28, /* bLength */
frank26080115 0:bf7b9fba3924 114 USB_STRING_DESCRIPTOR_TYPE, /* bDescriptorType */
frank26080115 0:bf7b9fba3924 115 'N',0,
frank26080115 0:bf7b9fba3924 116 'X',0,
frank26080115 0:bf7b9fba3924 117 'P',0,
frank26080115 0:bf7b9fba3924 118 ' ',0,
frank26080115 0:bf7b9fba3924 119 'L',0,
frank26080115 0:bf7b9fba3924 120 'P',0,
frank26080115 0:bf7b9fba3924 121 'C',0,
frank26080115 0:bf7b9fba3924 122 '1',0,
frank26080115 0:bf7b9fba3924 123 '7',0,
frank26080115 0:bf7b9fba3924 124 'x',0,
frank26080115 0:bf7b9fba3924 125 'x',0,
frank26080115 0:bf7b9fba3924 126 ' ',0,
frank26080115 0:bf7b9fba3924 127 'M',0,
frank26080115 0:bf7b9fba3924 128 'e',0,
frank26080115 0:bf7b9fba3924 129 'm',0,
frank26080115 0:bf7b9fba3924 130 'o',0,
frank26080115 0:bf7b9fba3924 131 'r',0,
frank26080115 0:bf7b9fba3924 132 'y',0,
frank26080115 0:bf7b9fba3924 133 ' ',0,
frank26080115 0:bf7b9fba3924 134 /* Index 0x48: Serial Number */
frank26080115 0:bf7b9fba3924 135 0x1A, /* bLength */
frank26080115 0:bf7b9fba3924 136 USB_STRING_DESCRIPTOR_TYPE, /* bDescriptorType */
frank26080115 0:bf7b9fba3924 137 'D',0,
frank26080115 0:bf7b9fba3924 138 'E',0,
frank26080115 0:bf7b9fba3924 139 'M',0,
frank26080115 0:bf7b9fba3924 140 'O',0,
frank26080115 0:bf7b9fba3924 141 '0',0,
frank26080115 0:bf7b9fba3924 142 '0',0,
frank26080115 0:bf7b9fba3924 143 '0',0,
frank26080115 0:bf7b9fba3924 144 '0',0,
frank26080115 0:bf7b9fba3924 145 '0',0,
frank26080115 0:bf7b9fba3924 146 '0',0,
frank26080115 0:bf7b9fba3924 147 '0',0,
frank26080115 0:bf7b9fba3924 148 '0',0,
frank26080115 0:bf7b9fba3924 149 /* Index 0x62: Interface 0, Alternate Setting 0 */
frank26080115 0:bf7b9fba3924 150 0x0E, /* bLength */
frank26080115 0:bf7b9fba3924 151 USB_STRING_DESCRIPTOR_TYPE, /* bDescriptorType */
frank26080115 0:bf7b9fba3924 152 'M',0,
frank26080115 0:bf7b9fba3924 153 'e',0,
frank26080115 0:bf7b9fba3924 154 'm',0,
frank26080115 0:bf7b9fba3924 155 'o',0,
frank26080115 0:bf7b9fba3924 156 'r',0,
frank26080115 0:bf7b9fba3924 157 'y',0,
frank26080115 0:bf7b9fba3924 158 };