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

📄 f326_usb0_descriptor.lst

📁 基于F326单片机的RS232转USB程序
💻 LST
字号:
C51 COMPILER V7.50   F326_USB0_DESCRIPTOR                                                  12/29/2007 16:03:22 PAGE 1   


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

line level    source

   1          //-----------------------------------------------------------------------------
   2          // F326_USB0_Descriptor.c
   3          //-----------------------------------------------------------------------------
   4          //
   5          // Source file for USB firmware. Includes descriptor data.
   6          //
   7          
   8          #include "F326_USB0_Register.h"
   9          #include "F326_USB0_Descriptor.h"
  10          #include "F326_USB0_InterruptServiceRoutine.h"
  11          
  12          //-----------------------------------------------------------------------------
  13          // Descriptor Declarations
  14          //-----------------------------------------------------------------------------
  15          
  16          code const device_descriptor DEVICEDESC =
  17          {
  18             0x12,                               // bLength
  19             0x01,                               // bDescriptorType
  20             0x1001,                             // bcdUSB
  21             0x00,                               // bDeviceClass
  22             0x00,                               // bDeviceSubClass
  23             0x00,                               // bDeviceProtocol
  24             EP0_PACKET_SIZE,                    // bMaxPacketSize0
  25             0x5A59,                             // idVendor
  26             0x0100,                             // idProduct
  27             0x0000,                             // bcdDevice
  28             0x01,                               // iManufacturer
  29             0x02,                               // iProduct
  30             0x00,                               // iSerialNumber
  31             0x01                                // bNumConfigurations
  32          }; //end of DEVICEDESC
  33          
  34          // From "USB Device Class Definition for Human Interface Devices (HID)".
  35          // Section 7.1:
  36          // "When a Get_Descriptor(Configuration) request is issued,
  37          // it returns the Configuration descriptor, all Interface descriptors,
  38          // all Endpoint descriptors, and the HID descriptor for each interface."
  39          code const hid_configuration_descriptor HIDCONFIGDESC =
  40          {
  41          
  42          { // configuration_descriptor hid_configuration_descriptor
  43             0x09,                               // Length
  44             0x02,                               // Type
  45             0x2200,                             // Totallength (= 9+9+9+7)
  46             0x01,                               // NumInterfaces
  47             0x01,                               // bConfigurationValue
  48             0x00,                               // iConfiguration
  49             0xA0,                               // bmAttributes
  50             0xFA                                // MaxPower (in 2mA units)
  51          },
  52          
  53          { // interface_descriptor hid_interface_descriptor
  54             0x09,                               // bLength
  55             0x04,                               // bDescriptorType
C51 COMPILER V7.50   F326_USB0_DESCRIPTOR                                                  12/29/2007 16:03:22 PAGE 2   

  56             0x00,                               // bInterfaceNumber
  57             0x00,                               // bAlternateSetting
  58             0x01,                               // bNumEndpoints
  59             0x03,                               // bInterfaceClass (3 = HID)
  60             0x01,                               // bInterfaceSubClass
  61             0x02,                               // bInterfaceProcotol
  62             0x00                                // iInterface
  63          },
  64          
  65          { // class_descriptor hid_descriptor
  66                  0x09,                              // bLength
  67                  0x21,                              // bDescriptorType
  68                  0x0101,                            // bcdHID
  69                  0x00,                              // bCountryCode
  70                  0x01,                              // bNumDescriptors
  71                  0x22,                              // bDescriptorType
  72                  HID_REPORT_DESCRIPTOR_SIZE_LE      // wItemLength (tot. len. of report
  73                                                 // descriptor)
  74          },
  75          
  76          // IN endpoint (mandatory for HID)
  77          { // endpoint_descriptor hid_endpoint_in_descriptor
  78             0x07,                               // bLength
  79             0x05,                               // bDescriptorType
  80             0x81,                               // bEndpointAddress
  81             0x03,                               // bmAttributes
  82             EP1_PACKET_SIZE_LE,                 // MaxPacketSize (LITTLE ENDIAN)
  83             10                                  // bInterval
  84          },
  85          
  86          // OUT endpoint (optional for HID)
  87          { // endpoint_descriptor hid_endpoint_out_descriptor
  88             0x07,                               // bLength
  89             0x05,                               // bDescriptorType
  90             0x01,                               // bEndpointAddress
  91             0x03,                               // bmAttributes
  92             EP2_PACKET_SIZE_LE,                 // MaxPacketSize (LITTLE ENDIAN)
  93             10                                  // bInterval
  94          }
  95          
  96          };
  97          
  98          code const hid_report_descriptor HIDREPORTDESC =
  99          {
 100              0x05, 0x01,                        // Usage Page (Generic Desktop)
 101              0x09, 0x02,                        // Usage (Mouse)
 102              0xA1, 0x01,                        // Collection (Application)
 103              0x09, 0x01,                        //   Usage (Pointer)
 104              0xA1, 0x00,                        //   Collection (Physical)
 105              0x05, 0x09,                        //     Usage Page (Buttons)
 106              0x19, 0x01,                        //     Usage Minimum (01)
 107              0x29, 0x08,                        //     Usage Maximum (08)
 108              0x15, 0x00,                        //     Logical Minimum (0)
 109              0x25, 0x01,                        //     Logical Maximum (1)
 110              0x95, 0x08,                        //     Report Count (8)
 111              0x75, 0x01,                        //     Report Size (1)
 112              0x81, 0x02,                        //     Input (Data, Variable, Absolute)
 113          
 114          
 115              0x05, 0x01,                        //     Usage Page (Generic Desktop)
 116              0x09, 0x30,                        //     Usage (X)
 117              0x09, 0x31,                        //     Usage (Y)
C51 COMPILER V7.50   F326_USB0_DESCRIPTOR                                                  12/29/2007 16:03:22 PAGE 3   

 118              0x15, 0x00,                        //     Logical Minimum (0)
 119              0x27, 0xFF, 0xFF,0x00,0x00,        //     Logical Maximum (65535)
 120              0x75, 0x10,                        //     Report Size (16)
 121              0x95, 0x02,                        //     Report Count (2)
 122              0x81, 0x02,                        //     Input (Data, Variable, Absolute)
 123          
 124              0xC0,                              //     End Collection (Physical)
 125              0xC0                               //     End Collection (Application)
 126          };
 127          
 128          #define STR_LANGUAGE_LEN 4
 129          
 130          code const unsigned char LANGUAGE_ID [STR_LANGUAGE_LEN] =
 131          {
 132             STR_LANGUAGE_LEN, 0x03, 
 133             0x09, 0x04
 134          }; //end of LANGUAGE_ID
 135          
 136          #define STR_MANU_LEN sizeof ("Beijing IRTOUCHSYSTEMS Co.,LtD") * 2
 137          
 138          code const unsigned char ManufacturerString [STR_MANU_LEN] =
 139          {
 140             STR_MANU_LEN, 0x03,
 141             'B', 0,
 142             'e', 0,
 143             'i', 0,
 144             'j', 0,
 145             'i', 0,
 146             'n', 0,
 147             'g', 0,
 148             ' ', 0,
 149             'I', 0,
 150             'R', 0,
 151             'T', 0,
 152             'O', 0,
 153             'U', 0,
 154             'C', 0,
 155             'H', 0,
 156             'S', 0,
 157             'Y', 0,
 158             'S', 0,
 159             'T', 0,
 160             'E', 0,
 161             'M', 0,
 162             'S', 0,
 163             ' ', 0,
 164             'C', 0,
 165             'o', 0,
 166             '.', 0,
 167             ',', 0,
 168             'L', 0,
 169             't', 0,
 170             'D', 0
 171          
 172          }; // End of ManufacturerString
 173          
 174          #define STR_PROD_LEN sizeof ("Touch Screen") * 2
 175          
 176          code const unsigned char ProducterString [STR_PROD_LEN] =
 177          {
 178             STR_PROD_LEN, 0x03,
 179             'T', 0,
C51 COMPILER V7.50   F326_USB0_DESCRIPTOR                                                  12/29/2007 16:03:22 PAGE 4   

 180             'o', 0,
 181             'u', 0,
 182             'c', 0,
 183             'h', 0,
 184             ' ', 0,
 185             'S', 0,
 186             'c', 0,
 187             'r', 0,
 188             'e', 0,
 189             'e', 0,
 190             'n', 0
 191          }; // End of ProducterString
 192          
 193          unsigned char* code STRINGDESCTABLE [] =
 194          {
 195             LANGUAGE_ID,
 196             ManufacturerString,
 197             ProducterString
 198          };


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