<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://forums.obdev.at/app.php/feed/topic/10611" />

	<title>Objective Development Forums</title>
	
	<link href="https://forums.obdev.at/index.php" />
	<updated>2016-11-07T05:06:27+02:00</updated>

	<author><name><![CDATA[Objective Development Forums]]></name></author>
	<id>https://forums.obdev.at/app.php/feed/topic/10611</id>

		<entry>
		<author><name><![CDATA[ulao]]></name></author>
		<updated>2016-11-07T05:06:27+02:00</updated>

		<published>2016-11-07T05:06:27+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=10611&amp;p=31653#p31653</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=10611&amp;p=31653#p31653"/>
		<title type="html"><![CDATA[Re: Emulating multiple HID devices on one Microcontroller?]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=10611&amp;p=31653#p31653"><![CDATA[
yes you can do that but only in windows. Seems most linux based OS's will not enumerate. <br /><br />To do this you just use multiple ID's. <br /><br /> 0x05, 0x01,               //   USAGE_PAGE (Generic Desktop)<br />    0x09, 0x05,               //   USAGE (Game Pad)<br /><br />    0xa1, 0x01,               //   COLLECTION (Application)<br /><br />0x85,0x01,  //     Report ID 1  &lt;-------------------<br /><br />    0x09, 0x01,               //   USAGE (Pointer)<br />    0xa1, 0x00,               //   COLLECTION (Physical)<br />    0x09, 0x30,               //      USAGE (X)<br />    0x09, 0x31,               //      USAGE (Y)<br />    0x15, 0x00,               //      LOGICAL_MINIMUM (0)<br />    0x26, 0xff, 0x00,         //      LOGICAL_MAXIMUM (255)<br />    0x75, 0x08,               //      REPORT_SIZE (8)<br />    0x95, 0x02,               //      REPORT_COUNT (2)<br />    0x81, 0x02,               //      INPUT (Data,Var,Abs)<br />    0xc0,                     //   END_COLLECTION<br /><br />    0x09, 0x01,               //   USAGE (Pointer)<br />    0xa1, 0x00,               //   COLLECTION (Physical)<br />    0x09, 0x32,               //      USAGE (X)<br />    0x09, 0x33,               //      USAGE (Y)<br />    0x15, 0x00,               //      LOGICAL_MINIMUM (0)<br />    0x26, 0xff, 0x00,         //      LOGICAL_MAXIMUM (255)<br />    0x75, 0x08,               //      REPORT_SIZE (8)<br />    0x95, 0x02,               //      REPORT_COUNT (2)<br />    0x81, 0x02,               //      INPUT (Data,Var,Abs)<br />    0xc0,                     //   END_COLLECTION<br /><br />    0x05, 0x09,               //   USAGE_PAGE (Button)<br />    0x19, 0x01,               //   USAGE_MINIMUM (Button 1)<br />    0x29, 0x10,               //   USAGE_MAXIMUM (Button 16)<br />    0x15, 0x00,               //   LOGICAL_MINIMUM (0)<br />    0x25, 0x01,               //   LOGICAL_MAXIMUM (1)<br />    0x75, 0x01,               //   REPORT_SIZE (1)<br />    0x95, 0x10,               //   REPORT_COUNT (16)<br />    0x81, 0x02,               //   INPUT (Data,Var,Abs)<br /><br />    0xc0,                     //   END_COLLECTION<br /><br /><br /><br />    0x05, 0x01,               //   USAGE_PAGE (Generic Desktop)<br />    0x09, 0x05,               //   USAGE (Game Pad)<br /><br />    0xa1, 0x01,               //   COLLECTION (Application)<br /><br />0x85,0x02,  //     Report ID 2  &lt;-------------------<br /><br />    0x09, 0x01,               //   USAGE (Pointer)<br />    0xa1, 0x00,               //   COLLECTION (Physical)<br />    0x09, 0x30,               //      USAGE (X)<br />    0x09, 0x31,               //      USAGE (Y)<br />    0x15, 0x00,               //      LOGICAL_MINIMUM (0)<br />    0x26, 0xff, 0x00,         //      LOGICAL_MAXIMUM (255)<br />    0x75, 0x08,               //      REPORT_SIZE (8)<br />    0x95, 0x02,               //      REPORT_COUNT (2)<br />    0x81, 0x02,               //      INPUT (Data,Var,Abs)<br />    0xc0,                     //   END_COLLECTION<br /><br />    0x09, 0x01,               //   USAGE (Pointer)<br />    0xa1, 0x00,               //   COLLECTION (Physical)<br />    0x09, 0x32,               //      USAGE (X)<br />    0x09, 0x33,               //      USAGE (Y)<br />    0x15, 0x00,               //      LOGICAL_MINIMUM (0)<br />    0x26, 0xff, 0x00,         //      LOGICAL_MAXIMUM (255)<br />    0x75, 0x08,               //      REPORT_SIZE (8)<br />    0x95, 0x02,               //      REPORT_COUNT (2)<br />    0x81, 0x02,               //      INPUT (Data,Var,Abs)<br />    0xc0,                     //   END_COLLECTION<br /><br />    0x05, 0x09,               //   USAGE_PAGE (Button)<br />    0x19, 0x01,               //   USAGE_MINIMUM (Button 1)<br />    0x29, 0x10,               //   USAGE_MAXIMUM (Button 16)<br />    0x15, 0x00,               //   LOGICAL_MINIMUM (0)<br />    0x25, 0x01,               //   LOGICAL_MAXIMUM (1)<br />    0x75, 0x01,               //   REPORT_SIZE (1)<br />    0x95, 0x10,               //   REPORT_COUNT (16)<br />    0x81, 0x02,               //   INPUT (Data,Var,Abs)<br /><br />    0xc0,                     //   END_COLLECTION<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=1281">ulao</a> — Mon Nov 07, 2016 5:06 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[BrainSlugs83]]></name></author>
		<updated>2016-10-25T00:29:06+02:00</updated>

		<published>2016-10-25T00:29:06+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=10611&amp;p=31608#p31608</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=10611&amp;p=31608#p31608"/>
		<title type="html"><![CDATA[Emulating multiple HID devices on one Microcontroller?]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=10611&amp;p=31608#p31608"><![CDATA[
Hey guys,<br /><br />I recently built a USB adapter for a console gamepad.  I was hoping to extend it to support multiple gamepads -- and while just adding more buttons and axises to the USB descriptor works (at least, with some games), it will still only show up as a single gamepad to the PC (so, other games don't work as well).<br /><br />Instead, I would like to report the device as being multiple HID gamepads -- this seems like it should be something we can do in the descriptor, right?<br /><br />My project is basically a heavily modified version of the HID mouse example (it just reports a gamepad instead of a mouse, and then does actual polling of the gamepad to report back the state).<br /><br />How should I attempt to accomplish this? -- What if I wanted to report two mice for example? -- i.e. how would I modify the HID descriptor in <a href="https://github.com/obdev/v-usb/blob/master/examples/hid-mouse/firmware/main.c#L33" class="postlink">main.c (in the mouse example)</a> to accomplish this?<br /><br />Am I barking up the wrong tree? -- Can it be done with HID descriptors alone? -- Or do I need to do something with multiple end points instead?<br /><br /><strong class="text-strong">EDIT:</strong><br />FYI, my current HID descriptor (which crams two gamepads worth of inputs into one device) is as follows:<br /><br /><div class="codebox"><p>Code: </p><pre><code>PROGMEM const char usbHidReportDescriptor&#91;USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH&#93; =<br />{<br />    0x05, 0x01,               //   USAGE_PAGE (Generic Desktop)<br />    0x09, 0x05,               //   USAGE (Game Pad)<br /><br />    0xa1, 0x01,               //   COLLECTION (Application)<br /><br />    0x09, 0x01,               //   USAGE (Pointer)<br />    0xa1, 0x00,               //   COLLECTION (Physical)<br />    0x09, 0x30,               //      USAGE (X)<br />    0x09, 0x31,               //      USAGE (Y)<br />    0x15, 0x00,               //      LOGICAL_MINIMUM (0)<br />    0x26, 0xff, 0x00,         //      LOGICAL_MAXIMUM (255)<br />    0x75, 0x08,               //      REPORT_SIZE (8)<br />    0x95, 0x02,               //      REPORT_COUNT (2)<br />    0x81, 0x02,               //      INPUT (Data,Var,Abs)<br />    0xc0,                     //   END_COLLECTION<br /><br />    0x09, 0x01,               //   USAGE (Pointer)<br />    0xa1, 0x00,               //   COLLECTION (Physical)<br />    0x09, 0x32,               //      USAGE (X)<br />    0x09, 0x33,               //      USAGE (Y)<br />    0x15, 0x00,               //      LOGICAL_MINIMUM (0)<br />    0x26, 0xff, 0x00,         //      LOGICAL_MAXIMUM (255)<br />    0x75, 0x08,               //      REPORT_SIZE (8)<br />    0x95, 0x02,               //      REPORT_COUNT (2)<br />    0x81, 0x02,               //      INPUT (Data,Var,Abs)<br />    0xc0,                     //   END_COLLECTION<br /><br />    0x05, 0x09,               //   USAGE_PAGE (Button)<br />    0x19, 0x01,               //   USAGE_MINIMUM (Button 1)<br />    0x29, 0x10,               //   USAGE_MAXIMUM (Button 16)<br />    0x15, 0x00,               //   LOGICAL_MINIMUM (0)<br />    0x25, 0x01,               //   LOGICAL_MAXIMUM (1)<br />    0x75, 0x01,               //   REPORT_SIZE (1)<br />    0x95, 0x10,               //   REPORT_COUNT (16)<br />    0x81, 0x02,               //   INPUT (Data,Var,Abs)<br /><br />    0xc0,                     //   END_COLLECTION<br />};</code></pre></div><p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=21891">BrainSlugs83</a> — Tue Oct 25, 2016 12:29 am</p><hr />
]]></content>
	</entry>
	</feed>
