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

📄 f3xx_usb0_descriptor.lst

📁 hid to rs232 usb_hid 转 串口程序
💻 LST
字号:
C51 COMPILER V8.17   F3XX_USB0_DESCRIPTOR                                                  03/18/2009 09:55:18 PAGE 1   


C51 COMPILER V8.17, 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 BROWSE DEBUG OBJECTEXTEND

line level    source

   1          //-----------------------------------------------------------------------------
   2          // F3xx_USB0_Descriptor.c
   3          //-----------------------------------------------------------------------------
   4          // Copyright 2008 Silicon Laboratories, Inc.
   5          // http://www.silabs.com
   6          //
   7          // Program Description:
   8          //
   9          // Stub file for Firmware Template.
  10          //
  11          //
  12          // How To Test:    See Readme.txt
  13          //
  14          //
  15          // FID             
  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:   HIDtoUART
  21          //
  22          // Release 1.0
  23          //    -Initial Revision (PD)
  24          //    -04 JUN 2008
  25          //
  26          //-----------------------------------------------------------------------------
  27          // Includes
  28          //-----------------------------------------------------------------------------
  29          #include "F3xx_USB0_Register.h"
  30          #include "F3xx_USB0_InterruptServiceRoutine.h"
  31          #include "F3xx_USB0_Descriptor.h"
  32          #include "F3xx_HIDtoUART.h"
  33          //-----------------------------------------------------------------------------
  34          // Descriptor Declarations
  35          //-----------------------------------------------------------------------------
  36          
  37          code const device_descriptor DEVICEDESC =
  38          {
  39             18,                                 // bLength
  40             0x01,                               // bDescriptorType
  41             0x1001,                             // bcdUSB
  42             0x00,                               // bDeviceClass
  43             0x00,                               // bDeviceSubClass
  44             0x00,                               // bDeviceProtocol
  45             EP0_PACKET_SIZE,                    // bMaxPacketSize0
  46             0xC410,                             // idVendor
  47             0x6884,                             // idProduct
  48             0x0000,                             // bcdDevice
  49             0x01,                               // iManufacturer
  50             0x02,                               // iProduct
  51             0x00,                               // iSerialNumber
  52             0x01                                // bNumConfigurations
  53          }; //end of DEVICEDESC
  54          
  55          // From "USB Device Class Definition for Human Interface Devices (HID)".
C51 COMPILER V8.17   F3XX_USB0_DESCRIPTOR                                                  03/18/2009 09:55:18 PAGE 2   

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

 118          
 119          
 120          // Comment in with report information and value entered for 
 121          // HID_REPORT_DESCRIPTOR_SIZE in F3xx_USB0_Descriptor.h
 122          
 123          code const hid_report_descriptor HIDREPORTDESC =
 124          {
 125              0x06, 0x00, 0xff,              // USAGE_PAGE (Vendor Defined Page 1)
 126              0x09, 0x01,                    // USAGE (Vendor Usage 1)
 127              0xa1, 0x01,                    // COLLECTION (Application)
 128          
 129              0x85, IN_CONTROL,              // Report ID
 130              0x95, IN_CONTROL_SIZE,         //   REPORT_COUNT ()
 131              0x75, 0x08,                    //   REPORT_SIZE (8)
 132              0x26, 0xff, 0x00,              //   LOGICAL_MAXIMUM (255)
 133              0x15, 0x00,                    //   LOGICAL_MINIMUM (0)
 134              0x09, 0x01,                    //   USAGE (Vendor Usage 1)
 135              0x81, 0x02,                    //   INPUT (Data,Var,Abs)
 136          
 137              0x85, OUT_CONTROL,             // Report ID
 138              0x95, OUT_CONTROL_SIZE,        //   REPORT_COUNT ()
 139              0x75, 0x08,                    //   REPORT_SIZE (8)
 140              0x26, 0xff, 0x00,              //   LOGICAL_MAXIMUM (255)
 141              0x15, 0x00,                    //   LOGICAL_MINIMUM (0)
 142              0x09, 0x01,                    //   USAGE (Vendor Usage 1)
 143              0x91, 0x02,                    //   OUTPUT (Data,Var,Abs)
 144          
 145              0x85, IN_DATA,                 // Report ID
 146              0x95, IN_DATA_SIZE,            //   REPORT_COUNT ()
 147              0x75, 0x08,                    //   REPORT_SIZE (8)
 148              0x26, 0xff, 0x00,              //   LOGICAL_MAXIMUM (255)
 149              0x15, 0x00,                    //   LOGICAL_MINIMUM (0)
 150              0x09, 0x01,                    //   USAGE (Vendor Usage 1)
 151              0x81, 0x02,                    //   INPUT (Data,Var,Abs)
 152          
 153              0x85, OUT_DATA,                // Report ID
 154              0x95, OUT_DATA_SIZE,           //   REPORT_COUNT ()
 155              0x75, 0x08,                    //   REPORT_SIZE (8)
 156              0x26, 0xff, 0x00,              //   LOGICAL_MAXIMUM (255)
 157              0x15, 0x00,                    //   LOGICAL_MINIMUM (0)
 158              0x09, 0x01,                    //   USAGE (Vendor Usage 1)
 159              0x91, 0x02,                    //   OUTPUT (Data,Var,Abs)
 160          
 161              0xC0                           //   end Application Collection
 162          };
 163          
 164          #define STR0LEN 4
 165          
 166          code const unsigned char String0Desc [STR0LEN] =
 167          {
 168             STR0LEN, 0x03, 0x09, 0x04
 169          }; // End of String0Desc
 170          
 171          #define STR1LEN sizeof ("SAYES") * 2
 172          
 173          code const unsigned char String1Desc [STR1LEN] =
 174          {
 175             STR1LEN, 0x03,
 176             'S', 0,
 177             'A', 0,
 178             'Y', 0,
 179             'E', 0,
C51 COMPILER V8.17   F3XX_USB0_DESCRIPTOR                                                  03/18/2009 09:55:18 PAGE 4   

 180             'S', 0
 181          }; // End of String1Desc
 182          
 183          #define STR2LEN sizeof ("SAYESMED BLOOD") * 2
 184          
 185          code const unsigned char String2Desc [STR2LEN] =
 186          {
 187             STR2LEN, 0x03,
 188             'S', 0,
 189             'A', 0,
 190             'Y', 0,
 191             'E', 0,
 192             'S', 0,
 193             'M', 0,
 194             'E', 0,
 195             'D', 0,
 196             ' ', 0,
 197             'B', 0,
 198             'L', 0,
 199             'O', 0,
 200             'O', 0,
 201             'D', 0
 202          }; // End of String2Desc
 203          
 204          unsigned char* const STRINGDESCTABLE [] =
 205          {
 206             String0Desc,
 207             String1Desc,
 208             String2Desc
 209          };


MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =   ----    ----
   CONSTANT SIZE    =    173    ----
   XDATA SIZE       =   ----    ----
   PDATA SIZE       =   ----    ----
   DATA SIZE        =      9    ----
   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 + -