Hola.
Ok. El protocolo del USB tipo mouse es HID (Dispositivo de Interfaz Humana). Hay que usar los desciptores para el mouse.
const char USB_CLASS_SPECIFIC_DESC[] = {
0x05, 0x01, // usage page (generic desktop Choose the usage page "mouse" is on //0,1
0x09, 0x02, // usage (mouse) Device is a mouse //2,3
0xA1, 0x01, // collection (application) This collection encompasses the report format //4,5
0x09, 0x01, // usage (pointer) Choose the key code usage page //6,7
0xA1, 0x00, // collection (physical) Physical collection //8,9
0x05, 0x09, // usage page (buttons) Choose the “button” usage page //10,11
0x85, 0x01, //report id (1) //12, 13
0x19, 0x01, // usage minimum (1) There are three buttons //14,15
0x29, 0x03, // usage maximum (3) //16,17
0x15, 0x00, // logical minimum (0) Each button is represented by one bit //18,19
0x25, 0x01, // logical maximum (1) //20,21
0x95, 0x03, // report count (3) Three reports, one bit each //22,23
0x75, 0x01, // report size (1) //24, 25
0x81, 0x02, // input (data, variable, absolute) Defined bits above are data bits //26,27
0x95, 0x01, // report count (1) One report, five bits in length //28, 29
0x75, 0x05, // report size (5) //30, 31
0x81, 0x01, // input (constant) Bit stuff to fill byte //32, 33
0x05, 0x01, // usage page (generic desktop) Choose the usage pare “X” and “Y” are on //34, 35
0x09, 0x30, // usage (X) X direction of pointer //36, 37
0x09, 0x31, // usage (Y) Y direction of pointer //38, 39
0x09, 0x38 // usage (wheel) //40, 41
0x15, 0x81, // logical minimum (-127) Range of report data is -127 to 127 //42,43
0x25, 0x7F, // logical maximum (127) //44, 45
0x75, 0x08, // report size (8) Two reports, eight bits each //46, 47
0x95, 0x03, // report count (3) //48, 49
0x81, 0x06, // input (data, variable, absolute) Defined bits above are data bits //50, 51
0xC0, // end collection End physical collection //52
0xC0, // end collection End application collection //53
0x05, 0x01, //usage page (generic desktop) //54, 55
0x09, 0x06, //usage (keyboard) //56, 57
0xA1, 0x01, //collection (application) //58, 59
0x85, 0x02, //report id (2) //60, 61
0x05, 0x07, //usage page (key codes) //62, 63
0x19, 0xE0, //usage min (224) //64, 65
0x29, 0xE7, //usage max (231) //66, 67
0x15, 0x00, //logical min (0) //68, 69
0x25, 0x01, //logical max (1) //70, 71
0x75, 0x01, //report size (1) //72, 73
0x95, 0x08, //report count (8) //74, 75
0x81, 0x02, //input (data, variable, absolute) [modifier byte] //76, 77
0x95, 0x01, //report count (1) //78, 79
0x75, 0x08, //report size (8) //80, 81
0x81, 0x01, //input (constant) [reserved byte] //82, 83
0x95, 0x05, //report count (5) //84, 85
0x75, 0x01, //report size (1) //86, 87
0x05, 0x08, //usage page (page# for leds) //88, 89
0x19, 0x01, //usage min (1) //90, 91
0x29, 0x05, //usage max (5) //92, 93
0x91, 0x02, //output (data, var, abs) [led report] //94, 95
0x95, 0x01, //report count (1) //96, 97
0x75, 0x03, //report size (3) //98, 99
0x91, 0x01, //output (constant) [led report padding] //100, 101
0x95, 0x05, //report count (5) //102, 103
0x75, 0x08, //report size (8) //104, 105
0x15, 0x00, //logical min (0) //106, 107
0x25, 0x65, //logical max (101) //108, 109
0x05, 0x07, //usage page (key codes) //110, 111
0x19, 0x00, //usage min (0) //112, 113
0x29, 0x65, //usage max (101) //114, 115
0x81, 0x00, //input (data, array) //116, 117
0xC0 //end collection //118
};
Me imagino que es para controlar el puntero con la munequera no???? porque para el envio de datos me imagino que es por otro lado??? CDC podria ser o HID bulk???
Saludos.