• Main Page
  • Modules
  • Index
  • File List
  • Globals

projects/nrfgo_sdk/bootloader_32k/firmware/usb_desc_bootloader.c

Go to the documentation of this file.
00001 /* Copyright (c) 2009 Nordic Semiconductor. All Rights Reserved.
00002  *
00003  * The information contained herein is confidential property of Nordic 
00004  * Semiconductor ASA.Terms and conditions of usage are described in detail 
00005  * in NORDIC SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT. 
00006  *
00007  * Licensees are granted free, non-transferable use of the information. NO
00008  * WARRENTY of ANY KIND is provided. This heading must NOT be removed from
00009  * the file.
00010  *              
00011  * $LastChangedRevision: 133 $
00012  */
00013 
00018 #include "config.h"
00019 
00020 // Place all code and constants in this file in the segment "BOOTLOADER":
00021 #pragma userclass (code = BOOTLOADER)
00022 #pragma userclass (const = BOOTLOADER)
00023 
00025 #define SWAP(x) ((((x)&0xFF)<<8)|(((x)>>8)&0xFF))
00026 
00027 #include "usb_desc_bootloader.h"
00028 
00029 
00030 code usb_dev_desc_t g_usb_dev_desc = {
00031   sizeof(usb_dev_desc_t), 
00032   USB_DESC_DEVICE, 
00033   SWAP(0x0200),       // bcdUSB
00034   0xff,               // bDeviceClass
00035   0xff,               // bDeviceSubclass
00036   0xff,               // bDeviceProtocol
00037   MAX_PACKET_SIZE_EP0,// bMaxPAcketSize0
00038   SWAP(6421),         // idVendor - 6421 (0x1915) : Nordic Semiconductor ASA
00039   SWAP(0x0101),       // idProduct
00040   SWAP(0x0001),       // bcdDevice - Device Release Number (BCD)
00041   0x01,               // iManufacturer
00042   0x02,               // iProduct
00043   0x00,               // iSerialNumber
00044   0x01                // bNumConfigurations
00045 };
00046 
00047 code usb_conf_desc_bootloader_t g_usb_conf_desc = 
00048 {
00049     {
00050         sizeof(usb_conf_desc_t),
00051         USB_DESC_CONFIGURATION,
00052         SWAP(sizeof(usb_conf_desc_bootloader_t)),
00053         1,            // bNumInterfaces
00054         1,            // bConfigurationValue
00055         2,            // iConfiguration
00056         0xE0,         // bmAttributes - D6: self-powered, bus powered: 0xA0
00057         50,           // bMaxPower
00058     },
00059     /* Interface Descriptor 0 */ 
00060     {
00061         sizeof(usb_if_desc_t),
00062         USB_DESC_INTERFACE,
00063         0,            // bInterfaceNumber
00064         0,            // bAlternateSetting
00065         2,            // bNumEndpoints
00066         0xff,         // bInterfaceClass
00067         0x00,         // bInterfaceSubClass  
00068         0xff,         // bInterfaceProtocol 
00069         0x00,         // iInterface
00070     },
00071      /* Endpoint Descriptor EP1IN */
00072      {
00073         sizeof(usb_ep_desc_t),
00074         USB_DESC_ENDPOINT,
00075         0x81,                   // bEndpointAddress
00076         USB_ENDPOINT_TYPE_BULK, // bmAttributes
00077         SWAP(USB_EP1_SIZE),     // wMaxPacketSize
00078         0x06                    // bInterval
00079      },
00080      /* Endpoint Descriptor EP1OUT */
00081      {
00082         sizeof(usb_ep_desc_t),
00083         USB_DESC_ENDPOINT,
00084         0x01,                   // bEndpointAddress
00085         USB_ENDPOINT_TYPE_BULK, // bmAttributes
00086         SWAP(USB_EP1_SIZE),     // wMaxPacketSize
00087         0x06                    // bInterval
00088     },
00089 };
00090 
00091 #define USB_STRING_IDX_1_DESC "Nordic Semiconductor"
00092 
00093 code uint8_t g_usb_string_desc_1[] = 
00094 {
00095     sizeof(USB_STRING_IDX_1_DESC) * 2, 0x03,
00096     'N', 00,
00097     'o', 00,
00098     'r', 00,
00099     'd', 00,
00100     'i', 00,
00101     'c', 00,
00102     ' ', 00,
00103     'S', 00,
00104     'e', 00,
00105     'm', 00,
00106     'i', 00,
00107     'c', 00,
00108     'o', 00,
00109     'n', 00,
00110     'd', 00,
00111     'u', 00,
00112     'c', 00,
00113     't', 00,
00114     'o', 00,
00115     'r', 00 
00116 };
00117 
00118 #define USB_STRING_IDX_2_DESC "nRF24LU1P-F32 BOOT LDR"
00119 
00120 code uint8_t g_usb_string_desc_2[] = 
00121 {
00122     sizeof(USB_STRING_IDX_2_DESC) * 2, 0x03,
00123     'n', 00,
00124     'R', 00,
00125     'F', 00,
00126     '2', 00,
00127     '4', 00,
00128     'L', 00,
00129     'U', 00,
00130     '1', 00,
00131     'P', 00,
00132     '-', 00,
00133     'F', 00,
00134     '3', 00,
00135     '2', 00,
00136     ' ', 00,
00137     'B', 00,
00138     'O', 00,
00139     'O', 00,
00140     'T', 00,
00141     ' ', 00,
00142     'L', 00,
00143     'D', 00,
00144     'R', 00
00145 };
00146 
00147 // This is for setting language American English (String descriptor 0 is an array of supported languages):
00148 code uint8_t string_zero[] = {0x04, 0x03, 0x09, 0x04} ;

Generated on Fri Apr 20 2012 14:11:45 for nRFGo SDK by  doxygen 1.7.2