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

📄 __usbdesc.c

📁 motorola jw32 usb 源码
💻 C
📖 第 1 页 / 共 2 页
字号:
//============================================================================
// File: UsbDesc.h
// Func: Device-, Configuration- and String-Descriptors for
//		 USB08 Demo Application (all const Data, placed in Flash-ROM)
// Ver.: 1.01
// Auth: (C)2000,2001 by Oliver Thamm, MCT Elektronikladen GbR
//       http://hc08web.de/usb08
// Rem.: View/Edit this File with TAB-Size=4
//============================================================================

#pragma CONST_SEG ConstData

//-----------------------------------------------------------------------------
//----------------------------------------------------------------------------
//mouse
const unsigned char  HidReportDesc0[] = {
0x05,0x01,  /* Usage Page (Generic Desktop)             */
0x09,0x02,  //    usage(vendor usage 2)
0xA1,0x01,  //*collection (application) */
0x09,0x01,  /* Usage (Consumer Control)                 */
0xA1,0x00,
0x05,0x09,  //    usage_page(button)
0x19,0x01,  //    usage_minimum(button 1)
0x29,0x07,  //    usage_maximum(button 7)
0x15,0x00,  /*logical minimum (0) */
0x25,0x01,  /*logical maximum (1) */
0x95,0x08,  //    report_count(8)
0x75,0x01,  /*report size (1) */
0x81,0x02,  //    input(data,var,abs)
/*
0x06,0x00,0xFF,
0x09,0x40,
0x95,0x02,  //report count
0x75,0x08,  //report size (8 bit)
0x15,0x81,  //logical minimum (-127)
0x25,0x7F,  //logical maximum (127)
0x81,0x02,  //    input(data,var,abs)
*/
0x05,0x01,  /* Usage Page (Generic Desktop)             */

0x09,0x30,  /*X*/
0x09,0x31,  /*Y*/
0x16,0x00,0x80, /*logical minimum (-32768) */
0x26,0xFF,0x7F, /*logical maximum (32767)  */
0x75,0x10,
0x95,0x02,  //report count
0x81,0x06,  /*variable data bit field with relative position*/

0x09,0x38,  /*wheel*/
0x15,0x81,  /*logical minimum (-127) */
0x25,0x7F,  /*logical maximum (127)  */
0x75,0x08,  //report size (8 bit)
0x95,0x01,  /*report count (1) */
0x81,0x06,  /*variable data bit field with relative position*/

0xC0,
0xC0,
};

const unsigned char HidReportDesc1[] =    //keyboard
{
   0x05, 0x01,  /* Usage Page (Generic Desktop)             */
   0x09, 0x06,  /* Usage (Keyboard)                         */
   0xA1, 0x01,  /* Collection (Application)                 */
   0x85, 0x01,//ID
   0x05, 0x07,  /*      Usage page (Key Codes)              */
   0x19, 0xE0,  /*      Usage minimum (224)                 */
   0x29, 0xE7,  /*      Usage maximum (231)                 */
   0x15, 0x00,  /*      Logical minimum (0)                 */
   0x25, 0x01,  /* 		Logical maximum (1)                 */
   0x75, 0x01,  /*      Report size (1)                     */
   0x95, 0x08,  /*      Report count (8)                    */
   0x81, 0x02,  /*      Input (data, variable, absolute)    */
   0x95, 0x01,  /*      Report count (5)                    */
   0x75, 0x08,  /*      Report size (8)                     */
   0x81, 0x01,  /*      Input (constant)                    */
   0x95, 0x05,  /*      Report count (5)                    */
   0x75, 0x01,  /*      Report size (1)                     */
   0x05, 0x08,  /*      Usage page (page# for LEDs)         */
   0x19, 0x01,  /*      Usage minimum (1)                   */
   0x29, 0x05,  /*      Usage maxmimum (5)                  */
   0x91, 0x02,  /*      Output (data, variable, absolute)   */
   0x95, 0x01,  /*      Report count (1)                    */
   0x75, 0x03,  /*      Report size (3)                     */
   0x91, 0x01,  /*      Output (constant)                   */
   0x95, 0x04,  /*      Report count (4)                    */
   0x75, 0x08,  /*      Report size (8)                     */
   0x15, 0x00,  /*      Logical minimum (0)                 */
   0x25, 0x6A,  /*      Logical maximum (106)               */
   0x05, 0x07,  /*      Usage page (key codes)              */
   0x19, 0x00,  /*      Usage minimum (0)                   */
   0x29, 0x6A,  /*      Usage maximum (106)                 */
   0x81, 0x00,  /*      Input (data, array)                 */
   0xC0,        /* end Collection                           */
//----------------------------------------------
   0x05,0x01,
   0x09,0x80,
   0xA1,0x01,   //*collection (application) */
   0x85,0x03,
   0x19,0x81,     //POWER UP
   0x29,0x83,     //POWER
   0x15,0x00,   /*logical minimum (0) */
   0x25,0x01,   /*logical maximum (1) */
   0x95,0x03,
   0x75,0x01,   /*report size (1) */
   0x81,0x02,   //    input(data,var,abs)
   0x95,0x01,   /*report count (1) */
   0x75,0x05,
   0x81,0x01,
   0xC0,
 //----------------------------------------------
   0x05,0x0c,     //consumer
   0x09,0x01,     //Consumer Control
   0xA1,0x01,     //*collection (application) */
   0x85,0x02,     //ID
   0x15,0x00,     /*logical minimum (0) */
   0x25,0x01,     /*logical maximum (1) */
   0x09,0xb5,     //next
   0x09,0xb6,     //Previous
   0x09,0xCD,     //Play/Pause
   0x09,0xE2,     //Mute
   0x09,0xE9,     //Volume Increment
   0x09,0xEA,     //Volume Decrement
   0x0A,0x94,0x01,//my computer
   0x0A,0x23,0x02,//Home(open IE)
   0x0A,0x27,0x02,//Refresh(刷新)
   0x0A,0x8A,0x01,//Email Reader
   0x0A,0x21,0x02,//Search
   0x1a,0x01,0x00, /*usage minimum (1) */
   0x2a,0x00,0x04, /*usage maximum (40) */
   0x95,0x0b,      /*report count (3) */
   0x75,0x01,      /*report size (1) */
   0x81,0x02,      /*input (x button bits) */
   0x95,0x01,      /*report count (1) */
   0x75,0x05,      /*report size  (5) */
   0x81,0x01,    	 /*input (constant x? bit padding) */
   0xC0 		       /* end collection, end collection */
};

//const hid_report_descriptor
const unsigned char HidReportDesc2[] =    //
{
    0x06,0x00,0xff, //usage page
	0x09,0x01,      /* Usage (Consumer Control)                 */
	0xA1,0x01,      /* Collection (Application)                 */
/*
	//input
	0x85,0x04,      // report id
	0x06,0x00,0xff, //usage page
	0x09,0x01,      //usage
	0x15,0,         // logical min
	0x26,0xff,0,    //logical max
	0x95,0x07,      //report count 15
	0x75,8,         //report size (8 bit)
	0x81,6,         //input (data, variable, absolute)

	// output
	0x85,0x05,      // report id
	0x06,0x00,0xff,
	0x09,0x01,      // Usage (Consumer Control)
	0x15,0,         // logical min
	0x26,0xff,0,    //logical max
	0x95,0x07,      //report count 15
	0x75,0x08,      //report size (8 bit)
	0x91,0x06,      //output (data, variable, absolute)
*/
 	//feature
	0x85,0x06,      // report id
	0x06,0x00,0xff, //usage page
	0x09,0x01,      //usage
	0x15,0,         // logical min
	0x26,0xff,0,    //logical max
	0x95,0x07,      //report count
	0x75,0x08,      //report size (8 bit)
	0xB1,0x06,      //feature (data, variable, absolute)

	0xc0,           /* end collection, end collection */
};

//data const hid_report_descriptor3
const unsigned char HidReportDesc3[] =   //joystick
{
    0x05,0x01,      //usage_page(generic desktop)
    0x09,0x04,      //usage (joystick)

    0xA1,0x01,      //collection(application)

    0x85,0x04,      // report id

    0xA1,0x02,      //  collection(logical)

    0x75,0x08,      //    report_size(8)
    0x95,0x05,      //    report_count(5)
    0x15,0x00,      //    logical_minimum(0)
    0x26,0xFF,0x00, //    logical_maximum(255)
    0x35,0x00,      //    physical_minimum(0)
    0x46,0xFF,0x00, //    phusical_maximum(255)
    0x09,0x32,      //    usage(Z)
    0x09,0x35,      //    usage(Rz)
    0x09,0x30,      //    usage(X)
    0x09,0x31,      //    usage(Y)
    0x09,0x00,      //    usage(undefined)
    0x81,0x02,      //    input(data,var,abs)

    0x75,0x04,      //    report_size(4)
    0x95,0x01,      //    report_count(1)
    0x25,0x07,      //    logical_maximum(7)
    0x46,0x3B,0x01, //    physical_maximum(315)
    0x65,0x14,      //    unit(eng rot:angular pos)
    0x09,0x39,      //    usage(hat switch)
    0x81,0x42,      //    input(data,var,abs,null)

    0x65,0x00,      //    unit(none)
    0x75,0x01,      //    report_size(1)
    0x95,0x0C,      //    report_count(12)
    0x25,0x01,      //    logical_maximum(1)
    0x45,0x01,      //    physical_maximum(1)
    0x05,0x09,      //    usage_page(button)
    0x19,0x01,      //    usage_minimum(button 1)
    0x29,0x0C,      //    usage_maximum(button 12)
    0x81,0x02,      //    input(data,var,abs)

    0x06,0x00,0xFF, //    usage_page(vendor defined page 1)
    0x75,0x01,      //    report_size(1)
    0x95,0x08,      //    report_count(8)
    0x25,0x01,      //    logical_maxmum(1)
    0x45,0x01,      //    physical_maxmum(1)
    0x09,0x01,      //    usage(vendor usage 1)
    0x81,0x02,      //    input(data,var,abs)

    0xC0,           //  end_collection

    0xA1,0x02,      //  collection(logical)

    0x75,0x08,      //    report_size(8)
    0x95,0x04,      //    report_count(4)
    0x46,0xFF,0x00, //    phusical_maximum(255)
    0x26,0xFF,0x00, //    logical_maximum(255)
    0x09,0x02,      //    usage(vendor usage 2)
    0x91,0x02,      //    output(data,var,abs)

    0xC0,           //  end_collection
    0xC0,           //end_collection

    0x05,0x01,      //usage_page(generic desktop)
    0x09,0x04,      //usage (joystick)

    0xA1,0x01,      //collection(application)

    0x85,0x05,      // report id

    0xA1,0x02,      //  collection(logical)

    0x75,0x08,      //    report_size(8)
    0x95,0x05,      //    report_count(5)
    0x15,0x00,      //    logical_minimum(0)
    0x26,0xFF,0x00, //    logical_maximum(255)
    0x35,0x00,      //    physical_minimum(0)
    0x46,0xFF,0x00, //    phusical_maximum(255)
    0x09,0x32,      //    usage(Z)
    0x09,0x35,      //    usage(Rz)
    0x09,0x30,      //    usage(X)
    0x09,0x31,      //    usage(Y)
    0x09,0x00,      //    usage(undefined)
    0x81,0x02,      //    input(data,var,abs)

    0x75,0x04,      //    report_size(4)
    0x95,0x01,      //    report_count(1)
    0x25,0x07,      //    logical_maximum(7)
    0x46,0x3B,0x01, //    physical_maximum(315)
    0x65,0x14,      //    unit(eng rot:angular pos)
    0x09,0x39,      //    usage(hat switch)
    0x81,0x42,      //    input(data,var,abs,null)

    0x65,0x00,      //    unit(none)
    0x75,0x01,      //    report_size(1)
    0x95,0x0C,      //    report_count(12)
    0x25,0x01,      //    logical_maximum(1)
    0x45,0x01,      //    physical_maximum(1)
    0x05,0x09,      //    usage_page(button)
    0x19,0x01,      //    usage_minimum(button 1)
    0x29,0x0C,      //    usage_maximum(button 12)
    0x81,0x02,      //    input(data,var,abs)

    0x06,0x00,0xFF, //    usage_page(vendor defined page 1)
    0x75,0x01,      //    report_size(1)
    0x95,0x08,      //    report_count(8)
    0x25,0x01,      //    logical_maxmum(1)
    0x45,0x01,      //    physical_maxmum(1)
    0x09,0x01,      //    usage(vendor usage 1)
    0x81,0x02,      //    input(data,var,abs)

⌨️ 快捷键说明

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