Hi all,
Thanks for your contineous support from this site.
I want to detect my board as HID mouse when plugged to USB port of PC. For that I guess I need to write HID mouse driver.
I am using LPC2148 controller. Can i gett some reference code for it?
Thanks & Regards, Kamal
Hi Tsuneo,
Thanks for those documents.
I tried both the ways...
1. Changed all the descriptor tables as mentioned in the HID1_1.pdf like:
const U8 HID_ReportDescriptor[] = { 0x05,0x01, 0x09,0x02, 0xA1,0x01, 0x09,0x01, 0xA1,0x00, 0x05,0x09, 0x19,0x01, 0x29,0x03, 0x15,0x00, 0x25,0x01, 0x95,0x03, 0x75,0x01, 0x81,0x02, 0x95,0x01, 0x75,0x05, 0x81,0x01, 0x05,0x01, 0x09,0x30, 0x09,0x31, 0x15,0x81, 0x25,0x7F, 0x75,0x08, 0x95,0x02, 0x81,0x06, 0xC0, 0xC0 }; const U16 HID_ReportDescSize = sizeof(HID_ReportDescriptor); /* USB Standard Device Descriptor */ const U8 USB_DeviceDescriptor[] = { 0x12, 0x01, WBVAL(0x100), 0x00, 0x00, 0x00, 0x08, WBVAL(0xFFFF), WBVAL(0x0001), WBVAL(0x0100), 0x04, 0x0E, 0x30, 0x01 }; /* USB Configuration Descriptor */ /* All Descriptors (Configuration, Interface, Endpoint, Class, Vendor) */ const U8 USB_ConfigDescriptor[] = { /* Configuration 1 */ 0x09, 0x02, WBVAL(0x003), 0x02, 0x01, 0x00, 0xA0, 0x32, /* Interface 0, Alternate Setting 0, HID Class */ 0x09, 0x04, 0x01, 0x00, 0x01, 0x03, 0x01, 0x02, 0x00, /* HID Class Descriptor */ /* HID_DESC_OFFSET = 0x0012 */ 0x09, 0x21, WBVAL(0x101), 0x00, 0x01, 0x22, 0x32, /* Endpoint, HID Interrupt In */ 0x07, 0x05, 0x82, 0x03, WBVAL(0x0008), 0x0A, /* Terminator */ 0 /* bLength */ };
2. I kept the the other descriptor as it is and changed only Report, Interface, HID, Endpoint descriptor. String Descriptor remains the same. Both the ways windows could not detect the board as HID Mouse.
Am I missing something?
One more question, How should i send the mouse data to pc ? What should be its format?