<?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/2084" />

	<title>Objective Development Forums</title>
	
	<link href="https://forums.obdev.at/index.php" />
	<updated>2009-01-09T02:16:41+02:00</updated>

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

		<entry>
		<author><name><![CDATA[Grendel]]></name></author>
		<updated>2009-01-09T02:16:41+02:00</updated>

		<published>2009-01-09T02:16:41+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=2084&amp;p=7452#p7452</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=2084&amp;p=7452#p7452"/>
		<title type="html"><![CDATA[Report Defn]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=2084&amp;p=7452#p7452"><![CDATA[
<blockquote><div><cite>Drools wrote:</cite>I was hoping someone could show me how to modify it to include 6 more buttons.</div></blockquote><br /><div class="codebox"><p>Code: </p><pre><code>//HID Report Descriptor<br />PROGMEM char usbHidReportDescriptor&#91;USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH&#93; =<br />&#123; //ZX-Joystick-1<br />  0x05, 0x01, // USAGE_PAGE &#40;Generic Desktop&#41;<br />  0x09, 0x04, // USAGE &#40;Joystick&#41;<br />  0xa1, 0x01, // COLLECTION &#40;Application&#41;<br />  0x09, 0x01, //       USAGE &#40;Pointer&#41;<br />  0xa1, 0x00, //      COLLECTION &#40;Physical&#41;<br />  0x85, 0x01, //           REPORT_ID &#40;1&#41;<br />  0x09, 0x30, //           USAGE &#40;X&#41;<br />  0x09, 0x31, //           USAGE &#40;Y&#41;<br />  0x15, 0x00, //           LOGICAL_MINIMUM &#40;0&#41;<br />  0x25, 0x02, //           LOGICAL_MAXIMUM &#40;2&#41;<br />  0x75, 0x08, //           REPORT_SIZE &#40;8&#41;<br />  0x95, 0x02, //           REPORT_COUNT &#40;2&#41;<br />  0x81, 0x02, //           INPUT &#40;Data,Var,Abs&#41;<br />  0x15, 0x00, //           LOGICAL_MINIMUM &#40;0&#41;<br />  0x25, 0x01, //           LOGICAL_MAXIMUM &#40;1&#41;<br />  0x95, 0x07, //           REPORT_COUNT &#40;7&#41;<br />  0x75, 0x01, //           REPORT_SIZE &#40;1&#41;<br />  0x05, 0x09, //           USAGE_PAGE &#40;Button&#41;<br />  0x19, 0x01, //           USAGE_MINIMUM &#40;Button 1&#41;<br />  0x29, 0x07, //           USAGE_MAXIMUM &#40;Button 7&#41;<br />  0x81, 0x02, //           INPUT &#40;Data,Var,Abs&#41;<br />  0x95, 0x01, //           REPORT_COUNT &#40;1&#41;<br />  0x75, 0x01, //           REPORT_SIZE &#40;1&#41;<br />  0x81, 0x01, //           INPUT &#40;Constant&#41; - 1 bit is empty   <br />  0xc0,       //      END_COLLECTION<br />  0xc0,       // END_COLLECTION<br />&#125;;<br /></code></pre></div><br /><br /><blockquote><div><cite>Drools wrote:</cite>How do I calculate the size of the report descriptor?</div></blockquote><br />Count the bytes. Or did you mean the size of the report ?<br /><br /><a href="http://forums.obdev.at/viewtopic.php?p=2982&amp;highlight=#2982" class="postlink">This thread</a> may be interesting to you.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=101">Grendel</a> — Fri Jan 09, 2009 2:16 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Drools]]></name></author>
		<updated>2009-01-08T04:55:22+02:00</updated>

		<published>2009-01-08T04:55:22+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=2084&amp;p=7435#p7435</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=2084&amp;p=7435#p7435"/>
		<title type="html"><![CDATA[Report Defn]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=2084&amp;p=7435#p7435"><![CDATA[
How do I calculate the size of the report descriptor?<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=1579">Drools</a> — Thu Jan 08, 2009 4:55 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Drools]]></name></author>
		<updated>2009-01-08T02:12:47+02:00</updated>

		<published>2009-01-08T02:12:47+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=2084&amp;p=7431#p7431</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=2084&amp;p=7431#p7431"/>
		<title type="html"><![CDATA[Report Defn]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=2084&amp;p=7431#p7431"><![CDATA[
I have learned one thing, originally I thought the indentations were just formatting error when I copied the code into a new project however now I think that was a mistake.<br />Here is the original with formatting intact.<br /><div class="codebox"><p>Code: </p><pre><code>//HID Report Descriptor<br />PROGMEM char usbHidReportDescriptor&#91;USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH&#93; =<br />&#123; //ZX-Joystick-1<br />  0x05, 0x01, // USAGE_PAGE &#40;Generic Desktop&#41;<br />  0x09, 0x04, // USAGE &#40;Joystick&#41;<br />  0xa1, 0x01, // COLLECTION &#40;Application&#41;<br />  0x09, 0x01, //       USAGE &#40;Pointer&#41;<br />  0xa1, 0x00, //      COLLECTION &#40;Physical&#41;<br />  0x85, 0x01, //           REPORT_ID &#40;1&#41;<br />  0x09, 0x30, //           USAGE &#40;X&#41;<br />  0x09, 0x31, //           USAGE &#40;Y&#41;<br />  0x15, 0x00, //           LOGICAL_MINIMUM &#40;0&#41;<br />  0x25, 0x02, //           LOGICAL_MAXIMUM &#40;2&#41;<br />  0x75, 0x08, //           REPORT_SIZE &#40;8&#41;<br />  0x95, 0x02, //           REPORT_COUNT &#40;2&#41;<br />  0x81, 0x02, //           INPUT &#40;Data,Var,Abs&#41;<br />  0x15, 0x00, //           LOGICAL_MINIMUM &#40;0&#41;<br />  0x25, 0x01, //           LOGICAL_MAXIMUM &#40;1&#41;<br />  0x95, 0x01, //           REPORT_COUNT &#40;1&#41;<br />  0x75, 0x01, //           REPORT_SIZE &#40;1&#41;<br />  0x05, 0x09, //           USAGE_PAGE &#40;Button&#41;<br />  0x19, 0x01, //           USAGE_MINIMUM &#40;Button 1&#41;<br />  0x29, 0x01, //           USAGE_MAXIMUM &#40;Button 1&#41;<br />  0x81, 0x02, //           INPUT &#40;Data,Var,Abs&#41;<br />  0x95, 0x07, //           REPORT_COUNT &#40;7&#41;<br />  0x75, 0x01, //           REPORT_SIZE &#40;1&#41;<br />  0x81, 0x01, //           INPUT &#40;Constant&#41; - 7 bits are empty   <br />  0xc0,       //      END_COLLECTION<br />  0xc0,       // END_COLLECTION<br />&#125;;<br /></code></pre></div><br />The size of this discriptor is 50, now I think the area I need to focus on is USAGE_PAGE (Button).  I have not found a document that describes the Descriptor Line for Line.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=1579">Drools</a> — Thu Jan 08, 2009 2:12 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Drools]]></name></author>
		<updated>2009-01-08T00:53:43+02:00</updated>

		<published>2009-01-08T00:53:43+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=2084&amp;p=7430#p7430</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=2084&amp;p=7430#p7430"/>
		<title type="html"><![CDATA[Report Defn]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=2084&amp;p=7430#p7430"><![CDATA[
The following is a working Report Definition for a 2-Axis 1-btn joystick, provided by ZX_USBJoy.<br /><br />&lt;code&gt;<br />PROGMEM char usbHidReportDescriptor[USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH] =<br />{ <br />//ZX-Joystick-1<br />0x05, 0x01, // USAGE_PAGE (Generic Desktop)<br />0x09, 0x04, // USAGE (Joystick)<br />0xa1, 0x01, // COLLECTION (Application)<br />0x09, 0x01, //  USAGE (Pointer)<br />0xa1, 0x00, //  COLLECTION (Physical)<br />0x85, 0x01, //  REPORT_ID (1)<br />0x09, 0x30, //  USAGE (X)<br />0x09, 0x31, //  USAGE (Y)<br />0x15, 0x00, //  LOGICAL_MINIMUM (0)<br />0x25, 0x02, //  LOGICAL_MAXIMUM (2)<br />0x75, 0x08, //  REPORT_SIZE (8)<br />0x95, 0x02, //  REPORT_COUNT (2)<br />0x81, 0x02, //  INPUT (Data,Var,Abs)<br />0x15, 0x00, //  LOGICAL_MINIMUM (0)<br />0x25, 0x01, //  LOGICAL_MAXIMUM (1)<br />0x95, 0x01, //  REPORT_COUNT (1)<br />0x75, 0x01, //  REPORT_SIZE (1)<br />0x05, 0x09, //  USAGE_PAGE (Button)<br />0x19, 0x01, //  USAGE_MINIMUM (Button 1)<br />0x29, 0x01, //  USAGE_MAXIMUM (Button 1)<br />0x81, 0x02, //  INPUT (Data,Var,Abs)<br />0x95, 0x07, //  REPORT_COUNT (7)<br />0x75, 0x01, //  REPORT_SIZE (1)<br />  0x81, 0x01, //  INPUT (Constant) - 7 bits are empty   <br />  0xc0,       //  END_COLLECTION<br />  0xc0,       // END_COLLECTION<br />};<br />&lt;/code&gt;<br />I was hoping someone could show me how to modify it to include 6 more buttons. I’m very new to AVRs in general and AVR-USB as well.<br />Any help would be appreciated. <br /><br /><br />[code][/code]<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=1579">Drools</a> — Thu Jan 08, 2009 12:53 am</p><hr />
]]></content>
	</entry>
	</feed>
