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

📄 f3xx_usb0_descriptor.lst

📁 101259367USB_Mouse_Example.rar
💻 LST
字号:
C51 COMPILER V7.06   F3XX_USB0_DESCRIPTOR                                                  09/12/2006 16:12:58 PAGE 1   


C51 COMPILER V7.06, COMPILATION OF MODULE F3XX_USB0_DESCRIPTOR
OBJECT MODULE PLACED IN F3xx_USB0_Descriptor.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\c51.exe F3xx_USB0_Descriptor.c DB OE

stmt level    source

   1          //-----------------------------------------------------------------------------
   2          // F3xx_USB0_Descriptor.c
   3          //-----------------------------------------------------------------------------
   4          // Copyright 2005 Silicon Laboratories, Inc.
   5          // http://www.silabs.com
   6          //
   7          // Program Description:
   8          //
   9          // Source file for USB firmware. Includes descriptor data.
  10          //
  11          //
  12          // How To Test:    See Readme.txt
  13          //
  14          //
  15          // FID:            3XX000031
  16          // Target:         C8051F32x/C8051F340
  17          // Tool chain:     Keil C51 7.50 / Keil EVAL C51
  18          //                 Silicon Laboratories IDE version 2.6
  19          // Command Line:   See Readme.txt
  20          // Project Name:   F3xx_MouseExample
  21          //
  22          //
  23          // Release 1.3
  24          //    - Changes by PD, GP
  25          //    - Modified Descriptors
  26          //    - Changed name from USB_Descriptor.c
  27          //    - 07 December 2005
  28          // Release 1.0
  29          //    -Initial Revision (DM)
  30          //    -22 NOV 2002
  31          //
  32          //-----------------------------------------------------------------------------
  33          // Includes
  34          //-----------------------------------------------------------------------------
  35          #include "F3xx_USB0_Register.h"
  36          #include "F3xx_USB0_InterruptServiceRoutine.h"
  37          #include "F3xx_USB0_Descriptor.h"
  38          
  39          //-----------------------------------------------------------------------------
  40          // Descriptor Declarations
  41          //-----------------------------------------------------------------------------
  42          
  43          const device_descriptor DEVICEDESC =
  44          {
  45             18,                                 // bLength
  46             0x01,                               // bDescriptorType
  47             0x1001,                             // bcdUSB
  48             0x00,                               // bDeviceClass
  49             0x00,                               // bDeviceSubClass
  50             0x00,                               // bDeviceProtocol
  51             EP0_PACKET_SIZE,                    // bMaxPacketSize0
  52             0xC410,                             // idVendor
  53             0xB981,                             // idProduct
  54             0x0000,                             // bcdDevice
  55             0x01,                               // iManufacturer
C51 COMPILER V7.06   F3XX_USB0_DESCRIPTOR                                                  09/12/2006 16:12:58 PAGE 2   

  56             0x02,                               // iProduct
  57             0x00,                               // iSerialNumber
  58             0x01                                // bNumConfigurations
  59          }; //end of DEVICEDESC
  60          
  61          // From "USB Device Class Definition for Human Interface Devices (HID)".
  62          // Section 7.1:
  63          // "When a Get_Descriptor(Configuration) request is issued,
  64          // it returns the Configuration descriptor, all Interface descriptors,
  65          // all Endpoint descriptors, and the HID descriptor for each interface."
  66          const hid_configuration_descriptor HIDCONFIGDESC =
  67          {
  68          
  69          { // configuration_descriptor hid_configuration_descriptor
  70             0x09,                               // Length
  71             0x02,                               // Type
  72             0x2900,                             // Totallength (= 9+9+9+7+7)
  73             0x01,                               // NumInterfaces
  74             0x01,                               // bConfigurationValue
  75             0x00,                               // iConfiguration
  76             0x80,                               // bmAttributes
  77             0x20                                // MaxPower (in 2mA units)
  78          },
  79          
  80          { // interface_descriptor hid_interface_descriptor
  81             0x09,                               // bLength
  82             0x04,                               // bDescriptorType
  83             0x00,                               // bInterfaceNumber
  84             0x00,                               // bAlternateSetting
  85             0x02,                               // bNumEndpoints
  86             0x03,                               // bInterfaceClass (3 = HID)
  87             0x01,                               // bInterfaceSubClass
  88             0x02,                               // bInterfaceProcotol
  89             0x00                                // iInterface
  90          },
  91          
  92          { // class_descriptor hid_descriptor
  93                  0x09,                                 // bLength
  94                  0x21,                                 // bDescriptorType
  95                  0x0101,                            // bcdHID
  96                  0x00,                                 // bCountryCode
  97                  0x01,                                 // bNumDescriptors
  98                  0x22,                               // bDescriptorType
  99                  HID_REPORT_DESCRIPTOR_SIZE_LE       // wItemLength (tot. len. of report
 100                                                 // descriptor)
 101          },
 102          
 103          // IN endpoint (mandatory for HID)
 104          { // endpoint_descriptor hid_endpoint_in_descriptor
 105             0x07,                               // bLength
 106             0x05,                               // bDescriptorType
 107             0x81,                               // bEndpointAddress
 108             0x03,                               // bmAttributes
 109             EP1_PACKET_SIZE_LE,                 // MaxPacketSize (LITTLE ENDIAN)
 110             10                                  // bInterval
 111          },
 112          
 113          // OUT endpoint (optional for HID)
 114          { // endpoint_descriptor hid_endpoint_out_descriptor
 115             0x07,                               // bLength
 116             0x05,                               // bDescriptorType
 117             0x01,                               // bEndpointAddress
C51 COMPILER V7.06   F3XX_USB0_DESCRIPTOR                                                  09/12/2006 16:12:58 PAGE 3   

 118             0x03,                               // bmAttributes
 119             EP2_PACKET_SIZE_LE,                 // MaxPacketSize (LITTLE ENDIAN)
 120             10                                  // bInterval
 121          }
 122          
 123          };
 124          
 125          const hid_report_descriptor HIDREPORTDESC =
 126          {
 127                  0x06, 0x00, 0xFF,       // Usage page (vendor defined) 
 128                  0x09, 0x01,                     // Usage ID (vendor defined)
 129                  0xA1, 0x01,                     // Collection (application)
 130          
 131                  // The Input report
 132                  0x09, 0x03,             // Usage ID - vendor defined
 133                  0x15, 0x00,             // Logical Minimum (0)
 134                  0x26, 0xFF, 0x00,   // Logical Maximum (255)
 135                  0x75, 0x08,             // Report Size (8 bits)
 136                  0x95, 0x02,             // Report Count (2 fields)
 137                  0x81, 0x02,             // Input (Data, Variable, Absolute)  
 138          
 139                  // The Output report
 140                  0x09, 0x04,             // Usage ID - vendor defined
 141                  0x15, 0x00,             // Logical Minimum (0)
 142                  0x26, 0xFF, 0x00,   // Logical Maximum (255)
 143                  0x75, 0x08,             // Report Size (8 bits)
 144                  0x95, 0x02,             // Report Count (2 fields)
 145                  0x91, 0x02,             // Output (Data, Variable, Absolute)  
 146          
 147                  // The Feature report
 148                  0x09, 0x05,             // Usage ID - vendor defined
 149                  0x15, 0x00,             // Logical Minimum (0)
 150                  0x26, 0xFF, 0x00,   // Logical Maximum (255)
 151                  0x75, 0x08,                     // Report Size (8 bits)
 152                  0x95, 0x02,             // Report Count (2 fields)
 153                  0xB1, 0x02,             // Feature (Data, Variable, Absolute)  
 154          
 155                  0xC0                // end Application Collection
 156          
 157          /*
 158              0x05, 0x01,                        // Usage Page (Generic Desktop)
 159              0x09, 0x02,                        // Usage (Mouse)
 160              0xA1, 0x01,                        // Collection (Application)
 161              0x09, 0x01,                        //   Usage (Pointer)
 162              0xA1, 0x00,                        //   Collection (Physical)
 163              0x05, 0x09,                        //     Usage Page (Buttons)
 164              0x19, 0x01,                        //     Usage Minimum (01)
 165              0x29, 0x01,                        //     Usage Maximum (01)
 166              0x15, 0x00,                        //     Logical Minimum (0)
 167              0x25, 0x01,                        //     Logical Maximum (1)
 168              0x95, 0x01,                        //     Report Count (1)
 169              0x75, 0x01,                        //     Report Size (1)
 170              0x81, 0x02,                        //     Input (Data, Variable, Absolute)
 171              0x95, 0x01,                        //     Report Count (1)
 172              0x75, 0x07,                        //     Report Size (7)
 173              0x81, 0x01,                        //     Input (Constant) for padding
 174              0x05, 0x01,                        //     Usage Page (Generic Desktop)
 175              0x09, 0x30,                        //     Usage (X)
 176              0x09, 0x31,                        //     Usage (Y)
 177              0x15, 0x81,                        //     Logical Minimum (-127)
 178              0x25, 0x7F,                        //     Logical Maximum (127)
 179              0x75, 0x08,                        //     Report Size (8)
C51 COMPILER V7.06   F3XX_USB0_DESCRIPTOR                                                  09/12/2006 16:12:58 PAGE 4   

 180              0x95, 0x02,                        //     Report Count (2)
 181              0x81, 0x06,                        //     Input (Data, Variable, Relative)
 182              0xC0,                              //   End Collection (Physical)
 183              0xC0                               // End Collection (Application)
 184          */
 185          };
 186          
 187          #define STR0LEN 4
 188          
 189          code const unsigned char String0Desc [STR0LEN] =
 190          {
 191             STR0LEN, 0x03, 0x09, 0x04
 192          }; //end of String0Desc
 193          
 194          #define STR1LEN sizeof ("SILICON LABORATORIES") * 2
 195          
 196          code const unsigned char String1Desc [STR1LEN] =
 197          {
 198             STR1LEN, 0x03,
 199             'S', 0,
 200             'I', 0,
 201             'L', 0,
 202             'I', 0,
 203             'C', 0,
 204             'O', 0,
 205             'N', 0,
 206             ' ', 0,
 207             'L', 0,
 208             'A', 0,
 209             'B', 0,
 210             'O', 0,
 211             'R', 0,
 212             'A', 0,
 213             'T', 0,
 214             'O', 0,
 215             'R', 0,
 216             'I', 0,
 217             'E', 0,
 218             'S', 0
 219          }; //end of String1Desc
 220          
 221          #define STR2LEN sizeof ("C8051F320 Development Board") * 2
 222          
 223          code const unsigned char String2Desc [STR2LEN] =
 224          {
 225             STR2LEN, 0x03,
 226             'C', 0,
 227             '8', 0,
 228             '0', 0,
 229             '5', 0,
 230             '1', 0,
 231             'F', 0,
 232             '3', 0,
 233             'x', 0,
 234             'x', 0,
 235             ' ', 0,
 236             'D', 0,
 237             'e', 0,
 238             'v', 0,
 239             'e', 0,
 240             'l', 0,
 241             'o', 0,
C51 COMPILER V7.06   F3XX_USB0_DESCRIPTOR                                                  09/12/2006 16:12:58 PAGE 5   

 242             'p', 0,
 243             'm', 0,
 244             'e', 0,
 245             'n', 0,
 246             't', 0,
 247             ' ', 0,
 248             'B', 0,
 249             'o', 0,
 250             'a', 0,
 251             'r', 0,
 252             'd', 0
 253          }; //end of String2Desc
 254          
 255          unsigned char* const STRINGDESCTABLE [] =
 256          {
 257             String0Desc,
 258             String1Desc,
 259             String2Desc
 260          };


MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =   ----    ----
   CONSTANT SIZE    =    193    ----
   XDATA SIZE       =   ----    ----
   PDATA SIZE       =   ----    ----
   DATA SIZE        =     27    ----
   IDATA SIZE       =   ----    ----
   BIT SIZE         =   ----    ----
END OF MODULE INFORMATION.


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

⌨️ 快捷键说明

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