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

📄 des.h

📁 51单片机与SL811HST做从机的PS3手柄程序
💻 H
字号:
#define DEV_LEN  18
#define HID_LEN  9
#define CFG_LEN  41   //34
#define REP_LEN  148    //148

unsigned char  code   Dev_Descp[]={ DEV_LEN,     // bLength: Size of descriptor                  
                       0x01,        // bDescriptorType: Device                      
                       0x10,0x01,   // bcdUSB: USB 1.1                              
                       0x00,        // bDeviceClass: none                           
                       0x00,        // bDeviceSubClass: none                        
                       0x00,        // bDeviceProtocol: none                        
                       EP0_LEN,     // bMaxPacketSize0: 8/64 bytes                  
                       0x4c,0x05,   // idVendor: 0x1291                             
                       0x68,0x02,   //idProduct: 0x6522 - SL811S                    
                       0x00,0x01,   // bcdDevice: version 1.0                       
                       0x01,        // iManufacturer: haifan                        
                       0x02,        // iProduct: Cypress SL811S - HID Consumer Control
                       0x00,        // iSerialNumber: none                          
                       0x01};       // bNumConfigurations: 1                        
                                                 
unsigned char  code   Cfg_Descp[]={0x09,        // bLength: Size of descriptor                  
                       0x02,        // bDescriptorType: Configuration               
                       CFG_LEN,0x00,// wTotalLength: Cfg+Ifc+Class+Ep = 3           4 bytes
                       0x01,        // bNumInterfaces: 1 interface                  
                       0x01,        // bConfigurationValue: 1                       
                       0x00,        // iConfiguration: none                         
                       0x80,        // bmAttributes: bus-powered, remote-           wakeup
                       0xfa,        // MaxPower: 100mA                              
                                                                          
                       0x09,        // bLength: Size of descriptor                  
                       0x04,        // bDescriptorType: Interface                   
                       0x00,        // bInterfaceNumber: #0                         
                       0x00,        // bAlternateSetting: #0                        
                       0x02,        // bNumEndpoints: 1                             
                       0x03,        // bInterfaceClass: HID-class                   
                       0x00,        // bInterfaceSubClass: none                     
                       0x00,        // bInterfaceProtocol: none                     
                       0x00,        // iInterface: none                             
                                                                         
                       0x09,        // bLength: Size of descriptor                  
                       0x21,        // bDescriptorType: HID Class                   
                       0x11,0x01,      //0x00,0x01,   // bcdHID: HID Class version 1.1                
                       0x00,        // bCountryCode: none                           
                       0x01,        // bNumDescriptors: 1 report descp              
                       0x22,        // bDescriptorType: report descriptor            type
                       REP_LEN,0x00,// wDescriptorLength: 31 bytes                  
                                                                         
                       0x07,        // bLength: Size of descriptor                  
                       0x05,        // bDescriptorType: Endpoint                    
                       0x02,        // bEndpointAddress: IN, EP1                    
                       0x03,        // bmAttributes: Interrupt                      
                       EP2_LEN,0x00,// wMaxPacketSize:                              
                       0x01,         // bInterval: 10ms 

                       0x07,        // bLength: Size of descriptor                  
                       0x05,        // bDescriptorType: Endpoint                    
                       0x81,        // bEndpointAddress: IN, EP1                    
                       0x03,        // bmAttributes: Interrupt                      
                       EP1_LEN,0x00,// wMaxPacketSize:                              
                       0x01,
                              };                                   
                                                  
 unsigned char code   Rep_Descp[]={0x05, 0x01,  // USAGE_PAGE (Consumer Devices)                
		       0x09, 0x04,  // USAGE (Consumer Control)                     
		       0xA1, 0x01,  // COLLECTION (Application)                     
		       0xA1, 0x02,
               0x85, 0x01,
               0x75, 0x08,
               0x95, 0x01,  
               0x15, 0x00,  //  LOGICAL_MINIMUM (0)                         
		       0x26, 0xff, 0x00,  //  LOGICAL_MAXIMUM (1) 
               0x81, 0x03,
               0x75, 0x01,
               0x95, 0x13, 
               0x15, 0x00,   
		       0x25, 0x01,  //    USAGE (Mute)	// 	 MultiMed       ia Audio Control
		       0x35, 0x00,
               0x45, 0x01,  //    USAGE (Volume Up)                         
		       0x05, 0x09,  //    USAGE (Volume Down)                       
		       0x19, 0x01,  //    USAGE (Play/Pause)                        
		       0x29, 0x13,  //    USAGE (Stop)                              
		       0x81, 0x02,  //    USAGE (Scan Previous Track)               
		       0x75, 0x01,  //    USAGE (Scan Next Track)                   
		       0x95, 0x0d,  //    USAGE (Bass Boost)								
		       0x06, 0x00,0xff,	        //    USAGE (AC Search)	// 	 Internet Application Control
		       0x81, 0x03, 	//    USAGE (AC Home)
		       0x15, 0x00, 	//    USAGE (AC Back)
		       0x26, 0xff, 0x00,	//    USAGE (AC Forward)
		       0x05, 0x01, 	//    USAGE (AC Stop)
		       0x09, 0x01, 	//    USAGE (AC Refresh)
		       0xa1, 0x00, 	//    USAGE (AC Favorites/Bookmark)
               0x75, 0x08,      	//  REPORT_SIZE (1)
		       0x95, 0x04, 		    //  REPORT_COUNT (16)
               0x35, 0x00,
               0x46, 0xff,0x00,
               0x09, 0x30,
               0x09, 0x31,
               0x09, 0x32,
               0x09, 0x35,
		       0x81, 0x02,	  	    //  INPUT (Data,Var,Rel,Prf)
		       0xC0,
               0x05, 0x01, 	//    USAGE (AC Stop)
	           0x75, 0x08,      	//  REPORT_SIZE (1)
		       0x95, 0x27, 		    //  REPORT_COUNT (16)
               0x09, 0x01,
               0x81, 0x02,
               0x75, 0x08,
               0x95, 0x30,
               0x09, 0x01,
               0x91, 0x02,
               0x75, 0x08,
		       0x95, 0x30,	  	    //  INPUT (Data,Var,Rel,Prf)
		       0x09, 0x01,
               0xb1, 0x02,
               0xC0,  
               0xa1, 0x02,
               0x85, 0x02,  
               0x75, 0x08,
		       0x95, 0x30,	  	    //  INPUT (Data,Var,Rel,Prf)
		       0x09, 0x01,
               0xb1, 0x02,
               0xC0, 
               0xa1, 0x02,
               0x85, 0xee,  
               0x75, 0x08,
		       0x95, 0x30,	  	    //  INPUT (Data,Var,Rel,Prf)
		       0x09, 0x01,
               0xb1, 0x02,
               0xC0, 
               0xa1, 0x02,
               0x85, 0xef,  
               0x75, 0x08,
		       0x95, 0x30,	  	    //  INPUT (Data,Var,Rel,Prf)
		       0x09, 0x01,
               0xb1, 0x02,
               0xC0, 
               0xC0};		        // END_COLLECTION
                     
unsigned char  code     LangString[]={0x04,0x03,0x09,0x04};
unsigned char  code     MfgString[] ={0x10,0x03,'H',0,'a',0,'i',0,' ',0,'F',0,'a',0,'n',0};                        
unsigned char  code    ProdString[]={0x34,0x03,'P',0,'L',0,'A',0,'Y',0,'S',0,'T',0,'A',0,'T',0,'I',0,'O',0,'N',0,' ',0,'R',0,'3',0,' ',0,
                                     'C',0,'o',0,'n',0,'t',0,'r',0,'o',0,'l',0,'l',0,'e',0,'r',0}; 
 /*                    
 unsigned char  code   Rep_Descp[]={0x05, 0x0C,  // USAGE_PAGE (Consumer Devices)                
		       0x09, 0x01,  // USAGE (Consumer Control)                     
		       0xA1, 0x01,  // COLLECTION (Application)                     
		       0x15, 0x00,  //  LOGICAL_MINIMUM (0)                         
		       0x25, 0x01,  //  LOGICAL_MAXIMUM (1)                         
		       0x09, 0xE2,  //    USAGE (Mute)	// 	 MultiMed       ia Audio Control
		       0x09, 0xE9,  //    USAGE (Volume Up)                         
		       0x09, 0xEA,  //    USAGE (Volume Down)                       
		       0x09, 0xCD,  //    USAGE (Play/Pause)                        
		       0x09, 0xB7,  //    USAGE (Stop)                              
		       0x09, 0xB6,  //    USAGE (Scan Previous Track)               
		       0x09, 0xB5,  //    USAGE (Scan Next Track)                   
		       0x09, 0xE5,  //    USAGE (Bass Boost)								
		       0x0A, 0x21,0x02,	        //    USAGE (AC Search)	// 	 Internet Application Control
		       0x0A, 0x23, 0x02,	//    USAGE (AC Home)
		       0x0A, 0x24, 0x02,	//    USAGE (AC Back)
		       0x0A, 0x25, 0x02,	//    USAGE (AC Forward)
		       0x0A, 0x26, 0x02,	//    USAGE (AC Stop)
		       0x0A, 0x27, 0x02,	//    USAGE (AC Refresh)
		       0x0A, 0x2A, 0x02,	//    USAGE (AC Favorites/Bookmark)
		       0x0A, 0x8A, 0x01,	//    USAGE (AL Email Reader)
		       0x75, 0x01,      	//  REPORT_SIZE (1)
		       0x95, 0x10, 		    //  REPORT_COUNT (16)
		       0x81, 0x06,	  	    //  INPUT (Data,Var,Rel,Prf)
		       0xC0};     
              */      

⌨️ 快捷键说明

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