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

	<title>Objective Development Forums</title>
	
	<link href="https://forums.obdev.at/index.php" />
	<updated>2011-05-06T17:46:40+02:00</updated>

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

		<entry>
		<author><name><![CDATA[ulao]]></name></author>
		<updated>2011-05-06T17:46:40+02:00</updated>

		<published>2011-05-06T17:46:40+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=5656&amp;p=18391#p18391</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=5656&amp;p=18391#p18391"/>
		<title type="html"><![CDATA[Re: composite devices in config]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=5656&amp;p=18391#p18391"><![CDATA[
Ok I had overlapping interrupts but still no luck <br /><br /><div class="codebox"><p>Code: </p><pre><code>/**************************************************************************  <br />  USB configuration descriptor<br />  **************************************************************************/  <br />     9,                  // sizeof(usbDescriptorConfiguration): length of descriptor in bytes   <br />     USBDESCR_CONFIG,       // descriptor type   <br />     //total size breakdown, LSB of wTotalLength<br />     9  +                 // config descriptor<br />     9 + 9 + 7 + 7 * USB_CFG_HAVE_INTRIN_ENDPOINT + //  descriptors on HID interface<br />     9 + 7 + 7,          //    descriptors on MSC<br />     0, // MSB of wTotalLength<br />     2,                  //number of interfaces in this configuration   <br />     1,                  // index of this configuration   <br />     0,                  // configuration name string index   <br />     USB_CFG_IS_SELF_POWERED,// attributes   <br />     USB_CFG_MAX_BUS_POWER/2,// max USB current in 2mA units   <br />  <br />/**************************************************************************  <br /> about the device ( HID gamepad and mouse )  <br /> **************************************************************************/  <br />     9,                   // sizeof(usbDescrInterface): length of descriptor in bytes   <br />     USBDESCR_INTERFACE,    //descriptor type   <br />     0,                   // index of this interface   <br />     0,                   // alternate setting for this interface   <br />     1 + USB_CFG_HAVE_INTRIN_ENDPOINT,  <br />     USB_CFG_INTERFACE_CLASS,  <br />     USB_CFG_INTERFACE_SUBCLASS,  <br />     USB_CFG_INTERFACE_PROTOCOL,  <br />     0,                  // string index for interface   <br />/**************************************************************************  <br /> about the report descriptor  <br /> **************************************************************************/  <br />     9,                // sizeof(usbDescrHID): length of descriptor in bytes   <br />     USBDESCR_HID,        // descriptor type: HID   <br />     0x10, 0x01,       // BCD representation of HID version   <br />     0x00,             // target country code   <br />     0x01,             // number of HID Report (or other HID class) Descriptor infos to follow   <br />     0x22,             // descriptor type: report   <br />     USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH, 0,  // total length of report descriptor   <br />/**************************************************************************  <br />interupts for index 0  <br /> **************************************************************************/  <br />     //in put  <br />        7,             //sizeof(usbDescrEndpoint)   <br />        USBDESCR_ENDPOINT,// descriptor type = endpoint   <br />        0x81,          // bulk IN endpoint number 1   <br />        0x03,          // attrib: Interrupt endpoint  <br />        8, 0,          // maximum packet size   <br />        0x04, // in ms   <br />  <br />     #if USB_CFG_HAVE_INTRIN_ENDPOINT    //optional interrupt OUT endpoint  <br />     //output.  <br />        7,             // sizeof(usbDescrEndpoint)  <br />        USBDESCR_ENDPOINT,           // descriptor type = endpoint  <br />        0x01,         // out endpoint number 2   <br />        0x03,          // attrib: Interrupt endpoint   <br />        8, 0,            // maximum packet size   <br />        USB_CFG_INTR_POLL_INTERVAL, // in ms   <br />     #endif  <br />/**************************************************************************  <br />about the device ( mass storage )  <br />**************************************************************************/  <br />     0x09,            // sizeof(usbDescrInterface): length of descriptor in bytes   <br />     USBDESCR_INTERFACE,  // descriptor type   <br />     0x01,            // index of this interface   <br />     0x00,             // alternate setting for this interface   <br />     2,               // bNumEndpoints  <br />     0x08,            // bInterfaceClass: MASS STORAGE Class   <br />     0x06,            // bInterfaceSubClass : SCSI transparent  <br />     0x50,            // nInterfaceProtocol   <br />     0,               // string index for interface  <br />/**************************************************************************  <br />interupts for index 1  <br /> **************************************************************************/  <br />     //in put  <br />     7,             //sizeof(usbDescrEndpoint)   <br />     USBDESCR_ENDPOINT,// descriptor type = endpoint   <br />     0x82,          // bulk IN endpoint number 1<br />     0x02,          // attrib: bulk endpoint  <br />     0x40, 0,          // maximum packet size   <br />     0x00, // in ms   <br />  <br />     //output.  <br />     7,             // sizeof(usbDescrEndpoint)  <br />     USBDESCR_ENDPOINT, // descriptor type = endpoint  <br />     0x02,         // out endpoint number 2   <br />     0x02,          // attrib: bulk endpoint   <br />     0x40, 0,         // maximum packet size   <br />     0, // in ms   </code></pre></div><br /><br /><br />What about my config?<br /><br />#define USB_CFG_HAVE_INTRIN_ENDPOINT    1<br />#define USB_CFG_EP3_NUMBER2 <br />#define USB_CFG_HAVE_INTRIN_ENDPOINT3   1<br />#define USB_CFG_IMPLEMENT_HALT          0<br /><br />Guessing my EP3 is going to be a 2, what about the two out endpoints?  Do I need to tell the config I have two?<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=1281">ulao</a> — Fri May 06, 2011 5:46 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ulao]]></name></author>
		<updated>2011-05-04T19:55:40+02:00</updated>

		<published>2011-05-04T19:55:40+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=5656&amp;p=18375#p18375</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=5656&amp;p=18375#p18375"/>
		<title type="html"><![CDATA[Re: composite devices in config]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=5656&amp;p=18375#p18375"><![CDATA[
Ok changed my mind I now feel I need two sets of interrupts ( based on what I see on the net).  So does that mean 2 + a default? So add 7+7+7 and another +9, or another +18. This is driving me nutz!  In either case I tried both. <br /><br /><div class="codebox"><p>Code: </p><pre><code>/**************************************************************************<br />//USB configuration descriptor//<br />**************************************************************************/<br />   9,                  // sizeof(usbDescriptorConfiguration): length of descriptor in bytes <br />   USBDESCR_CONFIG,       // descriptor type <br />      //18 + (7 * 2) + <br />      //18 + (7 * 2) + 7 +<br />      //9 +<br />   //total size breakdone.<br />   18 + // guessing each device <br />   7 * USB_CFG_HAVE_INTRIN_ENDPOINT +//total interupts ( /** USB_CFG_HAVE_INTRIN_ENDPOINT3 + 7*/ )<br />   7 +// the one defult inturupt<br />   9, // I think this is for the header of this descriptor. <br />   <br />   0, // not sure what this parm is form<br />   2,                  //number of interfaces in this configuration <br />   1,                  // index of this configuration <br />   0,                  // configuration name string index <br />   USB_CFG_IS_SELF_POWERED,// attributes <br />   USB_CFG_MAX_BUS_POWER/2,// max USB current in 2mA units <br /><br />   /**************************************************************************<br />   about the device ( HID gamepad and mouse )<br />   **************************************************************************/<br />   9,                   // sizeof(usbDescrInterface): length of descriptor in bytes <br />   USBDESCR_INTERFACE,    //descriptor type <br />   0,                   // index of this interface <br />   0,                   // alternate setting for this interface <br />   1 + USB_CFG_HAVE_INTRIN_ENDPOINT,<br />   /* + USB_CFG_HAVE_INTRIN_ENDPOINT3, */<br />   USB_CFG_INTERFACE_CLASS,<br />   USB_CFG_INTERFACE_SUBCLASS,<br />   USB_CFG_INTERFACE_PROTOCOL,<br />   0,                  // string index for interface <br />   /**************************************************************************<br />   about the report descriptor<br />   **************************************************************************/<br />   9,                // sizeof(usbDescrHID): length of descriptor in bytes <br />   USBDESCR_HID,        // descriptor type: HID <br />   0x10, 0x01,       // BCD representation of HID version <br />   0x00,             // target country code <br />   0x01,             // number of HID Report (or other HID class) Descriptor infos to follow <br />   0x22,             // descriptor type: report <br />   USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH, 0,  // total length of report descriptor <br />   /**************************************************************************<br />   interupts for index 0<br />   **************************************************************************/<br />   #if USB_CFG_HAVE_INTRIN_ENDPOINT    //endpoint descriptor for endpoint 1 <br />   //in put<br />      7,             //sizeof(usbDescrEndpoint) <br />      USBDESCR_ENDPOINT,// descriptor type = endpoint <br />      0x81,          // bulk IN endpoint number 1 <br />      0x03,          // attrib: Interrupt endpoint<br />      8, 0,          // maximum packet size <br />      0x04, // in ms <br /><br />   //output.<br />      7,             // sizeof(usbDescrEndpoint)<br />      5,           // descriptor type = endpoint<br />      0x02,         // out endpoint number 2 <br />      0x03,          // attrib: Interrupt endpoint <br />      8, 0,            // maximum packet size <br />      USB_CFG_INTR_POLL_INTERVAL, // in ms <br />   #endif<br />   /**************************************************************************<br />   //about the device ( mass storage )<br />   **************************************************************************/<br />   0x09,            // sizeof(usbDescrInterface): length of descriptor in bytes <br />   0x04,            // descriptor type <br />   0x01,            // index of this interface <br />   0x00,             // alternate setting for this interface <br />   2,               // bNumEndpoints<br />   0x08,            // bInterfaceClass: MASS STORAGE Class <br />   0x06,            // bInterfaceSubClass : SCSI transparent<br />   0x50,            // nInterfaceProtocol <br />   4,               // string index for interface<br />   /**************************************************************************<br />   interupts for index 1<br />   **************************************************************************/<br />   //in put<br />   7,             //sizeof(usbDescrEndpoint) <br />   5,// descriptor type = endpoint <br />   0x81,          // bulk IN endpoint number 1 <br />   0x02,          // attrib: Interrupt endpoint<br />   0x40, 0,          // maximum packet size <br />   0x00, // in ms <br /><br />   //output.<br />   7,             // sizeof(usbDescrEndpoint)<br />   5,           // descriptor type = endpoint<br />   0x02,         // out endpoint number 2 <br />   0x02,          // attrib: Interrupt endpoint <br />   0x40, 0,         // maximum packet size <br />   0, // in ms <br /></code></pre></div><p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=1281">ulao</a> — Wed May 04, 2011 7:55 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ulao]]></name></author>
		<updated>2011-05-04T03:26:27+02:00</updated>

		<published>2011-05-04T03:26:27+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=5656&amp;p=18369#p18369</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=5656&amp;p=18369#p18369"/>
		<title type="html"><![CDATA[composite devices in config]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=5656&amp;p=18369#p18369"><![CDATA[
Ok after some digging around I found in order to use a mass-storgae with a gamepad I need to do a composite of the two devices in my config.<br /><br />Currently I use an in and out int. for my game pad ( force feed back and gamepad data). I'm trying to modify my config to support the mass-storage. My guess is my length of data returned being wrong. Before adding the other device its :<br /> 18 + 7 * USB_CFG_HAVE_INTRIN_ENDPOINT + 7 /** USB_CFG_HAVE_INTRIN_ENDPOINT3 + 7*/ + 9, 0,<br /><br />I did change my number of interfaces and gave the MS a new index of 1, but I get enumeration errors. I tried many way to set the length but I'm not getting any where. Did I miss something? <br /><br />Also , I just made a guess here but would both devices use the same endpoints, or do I need to have two sets? Both devices needs an in and an out. <br /><br /><div class="codebox"><p>Code: </p><pre><code>/**************************************************************************<br />//USB configuration descriptor//<br />**************************************************************************/<br />   9,                  // sizeof(usbDescriptorConfiguration): length of descriptor in bytes <br />   USBDESCR_CONFIG,       // descriptor type <br />      <br /><br />   // I have tried 8+ I have tried 16+ I have tried doubling the interrupts and even tried 1 through 32 each time getting enumeration errors. <br />    //7 * 1/* two more inturupts MS*/ +7 + 9 /* MS device */ +<br />   //tried 1-32 no luck<br />   //18 + (7 * 2) + <br />   //18 + (7 * 2) + 7 +<br />   //9 +<br /><br /><br />   18 + 7 * USB_CFG_HAVE_INTRIN_ENDPOINT + 7 /** USB_CFG_HAVE_INTRIN_ENDPOINT3 + 7*/ + 9, 0, // total length of data returned (including inlined descriptors)           <br />   2,                  //number of interfaces in this configuration <br />   1,                  // index of this configuration <br />   0,                  // configuration name string index <br />   USB_CFG_IS_SELF_POWERED,// attributes <br />   USB_CFG_MAX_BUS_POWER/2,// max USB current in 2mA units <br /><br />   /**************************************************************************<br />   about the device ( HID gamepad and mouse )<br />   **************************************************************************/<br />   9,                   // sizeof(usbDescrInterface): length of descriptor in bytes <br />   USBDESCR_INTERFACE,    //descriptor type <br />   0,                   // index of this interface <br />   0,                   // alternate setting for this interface <br />   1 + USB_CFG_HAVE_INTRIN_ENDPOINT,<br />   /* + USB_CFG_HAVE_INTRIN_ENDPOINT3, */<br />   USB_CFG_INTERFACE_CLASS,<br />   USB_CFG_INTERFACE_SUBCLASS,<br />   USB_CFG_INTERFACE_PROTOCOL,<br />   0,                  // string index for interface <br />   /**************************************************************************<br />   //about the device ( mass storage )<br />   **************************************************************************/<br />   0x09,            // sizeof(usbDescrInterface): length of descriptor in bytes <br />   0x04,            // descriptor type <br />   0x01,            // index of this interface <br />   0x00,             // alternate setting for this interface <br />   2,               // bNumEndpoints<br />   0x08,            // bInterfaceClass: MASS STORAGE Class <br />   0x06,            // bInterfaceSubClass : SCSI transparent<br />   0x50,            // nInterfaceProtocol <br />   4,               // string index for interface<br />   /**************************************************************************<br />   about the report descriptor<br />   **************************************************************************/<br />   9,                // sizeof(usbDescrHID): length of descriptor in bytes <br />   USBDESCR_HID,        // descriptor type: HID <br />   0x10, 0x01,       // BCD representation of HID version <br />   0x00,             // target country code <br />   0x01,             // number of HID Report (or other HID class) Descriptor infos to follow <br />   0x22,             // descriptor type: report <br />   USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH, 0,  // total length of report descriptor <br />   /**************************************************************************<br />   interupts<br />   **************************************************************************/<br />   #if USB_CFG_HAVE_INTRIN_ENDPOINT    //endpoint descriptor for endpoint 1 <br />   //in put<br />      7,             //sizeof(usbDescrEndpoint) <br />      USBDESCR_ENDPOINT,// descriptor type = endpoint <br />      0x81,          // bulk IN endpoint number 1 <br />      0x03,          // attrib: Interrupt endpoint<br />      8, 0,          // maximum packet size <br />      0x04, // in ms <br /><br />   //output.<br />      7,             // sizeof(usbDescrEndpoint)<br />      5,           // descriptor type = endpoint<br />      0x02,         // out endpoint number 2 <br />      0x03,          // attrib: Interrupt endpoint <br />      8, 0,            // maximum packet size <br />      USB_CFG_INTR_POLL_INTERVAL, // in ms <br />   #endif<br /></code></pre></div><p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=1281">ulao</a> — Wed May 04, 2011 3:26 am</p><hr />
]]></content>
	</entry>
	</feed>
