⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 usb_standard_desc.lst

📁 非常全的nrf2401设计资料
💻 LST
字号:
C51 COMPILER V7.50   USB_STANDARD_DESC                                                     04/09/2009 10:12:52 PAGE 1   


C51 COMPILER V7.50, COMPILATION OF MODULE USB_STANDARD_DESC
OBJECT MODULE PLACED IN .\build\usb_standard_desc.obj
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE usb_standard_desc.c LARGE OMF2 OPTIMIZE(9,SPEED) BROWSE INCDIR(..\common;..
                    -\..\..\..\comp\protocol\wdp\common\;..\..\..\..\comp\protocol\wdp\host\;..\..\..\..\arch\hal\include;..\..\..\..\arch\ha
                    -l\nrf24lu1;..\..\..\..\arch\nrf24lu1;..\common;..\..\..\..\comp\protocol\fap) DEBUG PRINT(.\lst\usb_standard_desc.lst) O
                    -BJECT(.\build\usb_standard_desc.obj)

line level    source

   1          /* Copyright (c) 2007 Nordic Semiconductor. All Rights Reserved.
   2           *
   3           * The information contained herein is confidential property of 
   4           * Nordic Semiconductor. The use, copying, transfer or disclosure 
   5           * of such information is prohibited except by express written
   6           * agreement with Nordic Semiconductor.
   7           */
   8          
   9          /** @file
  10           * USB device descriptor and USB HID configuration descriptior.
  11           */
  12          
  13          /** @{
  14           * @ingroup nordic_usb
  15           */
  16          
  17          
  18          #include "usb_desc.h"
  19          #include "nordic_common.h"
  20          
  21          #define MAX_PACKET_SIZE_EP0  32
  22          
  23          #define EP1_PACKET_SIZE 0x00a
  24          #define EP2_PACKET_SIZE 0x00a
  25          #define EP3_PACKET_SIZE 0x00a
  26          
  27          code const hal_usb_dev_desc_t g_usb_dev_desc =
  28          {
  29            sizeof(hal_usb_dev_desc_t),                // bLength
  30            0x01,                               // bDescriptorType
  31            SWAP(0x0200),                             // bcdUSB
  32            0x00,                               // bDeviceClass
  33            0x00,                               // bDeviceSubClass
  34            0x00,                               // bDeviceProtocol
  35            MAX_PACKET_SIZE_EP0,                // bMaxPacketSize0
  36            SWAP(VID),                          // idVendor (Nordic )
  37            SWAP(PID),                          // idProduct (dongle)
  38            SWAP(0x0100),                             // bcdDevice
  39            0x01,                               // iManufacturer
  40            0x02,                               // iProduct
  41            0x03,                               // iSerialNumber
  42            0x01                                // bNumConfigurations
  43          };
  44          
  45          // From "USB Device Class Definition for Human Interface Devices (HID)".
  46          // Section 7.1:
  47          // "When a Get_Descriptor(Configuration) request is issued,
  48          // it returns the Configuration descriptor, all Interface descriptors,
  49          // all Endpoint descriptors, and the HID descriptor for each interface."
  50          code const usb_conf_desc_templ_t g_usb_conf_desc =
  51          {
  52            { // configuration_descriptor hid_configuration_descriptor
C51 COMPILER V7.50   USB_STANDARD_DESC                                                     04/09/2009 10:12:52 PAGE 2   

  53              sizeof(hal_usb_conf_desc_t),         // Length
  54              0x02,                               // Type                             
  55              SWAP(sizeof(usb_conf_desc_templ_t)),        // Totallength
  56              0x02,                               // NumInterfaces
  57              0x01,                               // bConfigurationValue
  58              0x00,                               // iConfiguration
  59              0xA0,                               // bmAttributes (0x80 + Remote Wakeup)
  60              0x32                                // MaxPower (in 2mA units) = 100 * 2mA
  61            },
  62            { // interface_descriptor hid_interface_descriptor    (MOUSE)
  63              sizeof(hal_usb_if_desc_t),             // Length
  64              0x04,                               // bDescriptorType
  65              0x00,                               // bInterfaceNumber
  66              0x00,                               // bAlternateSetting
  67              0x01,                               // bNumEndpoints
  68              0x03,                               // bInterfaceClass (3 = HID)
  69              0x01,                               // bInterfaceSubClass
  70              0x02,                               // bInterfaceProcotol(0=None, 1=Keyb, 2=Mouse)
  71              0x00                                // iInterface
  72            },
  73            { // class_descriptor hid_descriptor
  74              sizeof(hal_usb_hid_desc_t),             // Length
  75              0x21,                                       // bDescriptorType
  76              SWAP(0x0111),                                       // bcdHID
  77              0x00,                                       // bCountryCode
  78              0x01,                                       // bNumDescriptors
  79              0x22,                                   // bDescriptorType
  80              SWAP(HID_REPORT_DESCRIPTOR_SIZE_MOUSE), // wItemLength (tot. len. of report
  81                                                      // descriptor)
  82            },
  83            { // endpoint_descriptor hid_endpoint_in_descriptor
  84              sizeof(hal_usb_ep_desc_t),          // Length
  85              0x05,                               // bDescriptorType
  86              0x81,                               // bEndpointAddress
  87              0x03,                               // bmAttributes
  88              SWAP(EP1_PACKET_SIZE),              // MaxPacketSize (LITTLE ENDIAN)
  89              4                                   // bInterval
  90            },
  91            { // interface_descriptor hid_interface_descriptor    (KEYBOARD)
  92              sizeof(hal_usb_if_desc_t),        // Length
  93              0x04,                               // bDescriptorType
  94              0x01,                               // bInterfaceNumber
  95              0x00,                               // bAlternateSetting
  96              0x01,                               // bNumEndpoints
  97              0x03,                               // bInterfaceClass (3 = HID)
  98              0x01,                               // bInterfaceSubClass
  99              0x01,                               // bInterfaceProcotol(0=None, 1=Keyb, 2=Mouse)
 100              0x00                                // iInterface
 101            },
 102            { // class_descriptor hid_descriptor
 103              sizeof(hal_usb_hid_desc_t),          // Length
 104              0x21,                                   // bDescriptorType
 105              0x0111,                                 // bcdHID
 106              0x00,                                   // bCountryCode
 107              0x01,                                   // bNumDescriptors
 108              0x22,                               // bDescriptorType
 109              SWAP(HID_REPORT_DESCRIPTOR_SIZE_KEYB),   // wItemLength (tot. len. of report
 110                                                  // descriptor)
 111            },
 112            { // endpoint_descriptor hid_endpoint_in_descriptor
 113              sizeof(hal_usb_ep_desc_t),              // Length
 114              0x05,                               // bDescriptorType
C51 COMPILER V7.50   USB_STANDARD_DESC                                                     04/09/2009 10:12:52 PAGE 3   

 115              0x82,                               // bEndpointAddress
 116              0x03,                               // bmAttributes
 117              SWAP(EP2_PACKET_SIZE),              // MaxPacketSize (LITTLE ENDIAN)
 118              10                                  // bInterval
 119            },
 120          #if 0
                { // interface_descriptor hid_interface_descriptor    (REMOTE CONTROL)
                  sizeof(hal_usb_if_desc_t),          // Length
                  0x04,                               // bDescriptorType
                  0x02,                               // bInterfaceNumber
                  0x00,                               // bAlternateSetting
                  0x01,                               // bNumEndpoints
                  0x03,                               // bInterfaceClass (3 = HID)
                  0x00,                               // bInterfaceSubClass
                  0x00,                               // bInterfaceProcotol(0=None, 1=Keyb, 2=Mouse)
                  0x00                                // iInterface
                },
                { // class_descriptor hid_descriptor
                  sizeof(hal_usb_hid_desc_t),          // Length
                  0x21,                                   // bDescriptorType
                  SWAP(0x0111),                           // bcdHID
                  0x00,                                   // bCountryCode
                  0x01,                                   // bNumDescriptors
                  0x22,                               // bDescriptorType
                  SWAP(HID_REPORT_DESCRIPTOR_SIZE_RC),// wItemLength (tot. len. of report
                                                      // descriptor)
                },
                { // endpoint_descriptor hid_endpoint_in_descriptor
                  sizeof(hal_usb_ep_desc_t),          // Length
                  0x05,                               // bDescriptorType
                  0x83,                               // bEndpointAddress
                  0x03,                               // bmAttributes
                  SWAP(EP3_PACKET_SIZE),              // MaxPacketSize (LITTLE ENDIAN)
                  10                                   // bInterval
                }
              #endif
 151          };
 152          
 153          #define USB_STRING_IDX_1_DESC "Nordic Semiconductor"
 154          #define USB_STRING_IDX_2_DESC "Nordic Semiconductor Wireless Desktop nRF24LU1 CX-1885"
 155          #define USB_STRING_IDX_3_DESC "CX-1870"
 156          
 157          code uint8_t g_usb_string_desc_1[] = {
 158              sizeof(USB_STRING_IDX_1_DESC) * 2, 
 159              0x03, 
 160              'N',00,
 161              'o',00,
 162              'r',00,
 163              'd',00,
 164              'i',00,
 165              'c',00,
 166              ' ',00,
 167              'S',00,
 168              'e',00,
 169              'm',00,
 170              'i',00,
 171              'c',00,
 172              'o',00,
 173              'n',00,
 174              'd',00,
 175              'u',00,
 176              'c',00,
C51 COMPILER V7.50   USB_STANDARD_DESC                                                     04/09/2009 10:12:52 PAGE 4   

 177              't',00,
 178              'o',00,
 179              'r', 00 
 180          };
 181          
 182          code uint8_t g_usb_string_desc_2[] = {
 183              sizeof(USB_STRING_IDX_2_DESC) * 2,
 184              0x03, 
 185              'N',00,
 186              'o',00,
 187              'r',00,
 188              'd',00,
 189              'i',00,
 190              'c',00,
 191              ' ',00,
 192              'S',00,
 193              'e',00,
 194              'm',00,
 195              'i',00,
 196              'c',00,
 197              'o',00,
 198              'n',00,
 199              'd',00,
 200              'u',00,
 201              'c',00,
 202              't',00,
 203              'o',00,
 204              'r',00, 
 205              ' ',00, 
 206              'W',00,
 207              'i',00,
 208              'r',00,
 209              'e',00,
 210              'l',00,
 211              'e',00,
 212              's',00,
 213              's',00,
 214              ' ',00, 
 215              'D',00,
 216              'e',00,
 217              's',00,
 218              'k',00,
 219              't',00,
 220              'o',00,
 221              'p',00,
 222              ' ',00,
 223              'n',00,
 224              'R',00,
 225              'F',00,
 226              '2',00,
 227              '4',00,
 228              'L',00,
 229              '0',00,
 230              '1',00,
 231              ' ',00, 
 232              'C',00,
 233              'X',00,
 234              '-',00,
 235              '1',00,
 236              '8',00,
 237              '8',00,
 238              '5',00,
C51 COMPILER V7.50   USB_STANDARD_DESC                                                     04/09/2009 10:12:52 PAGE 5   

 239          };
 240          
 241          code uint8_t g_usb_string_desc_3[] = {
 242              sizeof(USB_STRING_IDX_3_DESC) * 2,
 243              0x03, 
 244              'C',00,
 245              'X',00,
 246              '-',00,
 247              '1',00,
 248              '8',00,
 249              '8',00,
 250              '5',00,
 251          };
 252          
 253          code usb_string_desc_templ_t g_usb_string_desc = {
 254              g_usb_string_desc_1,
 255              g_usb_string_desc_2,
 256              g_usb_string_desc_3,
 257          };
 258          
 259          /** @} */


MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =   ----    ----
   CONSTANT SIZE    =    254    ----
   XDATA SIZE       =   ----    ----
   PDATA SIZE       =   ----    ----
   DATA SIZE        =   ----    ----
   IDATA SIZE       =   ----    ----
   BIT SIZE         =   ----    ----
   EDATA SIZE       =   ----    ----
   HDATA SIZE       =   ----    ----
   XDATA CONST SIZE =   ----    ----
   FAR CONST SIZE   =   ----    ----
END OF MODULE INFORMATION.


C51 COMPILATION COMPLETE.  0 WARNING(S),  0 ERROR(S)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -