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

📄 descrpt.bak

📁 USB9602 source code for C 8051
💻 BAK
字号:
/*SINGLE HID INTERFACE*/

/*for now the sizes and offsets below need to be hand calculated,     */
/*until I can find a better way to do it                              */
/*for multiple byte values, LSB goes first                            */
xdata const unsigned char DEV_DESC[] = {DEV_LENGTH,        /*length of this desc.    */
                         DEVICE,            /*DEVICE descriptor       */
                         0x00,0x01,         /*spec rev level (BCD)    */
                         0x00,              /*device class            */
                         0x00,              /*device subclass         */
                         0x00,              /*device protocol         */
                         0x08,              /*max packet size         */
                         0x00,0x04,         /*National's vendor ID    */
                         0x5B,0xC3,         /*National's product ID   */
                         0x40,0x01,         /*National's revision ID  */
                         MFG_STR_OFS,       /*index of manuf. string  */
                         PID_STR_OFS,       /*index of prod.  string  */
                         0,                 /*index of ser. # string  */
                         0x01               /*number of configs.      */
                         };

#ifdef  BUSPOWER
#define ATTRIBUTES 0x80                     /*bus  powered            */
#else
#define ATTRIBUTES 0x40                     /*self powered            */
#endif

xdat const unsigned char CFG_DESC[] = {CFG_LENGTH,        /*length of this desc.    */
                         CONFIGURATION,     /*CONFIGURATION descriptor*/
                         0x22,0x00,         /*total length returned   */
                         0x01,              /*number of interfaces    */
                         0x01,              /*number of this config   */
                         CFG_STR_OFS,       /*index of config. string */
                         ATTRIBUTES,        /*attr.: bus  powered     */
                         50,                /*max power (100 mA)      */
                         INT_LENGTH,        /*length of this desc.    */
                         INTERFACE,         /*INTERFACE descriptor    */
                         0x00,              /*interface number        */
                         0x00,              /*alternate setting       */
                         0x01,              /*# of (non 0) endpoints  */
                         HIDCLASS,          /*interface class         */
                         NOSUBCLASS,        /*interface subclass      */
                         0x00,              /*interface protocol      */
                         INT_STR_OFS,       /*index of intf. string   */

                         HID_LENGTH,        /*length of this desc.    */
                         HID,               /*HID descriptor          */
                         0x00,0x01,         /*HID spec rev level (BCD)*/
                         0x00,              /*target country          */
                         1,                 /*# HID class desc follow.*/
                         HIDREPORT,         /*report descr. type      */
                         RPT_DESC_SIZE,0x00, /*report descr. length   */

/*The WDM driver for this board references the endpoints by 'pipe'    */
/*number: 0, 1, 2 et al in order below:                               */

                       /*Pipe 0 (endpoint 5)                          */
                         END_LENGTH,        /*length of this desc.    */
                         ENDPOINT,          /*ENDPOINT descriptor     */
                         0x85,              /*address (IN)            */
                         0x03,              /*attributes  (INTERRUPT) */
                         0x40,0x00,         /*max packet size (64)    */
                         0xFF};             /*interval (ms)           */

⌨️ 快捷键说明

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