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

	<title>Objective Development Forums</title>
	
	<link href="https://forums.obdev.at/index.php" />
	<updated>2008-02-22T09:11:11+02:00</updated>

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

		<entry>
		<author><name><![CDATA[soliars]]></name></author>
		<updated>2008-02-22T09:11:11+02:00</updated>

		<published>2008-02-22T09:11:11+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=891&amp;p=4321#p4321</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=891&amp;p=4321#p4321"/>
		<title type="html"><![CDATA[General joystick HID question]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=891&amp;p=4321#p4321"><![CDATA[
I think I should think it over and over... <img class="smilies" src="./../../../images/smilies/icon_eek.gif" alt=":shock:" title="Shocked" /><p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=862">soliars</a> — Fri Feb 22, 2008 9:11 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[WaaZaa]]></name></author>
		<updated>2007-12-05T13:47:46+02:00</updated>

		<published>2007-12-05T13:47:46+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=891&amp;p=3394#p3394</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=891&amp;p=3394#p3394"/>
		<title type="html"><![CDATA[General joystick HID question]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=891&amp;p=3394#p3394"><![CDATA[
also added my usbconfig.h<br /><br /><br />I'm lost to whats wrong here.. :/<br /><div class="codebox"><p>Code: </p><pre><code>/* Name: usbconfig.h<br /> * Project: AVR USB driver<br /> * Author: Christian Starkjohann<br /> * Creation Date: 2005-04-01<br /> * Tabsize: 4<br /> * Copyright: &#40;c&#41; 2005 by OBJECTIVE DEVELOPMENT Software GmbH<br /> * License: GNU GPL v2 &#40;see License.txt&#41; or proprietary &#40;CommercialLicense.txt&#41;<br /> * This Revision: $Id: usbconfig-prototype.h 404 2007-11-06 11:22:17Z cs $<br /> */<br /><br />#ifndef __usbconfig_h_included__<br />#define __usbconfig_h_included__<br /><br />/*<br />General Description:<br />This file is an example configuration &#40;with inline documentation&#41; for the USB<br />driver. It configures AVR-USB for an ATMega8 with USB D+ connected to Port D<br />bit 2 &#40;which is also hardware interrupt 0&#41; and USB D- to Port D bit 0. You may<br />wire the lines to any other port, as long as D+ is also wired to INT0.<br />To create your own usbconfig.h file, copy this file to the directory<br />containing &quot;usbdrv&quot; &#40;that is your project firmware source directory&#41; and<br />rename it to &quot;usbconfig.h&quot;. Then edit it accordingly.<br />*/<br /><br />/* ---------------------------- Hardware Config ---------------------------- */<br /><br />#define USB_CFG_IOPORTNAME      D<br />/* This is the port where the USB bus is connected. When you configure it to<br /> * &quot;B&quot;, the registers PORTB, PINB and DDRB will be used.<br /> */<br />#define USB_CFG_DMINUS_BIT      0<br />/* This is the bit number in USB_CFG_IOPORT where the USB D- line is connected.<br /> * This may be any bit in the port.<br /> */<br />#define USB_CFG_DPLUS_BIT       2<br />/* This is the bit number in USB_CFG_IOPORT where the USB D+ line is connected.<br /> * This may be any bit in the port. Please note that D+ must also be connected<br /> * to interrupt pin INT0!<br /> */<br />/* #define USB_CFG_CLOCK_KHZ       &#40;F_CPU/1000&#41; */<br />/* Clock rate of the AVR in MHz. Legal values are 12000, 15000, 16000 or 16500.<br /> * The 16.5 MHz version of the code requires no crystal, it tolerates +/- 1%<br /> * deviation from the nominal frequency. All other rates require a precision<br /> * of 2000 ppm and thus a crystal!<br /> * Default if not specified: 12 MHz<br /> */<br /><br />/* ----------------------- Optional Hardware Config ------------------------ */<br /><br />/* #define USB_CFG_PULLUP_IOPORTNAME   D */<br />/* If you connect the 1.5k pullup resistor from D- to a port pin instead of<br /> * V+, you can connect and disconnect the device from firmware by calling<br /> * the macros usbDeviceConnect&#40;&#41; and usbDeviceDisconnect&#40;&#41; &#40;see usbdrv.h&#41;.<br /> * This constant defines the port on which the pullup resistor is connected.<br /> */<br />/* #define USB_CFG_PULLUP_BIT          4 */<br />/* This constant defines the bit number in USB_CFG_PULLUP_IOPORT &#40;defined<br /> * above&#41; where the 1.5k pullup resistor is connected. See description<br /> * above for details.<br /> */<br /><br />/* --------------------------- Functional Range ---------------------------- */<br /><br />#define USB_CFG_HAVE_INTRIN_ENDPOINT    1<br />/* Define this to 1 if you want to compile a version with two endpoints: The<br /> * default control endpoint 0 and an interrupt-in endpoint &#40;any other endpoint<br /> * number&#41;.<br /> */<br />#define USB_CFG_HAVE_INTRIN_ENDPOINT3   0<br />/* Define this to 1 if you want to compile a version with three endpoints: The<br /> * default control endpoint 0, an interrupt-in endpoint 3 &#40;or the number<br /> * configured below&#41; and a catch-all default interrupt-in endpoint as above.<br /> * You must also define USB_CFG_HAVE_INTRIN_ENDPOINT to 1 for this feature.<br /> */<br />#define USB_CFG_EP3_NUMBER              3<br />/* If the so-called endpoint 3 is used, it can now be configured to any other<br /> * endpoint number &#40;except 0&#41; with this macro. Default if undefined is 3.<br /> */<br />/* #define USB_INITIAL_DATATOKEN           USBPID_DATA0 */<br />/* The above macro defines the startup condition for data toggling on the<br /> * interrupt/bulk endpoints 1 and 3. Defaults to USBPID_DATA0.<br /> */<br />#define USB_CFG_IMPLEMENT_HALT          0<br />/* Define this to 1 if you also want to implement the ENDPOINT_HALT feature<br /> * for endpoint 1 &#40;interrupt endpoint&#41;. Although you may not need this feature,<br /> * it is required by the standard. We have made it a config option because it<br /> * bloats the code considerably.<br /> */<br />#define USB_CFG_INTR_POLL_INTERVAL      20<br />/* If you compile a version with endpoint 1 &#40;interrupt-in&#41;, this is the poll<br /> * interval. The value is in milliseconds and must not be less than 10 ms for<br /> * low speed devices.<br /> */<br />#define USB_CFG_IS_SELF_POWERED         0<br />/* Define this to 1 if the device has its own power supply. Set it to 0 if the<br /> * device is powered from the USB bus.<br /> */<br />#define USB_CFG_MAX_BUS_POWER           100<br />/* Set this variable to the maximum USB bus power consumption of your device.<br /> * The value is in milliamperes. &#91;It will be divided by two since USB<br /> * communicates power requirements in units of 2 mA.&#93;<br /> */<br />#define USB_CFG_IMPLEMENT_FN_WRITE      0<br />/* Set this to 1 if you want usbFunctionWrite&#40;&#41; to be called for control-out<br /> * transfers. Set it to 0 if you don't need it and want to save a couple of<br /> * bytes.<br /> */<br />#define USB_CFG_IMPLEMENT_FN_READ       0<br />/* Set this to 1 if you need to send control replies which are generated<br /> * &quot;on the fly&quot; when usbFunctionRead&#40;&#41; is called. If you only want to send<br /> * data from a static buffer, set it to 0 and return the data from<br /> * usbFunctionSetup&#40;&#41;. This saves a couple of bytes.<br /> */<br />#define USB_CFG_IMPLEMENT_FN_WRITEOUT   0<br />/* Define this to 1 if you want to use interrupt-out &#40;or bulk out&#41; endpoints.<br /> * You must implement the function usbFunctionWriteOut&#40;&#41; which receives all<br /> * interrupt/bulk data sent to any endpoint other than 0. The endpoint number<br /> * can be found in 'usbRxToken'.<br /> */<br />#define USB_CFG_HAVE_FLOWCONTROL        0<br />/* Define this to 1 if you want flowcontrol over USB data. See the definition<br /> * of the macros usbDisableAllRequests&#40;&#41; and usbEnableAllRequests&#40;&#41; in<br /> * usbdrv.h.<br /> */<br />/* #define USB_RX_USER_HOOK&#40;data, len&#41;     if&#40;usbRxToken == &#40;uchar&#41;USBPID_SETUP&#41; blinkLED&#40;&#41;; */<br />/* This macro is a hook if you want to do unconventional things. If it is<br /> * defined, it's inserted at the beginning of received message processing.<br /> * If you eat the received message and don't want default processing to<br /> * proceed, do a return after doing your things. One possible application<br /> * &#40;besides debugging&#41; is to flash a status LED on each packet.<br /> */<br />#define USB_COUNT_SOF                   0<br />/* define this macro to 1 if you need the global variable &quot;usbSofCount&quot; which<br /> * counts SOF packets. This feature requires that the hardware interrupt is<br /> * connected to D-.<br /> */<br /><br />/* -------------------------- Device Description --------------------------- */<br /><br />#define  USB_CFG_VENDOR_ID       0xc0, 0x16<br />/* USB vendor ID for the device, low byte first. If you have registered your<br /> * own Vendor ID, define it here. Otherwise you use obdev's free shared<br /> * VID/PID pair. Be sure to read USBID-License.txt for rules!<br /> * This template uses obdev's shared VID/PID pair for HIDs: 0x16c0/0x5df.<br /> * Use this VID/PID pair ONLY if you understand the implications!<br /> */<br />#define  USB_CFG_DEVICE_ID       0xdf, 0x05<br />/* This is the ID of the product, low byte first. It is interpreted in the<br /> * scope of the vendor ID. If you have registered your own VID with usb.org<br /> * or if you have licensed a PID from somebody else, define it here. Otherwise<br /> * you use obdev's free shared VID/PID pair. Be sure to read the rules in<br /> * USBID-License.txt!<br /> * This template uses obdev's shared VID/PID pair for HIDs: 0x16c0/0x5df.<br /> * Use this VID/PID pair ONLY if you understand the implications!<br /> */<br />#define USB_CFG_DEVICE_VERSION  0x00, 0x01<br />/* Version number of the device: Minor number first, then major number.<br /> */<br />#define USB_CFG_VENDOR_NAME     'w', 'w', 'w', '.', 'o', 'b', 'd', 'e', 'v', '.', 'a', 't'<br />#define USB_CFG_VENDOR_NAME_LEN 12<br />/* These two values define the vendor name returned by the USB device. The name<br /> * must be given as a list of characters under single quotes. The characters<br /> * are interpreted as Unicode &#40;UTF-16&#41; entities.<br /> * If you don't want a vendor name string, undefine these macros.<br /> * ALWAYS define a vendor name containing your Internet domain name if you use<br /> * obdev's free shared VID/PID pair. See the file USBID-License.txt for<br /> * details.<br /> */<br />#define USB_CFG_DEVICE_NAME     'T', 'e', 'm', 'p', 'l', 'a', 't', 'e'<br />#define USB_CFG_DEVICE_NAME_LEN 8<br />/* Same as above for the device name. If you don't want a device name, undefine<br /> * the macros. See the file USBID-License.txt before you assign a name if you<br /> * use a shared VID/PID.<br /> */<br />#define USB_CFG_SERIAL_NUMBER   '0', '2'<br />#define USB_CFG_SERIAL_NUMBER_LEN   2 <br />/* Same as above for the serial number. If you don't want a serial number,<br /> * undefine the macros.<br /> * It may be useful to provide the serial number through other means than at<br /> * compile time. See the section about descriptor properties below for how<br /> * to fine tune control over USB descriptors such as the string descriptor<br /> * for the serial number.<br /> */<br />#define USB_CFG_DEVICE_CLASS        0<br />#define USB_CFG_DEVICE_SUBCLASS     0<br />/* See USB specification if you want to conform to an existing device class.<br /> */<br />#define USB_CFG_INTERFACE_CLASS     3   /* HID */<br />#define USB_CFG_INTERFACE_SUBCLASS  0<br />#define USB_CFG_INTERFACE_PROTOCOL  0<br />/* See USB specification if you want to conform to an existing device class or<br /> * protocol.<br /> * This template defines a HID class device. If you implement a vendor class<br /> * device, set USB_CFG_INTERFACE_CLASS to 0 and USB_CFG_DEVICE_CLASS to 0xff.<br /> */<br />#define USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH    61  /* total length of report descriptor */<br />/* Define this to the length of the HID report descriptor, if you implement<br /> * an HID device. Otherwise don't define it or define it to 0.<br /> * Since this template defines a HID device, it must also specify a HID<br /> * report descriptor length. You must add a PROGMEM character array named<br /> * &quot;usbHidReportDescriptor&quot; to your code which contains the report descriptor.<br /> * Don't forget to keep the array and this define in sync!<br /> */<br /><br />/* #define USB_PUBLIC static */<br />/* Use the define above if you #include usbdrv.c instead of linking against it.<br /> * This technique saves a couple of bytes in flash memory.<br /> */<br /><br />/* ------------------- Fine Control over USB Descriptors ------------------- */<br />/* If you don't want to use the driver's default USB descriptors, you can<br /> * provide our own. These can be provided as &#40;1&#41; fixed length static data in<br /> * flash memory, &#40;2&#41; fixed length static data in RAM or &#40;3&#41; dynamically at<br /> * runtime in the function usbFunctionDescriptor&#40;&#41;. See usbdrv.h for more<br /> * information about this function.<br /> * Descriptor handling is configured through the descriptor's properties. If<br /> * no properties are defined or if they are 0, the default descriptor is used.<br /> * Possible properties are:<br /> *   + USB_PROP_IS_DYNAMIC: The data for the descriptor should be fetched<br /> *     at runtime via usbFunctionDescriptor&#40;&#41;.<br /> *   + USB_PROP_IS_RAM: The data returned by usbFunctionDescriptor&#40;&#41; or found<br /> *     in static memory is in RAM, not in flash memory.<br /> *   + USB_PROP_LENGTH&#40;len&#41;: If the data is in static memory &#40;RAM or flash&#41;,<br /> *     the driver must know the descriptor's length. The descriptor itself is<br /> *     found at the address of a well known identifier &#40;see below&#41;.<br /> * List of static descriptor names &#40;must be declared PROGMEM if in flash&#41;:<br /> *   char usbDescriptorDevice&#91;&#93;;<br /> *   char usbDescriptorConfiguration&#91;&#93;;<br /> *   char usbDescriptorHidReport&#91;&#93;;<br /> *   char usbDescriptorString0&#91;&#93;;<br /> *   int usbDescriptorStringVendor&#91;&#93;;<br /> *   int usbDescriptorStringDevice&#91;&#93;;<br /> *   int usbDescriptorStringSerialNumber&#91;&#93;;<br /> * Other descriptors can't be provided statically, they must be provided<br /> * dynamically at runtime.<br /> *<br /> * Descriptor properties are or-ed or added together, e.g.:<br /> * #define USB_CFG_DESCR_PROPS_DEVICE   &#40;USB_PROP_IS_RAM | USB_PROP_LENGTH&#40;18&#41;&#41;<br /> *<br /> * The following descriptors are defined:<br /> *   USB_CFG_DESCR_PROPS_DEVICE<br /> *   USB_CFG_DESCR_PROPS_CONFIGURATION<br /> *   USB_CFG_DESCR_PROPS_STRINGS<br /> *   USB_CFG_DESCR_PROPS_STRING_0<br /> *   USB_CFG_DESCR_PROPS_STRING_VENDOR<br /> *   USB_CFG_DESCR_PROPS_STRING_PRODUCT<br /> *   USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER<br /> *   USB_CFG_DESCR_PROPS_HID<br /> *   USB_CFG_DESCR_PROPS_HID_REPORT<br /> *   USB_CFG_DESCR_PROPS_UNKNOWN &#40;for all descriptors not handled by the driver&#41;<br /> *<br /> */<br /><br />#define USB_CFG_DESCR_PROPS_DEVICE                  0<br />#define USB_CFG_DESCR_PROPS_CONFIGURATION           0<br />#define USB_CFG_DESCR_PROPS_STRINGS                 0<br />#define USB_CFG_DESCR_PROPS_STRING_0                0<br />#define USB_CFG_DESCR_PROPS_STRING_VENDOR           0<br />#define USB_CFG_DESCR_PROPS_STRING_PRODUCT          0<br />#define USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER    0<br />#define USB_CFG_DESCR_PROPS_HID                     0<br />#define USB_CFG_DESCR_PROPS_HID_REPORT              0<br />#define USB_CFG_DESCR_PROPS_UNKNOWN                 0<br /><br />/* ----------------------- Optional MCU Description ------------------------ */<br /><br />/* The following configurations have working defaults in usbdrv.h. You<br /> * usually don't need to set them explicitly. Only if you want to run<br /> * the driver on a device which is not yet supported or with a compiler<br /> * which is not fully supported &#40;such as IAR C&#41; or if you use a differnt<br /> * interrupt than INT0, you may have to define some of these.<br /> */<br />/* #define USB_INTR_CFG            MCUCR */<br />/* #define USB_INTR_CFG_SET        &#40;&#40;1 &lt;&lt; ISC00&#41; | &#40;1 &lt;&lt; ISC01&#41;&#41; */<br />/* #define USB_INTR_CFG_CLR        0 */<br />/* #define USB_INTR_ENABLE         GIMSK */<br />/* #define USB_INTR_ENABLE_BIT     INT0 */<br />/* #define USB_INTR_PENDING        GIFR */<br />/* #define USB_INTR_PENDING_BIT    INTF0 */<br />/* #define USB_INTR_VECTOR         SIG_INTERRUPT0 */<br /><br />#endif /* __usbconfig_h_included__ */<br /><br /></code></pre></div><p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=641">WaaZaa</a> — Wed Dec 05, 2007 1:47 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[WaaZaa]]></name></author>
		<updated>2007-12-05T16:08:09+02:00 </updated>

		<published>2007-12-05T11:53:39+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=891&amp;p=3391#p3391</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=891&amp;p=3391#p3391"/>
		<title type="html"><![CDATA[General joystick HID question]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=891&amp;p=3391#p3391"><![CDATA[
I am still trying to get mine working, as I stated in another thread a little while ago <img class="smilies" src="./../../../images/smilies/icon_wink.gif" alt=";)" title="Wink" /><br /><br />I am trying to get reports sent to the PC, but the avr doesn't seem to be sending anything.. For the record, I am using an atmega16, but that shouldn't change anything..<br /><br />It's strange because the device is recognized by windows, gamecontrollers shows this: <br /><img src="http://www.waazaa.net/img/usbControl.PNG" class="postimage" alt="Image" /><br />I'm guessing this means the enumeration is going correct, but the interrupts after are not received correctly?<br /><br />I also added a usbtrace log on my webserver, the device desciption it gives and a list of transfers received and sent. This is a cycle which keeps repeating itself.. <!-- m --><a class="postlink" href="http://www.waazaa.net/usb/">http://www.waazaa.net/usb/</a><!-- m --><br /><br />I'm just adding my code here..<br /><div class="codebox"><p>Code: </p><pre><code>/**********************Global Variables****************************************/<br />/* Originally used as a mask for the modifier bits, but now also<br />   used for other x -&gt; 2^x conversions &#40;lookup table&#41;. */<br />const char modmask&#91;8&#93; PROGMEM = &#123;0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80&#125;;<br />uchar  adcData&#91;8&#93; =&#123;0,0,0,0,0,0,0,0&#125;; //int to store the AD conversion results in. <br />uchar newDataFound;<br />uchar   updateNeeded = 0;<br /><br />/* The ReportBuffer contains the USB report sent to the PC */<br />static uchar reportBuffer&#91;8&#93; = &#123;0,0,0,0,0,0,0,0&#125;;    /* buffer for HID reports */<br />static uchar idleRate;           /* in 4 ms units */<br /><br /><br />/* Device serial number &#40;length is defined in usbconfig.h&#41; */<br />int usbCfgSerialNumberStringDescriptor&#91;USB_CFG_SERIAL_NUMBER_LENGTH+1&#93; PROGMEM = <br />&#123;<br />    USB_STRING_DESCRIPTOR_HEADER&#40;USB_CFG_SERIAL_NUMBER_LENGTH&#41;,<br />    '1', '3',<br />&#125;;<br /><br />/* USB report descriptor &#40;length is defined in usbconfig.h&#41;*/<br />const char usbHidReportDescriptor&#91;USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH&#93; <br />  PROGMEM = &#123;<br />     0x05, 0x01,                    // USAGE_PAGE &#40;Generic Desktop&#41;<br />    0x15, 0x00,                    // LOGICAL_MINIMUM &#40;0&#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 />    0x95, 0x06,                    //     REPORT_COUNT &#40;6&#41;<br />    0x75, 0x08,                    //     REPORT_SIZE &#40;8&#41;<br />    0x15, 0x80,                    //     LOGICAL_MINIMUM &#40;-128&#41;<br />    0x25, 0x7f,                    //     LOGICAL_MAXIMUM &#40;127&#41;<br />    0x35, 0x00,                    //     PHYSICAL_MINIMUM &#40;0&#41;<br />    0x46, 0xff, 0x00,              //     PHYSICAL_MAXIMUM &#40;255&#41;<br />    0x09, 0x31,                    //     USAGE &#40;Y&#41;<br />    0x09, 0x30,                    //     USAGE &#40;X&#41;<br />    0x09, 0x32,                    //     USAGE &#40;Z&#41;<br />    0x09, 0x33,                    //     USAGE &#40;Rx&#41;<br />    0x09, 0x34,                    //     USAGE &#40;Ry&#41;<br />    0x09, 0x35,                    //     USAGE &#40;Rz&#41;<br />    0x81, 0x02,                    //     INPUT &#40;Data,Var,Abs&#41;<br />    0x95, 0x08,                    //     REPORT_COUNT &#40;8&#41;<br />    0x75, 0x01,                    //     REPORT_SIZE &#40;1&#41;<br />    0x15, 0x00,                    //     LOGICAL_MINIMUM &#40;0&#41;<br />    0x25, 0x01,                    //     LOGICAL_MAXIMUM &#40;1&#41;<br />    0x35, 0x00,                    //     PHYSICAL_MINIMUM &#40;0&#41;<br />    0x45, 0x01,                    //     PHYSICAL_MAXIMUM &#40;1&#41;<br />    0xc0,                          // END_COLLECTION<br />    0x05, 0x09,                    //     USAGE_PAGE &#40;Button&#41;<br />    0x19, 0x01,                    //     USAGE_MINIMUM &#40;Button 1&#41;<br />    0x29, 0x08,                    //     USAGE_MAXIMUM &#40;Button 8&#41;<br />    0x81, 0x02,                    //     INPUT &#40;Data,Var,Abs&#41;<br />    0xc0                           //     END_COLLECTION                  <br />&#125;;<br /><br />/**********************||Global Variables||****************************************/<br /><br /><br /><br /><br />static void hardwareInit&#40;void&#41; &#123;<br />  uchar   i, j;<br /><br />   /* 1101 1000 bin: activate pull-ups except on USB lines <br />    *<br />    * USB signals are on bit 0 and 2. <br />    *<br />    * */<br />   PORTD = 0xf8;   <br /><br />   /* Usb pin are init as outputs */<br />   DDRD = 0x01 | 0x04;    <br /><br />   <br />   j = 0;<br />   while&#40;--j&#41;&#123;     /* USB Reset by device only required on Watchdog Reset */<br />      i = 0;<br />      while&#40;--i&#41;; /* delay &gt;10ms for USB reset */<br />   &#125;<br />   DDRD = 0x00;    /* 0000 0000 bin: remove USB reset condition */<br />   <br />   /* configure timer 0 for a rate of 12M/&#40;1024 * 256&#41; = 45.78 Hz &#40;~22ms&#41; */<br />   TCCR0 = 5;      /* timer 0 prescaler: 1024 */<br /><br />   TCCR2 = &#40;1&lt;&lt;WGM21&#41;|&#40;1&lt;&lt;CS22&#41;|&#40;1&lt;&lt;CS21&#41;|&#40;1&lt;&lt;CS20&#41;;<br />   OCR2 = 196; // for 60 hz<br />&#125;<br /><br /><br />//Initialize the AD converter.<br />void Init_ADC&#40; void &#41;<br />&#123;<br />   //          enable     *      prescaler = 128       *<br />    ADCSRA  = &#40;1&lt;&lt;ADEN&#41;|&#40;1&lt;&lt;ADPS2&#41;|&#40;0&lt;&lt;ADPS1&#41;|&#40;1&lt;&lt;ADPS0&#41;; <br />&#125;<br /><br /><br />uchar   usbFunctionSetup&#40;uchar data&#91;8&#93;&#41; &#123;<br />  usbRequest_t *rq = &#40;void *&#41;data;<br />  usbMsgPtr = reportBuffer;<br />  if&#40;&#40;rq-&gt;bmRequestType &amp; USBRQ_TYPE_MASK&#41; == USBRQ_TYPE_CLASS&#41;&#123;    /* class request type */<br />    if&#40;rq-&gt;bRequest == USBRQ_HID_GET_REPORT&#41;&#123;  /* wValue: ReportType &#40;highbyte&#41;, ReportID &#40;lowbyte&#41; */<br />      /* we only have one report type, so don't look at wValue */<br />      return sizeof&#40;reportBuffer&#41;;<br />    &#125;else if&#40;rq-&gt;bRequest == USBRQ_HID_GET_IDLE&#41;&#123;<br />      usbMsgPtr = &amp;idleRate;<br />      return 1;<br />    &#125;else if&#40;rq-&gt;bRequest == USBRQ_HID_SET_IDLE&#41;&#123;<br />      idleRate = rq-&gt;wValue.bytes&#91;1&#93;;<br />    &#125;<br />  &#125;else&#123;<br />    /* no vendor specific requests implemented */<br />  &#125;<br />   return 0;<br />&#125;<br /><br /><br /> <br />void inDecoderPoll&#40;void&#41;<br />&#123;<br />    <br />   for &#40;unsigned int i = 0; i &lt; 8; i++&#41;    <br />   &#123;<br />        <br />      ADMUX = i;                 // select ADC channel<br />      ADMUX |= &#40;0&lt;&lt;REFS1&#41;|&#40;1&lt;&lt;REFS0&#41;|&#40;1&lt;&lt;ADLAR&#41;; <br />      ADCSRA |= &#40;1&lt;&lt;ADSC&#41;;         // start conversion<br />        while &#40;ADCSRA &amp; &#40;1&lt;&lt;ADSC&#41;&#41;&#123;;&#125; // wait for result &#40;fast, not a problem for USB driver&#41;<br />        adcData&#91;i&#93; = ADCH;          // save to data buffer<br />      <br />    &#125;<br />    // set new data flag<br />    newDataFound = 1;<br />&#125;<br /><br />void buildReport&#40;void&#41;<br />&#123;<br />   for &#40;unsigned int i =0; i&lt;7; i++&#41;<br />   &#123;<br />          //just using channel 7 value for now. <br />      reportBuffer&#91;i+1&#93; = adcData&#91;7&#93;;<br />   &#125;<br />&#125;<br /><br />void testMeth&#40;void&#41;<br />&#123;<br />   <br />   if&#40;usbInterruptIsReady&#40;&#41;&#41;<br />   &#123;<br />      // led on<br />      PORTB = 0x00;<br />      DDRB = 0x01;<br />   &#125;<br />   else <br />   &#123;<br />      //led off.<br />      DDRB = 0x00;<br />   &#125;<br /><br />&#125; <br /><br /><br /><br />int   main&#40;void&#41; &#123;<br />     <br />      <br />   wdt_enable&#40;WDTO_2S&#41;; /* Enable watchdog timer 2s */<br />   hardwareInit&#40;&#41;; /* Initialize hardware &#40;I/O&#41; */<br />   Init_ADC&#40;&#41;;<br /><br />   usbInit&#40;&#41;; /* Initialize USB stack processing */<br />   sei&#40;&#41;; /* Enable global interrupts */<br />      <br />   <br />   for&#40;;;&#41;<br />   &#123;   /* Main loop */<br />      wdt_reset&#40;&#41;; /* Reset the watchdog */<br />      usbPoll&#40;&#41;; /* Poll the USB stack */<br />      <br />      <br />      inDecoderPoll&#40;&#41;;<br />   <br />      /* If an update is needed, send the report */<br />      if&#40;usbInterruptIsReady&#40;&#41;&#41;<br />      &#123;<br />            <br />            buildReport&#40;&#41;;<br />            testMeth&#40;&#41;;<br />            usbSetInterrupt&#40;reportBuffer, sizeof&#40;reportBuffer&#41;&#41;;<br />      &#125;<br />   <br />   &#125;<br />   return 0;<br />&#125;<br /></code></pre></div><p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=641">WaaZaa</a> — Wed Dec 05, 2007 11:53 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[sprhawk]]></name></author>
		<updated>2007-11-21T05:26:13+02:00</updated>

		<published>2007-11-21T05:26:13+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=891&amp;p=3195#p3195</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=891&amp;p=3195#p3195"/>
		<title type="html"><![CDATA[General joystick HID question]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=891&amp;p=3195#p3195"><![CDATA[
<blockquote><div><cite>ozel wrote:</cite>sprhawk:<br /><br />Can you examine your descriptor somehow as its received on your host?<br /><br />I could resolve some of my problems with the great tool evtest under linux.<br />It shows first the supported events of a device in a summary and then just all actual events as they come in.. very helpfull. for example with this I saw setting &quot;0x00, 0xff&quot; as maximum value was not seen as the same as sending just &quot;0xff&quot;. (though the register addreses were set accordingly for 1 or 2 byte)<br /><br /></div></blockquote><br /><br />I solved my problem by replacing the usbdrv with a new one.<br /><br />I didn't find why. It just ok now. Thank you all the same!<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=517">sprhawk</a> — Wed Nov 21, 2007 5:26 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Grendel]]></name></author>
		<updated>2007-11-21T01:47:28+02:00</updated>

		<published>2007-11-21T01:47:28+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=891&amp;p=3193#p3193</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=891&amp;p=3193#p3193"/>
		<title type="html"><![CDATA[General joystick HID question]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=891&amp;p=3193#p3193"><![CDATA[
<blockquote><div><cite>ozel wrote:</cite>After X and Y,  I fill the report descripter properly with 4 bits, to get 4 * 8 in total. How do you put your 10bit values together in the buffer?</div></blockquote><br />The bits are sort of &quot;reversed&quot; in the bytes of the report:<br /><blockquote><div><cite>Grendel wrote:</cite>The report data array is defined as:<br /><br /><div class="codebox"><p>Code: </p><pre><code>uint8_t<br />    sw_report&#91;7&#93; ;                              // USB report data<br /><br />//      USB report data structure<br />//      =========================<br />//<br />//      -------0 -------1 -------2 -------3 -------4 -------5 -------6<br />//      XXXXXXXX YYYYYYXX RRRRYYYY HHHRRRRR BBBBBBBH TTTTTTTB 00000TTT<br />//      76543210 54321098 32109876 21087654 76543213 65432108      987<br />//<br />//      R = Rz, H = POV hat, B = button, T = throttle</code></pre></div></div></blockquote><br />-------0 is byte #0 in sw_report, -------1 byte #1, etc. The bit order in those bytes is 76543210. The coding in the column below each bit tells you what is stored there: X0 = X axis bit #0, Y4 = Y axis bit #4. If you rewrite everything w/ low bits first it's pretty clear how the report works:<br /><div class="codebox"><p>Code: </p><pre><code>//      01234567 01234567 ..<br />//      0------- 1------- 2------- 3------- 4------- 5------- 6-------<br />//      XXXXXXXX XXYYYYYY YYYYRRRR RRRRRHHH HBBBBBBB BTTTTTTT TTT00000<br />//      01234567 89012345 67890123 45678012 31234567 80123456 78900000</code></pre></div><br /><br />The 10bit values are signed BTW. Range is -512 to 511 as defined in logical min/max.<br /><br /><blockquote><div><cite>ozel wrote:</cite>for example with this I saw setting &quot;0x00, 0xff&quot; as maximum value was not seen as the same as sending just &quot;0xff&quot;. (though the register addreses were set accordingly for 1 or 2 byte)</div></blockquote><br />These values are signed -- 0xFF is negative, 0x00FF is not.<br /><br /><blockquote><div><cite>ozel wrote:</cite>Also can someone explain for me what the differences between logical and physical maxiums are, when used for an absolute device? I don't get it! I just set them the same, in this case to 10bit max each.</div></blockquote><br /><br /><blockquote><div><cite>Device Class Definition For HID, v1.11, chapter 6.2.2.7 Global Items wrote:</cite>Logical Minimum 0001 01 nn<br />Extent value in logical units. This is the minimum value that a variable or array item will report. For example, a mouse reporting x position values from 0 to 128 would have a Logical Minimum of 0 and a Logical Maximum of 128.<br /><br />Logical Maximum 0010 01 nn<br />Extent value in logical units. This is the maximum value that a variable or array item will report.<br /><br />Physical Minimum 0011 01 nn<br />Minimum value for the physical extent of a variable item. This represents the Logical Minimum with units applied to it.<br /><br />Physical Maximum 0100 01 nn<br />Maximum value for the physical extent of a variable item.</div></blockquote><p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=101">Grendel</a> — Wed Nov 21, 2007 1:47 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ozel]]></name></author>
		<updated>2007-11-19T23:41:49+02:00</updated>

		<published>2007-11-19T23:41:49+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=891&amp;p=3171#p3171</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=891&amp;p=3171#p3171"/>
		<title type="html"><![CDATA[General joystick HID question]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=891&amp;p=3171#p3171"><![CDATA[
sprhawk:<br /><br />Can you examine your descriptor somehow as its received on your host?<br /><br />I could resolve some of my problems with the great tool evtest under linux.<br />It shows first the supported events of a device in a summary and then just all actual events as they come in.. very helpfull. for example with this I saw setting &quot;0x00, 0xff&quot; as maximum value was not seen as the same as sending just &quot;0xff&quot;. (though the register addreses were set accordingly for 1 or 2 byte)<br /><br />Grendel:<br /><br />thanks a lot for this example and the very clear bit map. but I have to admit that it still doesn't work at my side. I get only 8 bits transmitted properly. When I send 10bit they are chopped up similar like 16bit. I probably shift the bits wrong. I used nearly the same setup as you for my x and y coordinates, there is just one full byte for the mouse buttons infront of x and y:<br /><br /> <div class="codebox"><p>Code: </p><pre><code> <br /><br />//set mouse button one down<br />reportBuffer&#91;0&#93; = 0x01;<br /><br />//shifting x and y for 10bit values<br />reportBuffer&#91;1&#93; = &#40;x &amp; 0xff&#41;; //lower 8 bits of x<br />reportBuffer&#91;2&#93; =  &#40;&#40;y &amp; 0x3f&#41; &lt;&lt; 2&#41; | &#40;8 &gt;&gt; &#40;x &amp; 0x300&#41;&#41;; //high 2 bit of x to the right, 6 low bits of y to the left<br />//               0x3f= 11 1111           0x300 = 11 0000 0000<br />reportBuffer&#91;3&#93; = &#40;6 &gt;&gt; &#40;y &amp; 0x3C0&#41;&#41;;  //0x3c0 = 11 1100 0000 //put the remaining 4 bits of y at the left end<br /></code></pre></div><br /><br />After X and Y,  I fill the report descripter properly with 4 bits, to get 4 * 8 in total. How do you put your 10bit values together in the buffer?<br /><br />Also can someone explain for me what the differences between logical and physical maxiums are, when used for an absolute device? I don't get it! I just set them the same, in this case to 10bit max each.<br /><br />Oli<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=542">ozel</a> — Mon Nov 19, 2007 11:41 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[sprhawk]]></name></author>
		<updated>2007-11-13T18:12:46+02:00</updated>

		<published>2007-11-13T18:12:46+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=891&amp;p=3051#p3051</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=891&amp;p=3051#p3051"/>
		<title type="html"><![CDATA[General joystick HID question]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=891&amp;p=3051#p3051"><![CDATA[
what's this descriptor wrong?<br /><div class="codebox"><p>Code: </p><pre><code>char usbHidReportDescriptor&#91;41&#93; = &#123;<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 />   0x09, 0x30,                    //     USAGE &#40;X&#41;<br />   0x15, 0x80,                    //     LOGICAL_MINIMUM &#40;-128&#41;<br />    0x25, 0x7f,                    //     LOGICAL_MAXIMUM &#40;127&#41;<br />    0x95, 0x01,                    //     REPORT_COUNT &#40;1&#41;<br />    0x75, 0x08,                    //     REPORT_SIZE &#40;8&#41;   <br />   0x81, 0x02,                    //     INPUT &#40;Data,Var,Abs&#41;<br />   0xc0,                          //   END_COLLECTION<br />    0x05, 0x02,                    // USAGE_PAGE &#40;Simulation Controls&#41;<br />    0xa1, 0x00,                    //   COLLECTION &#40;Physical&#41;<br />   0x09, 0xba,                    //     USAGE &#40;Rudder&#41;    <br />   0x15, 0x80,                    //     LOGICAL_MINIMUM &#40;-128&#41;<br />    0x25, 0x7f,                    //     LOGICAL_MAXIMUM &#40;127&#41;<br />    0x75, 0x08,                    //     REPORT_SIZE &#40;8&#41;<br />    0x95, 0x01,                    //     REPORT_COUNT &#40;1&#41;<br />    0x81, 0x02,                    //     INPUT &#40;Data,Var,Abs&#41;<br />    0xc0,                          //   END_COLLECTION<br />    0xc0                           // END_COLLECTION<br />&#125;;<br /></code></pre></div><br /><br />it causes an exclaimination on the USB HID device in Device Manager.<br />I tried the separate the two usage(page) are both ok, but the combination is error.<br /><br />I mean these are OK:<br />1.<br /><div class="codebox"><p>Code: </p><pre><code>char usbHidReportDescriptor&#91;24&#93; = &#123;<br />   0x05, 0x01,                    // USAGE_PAGE &#40;Generic Desktop&#41;<br />   0x09, 0x04,                    // USAGE &#40;Joystick&#41;<br />   0xa1, 0x01,                    // COLLECTION &#40;Application&#41;<br />    0x05, 0x02,                    //    USAGE_PAGE &#40;Simulation Controls&#41;<br />    0xa1, 0x00,                    //   COLLECTION &#40;Physical&#41;<br />   0x09, 0xba,                    //     USAGE &#40;Rudder&#41;    <br />   0x15, 0x80,                    //     LOGICAL_MINIMUM &#40;-128&#41;<br />    0x25, 0x7f,                    //     LOGICAL_MAXIMUM &#40;127&#41;<br />    0x75, 0x08,                    //     REPORT_SIZE &#40;8&#41;<br />    0x95, 0x01,                    //     REPORT_COUNT &#40;1&#41;<br />    0x81, 0x02,                    //     INPUT &#40;Data,Var,Abs&#41;<br />    0xc0,                          //   END_COLLECTION<br />    0xc0                           // END_COLLECTION<br />&#125;;<br /></code></pre></div><br /> and <br /><div class="codebox"><p>Code: </p><pre><code>char usbHidReportDescriptor&#91;24&#93; = &#123;<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 />   0x09, 0x32,                    //     USAGE &#40;X&#41;<br />   0x15, 0x80,                    //     LOGICAL_MINIMUM &#40;-128&#41;<br />    0x25, 0x7f,                    //     LOGICAL_MAXIMUM &#40;127&#41;<br />    0x95, 0x01,                    //     REPORT_COUNT &#40;1&#41;<br />    0x75, 0x08,                    //     REPORT_SIZE &#40;8&#41;   <br />   0x81, 0x02,                    //     INPUT &#40;Data,Var,Abs&#41;<br />   0xc0,                          //   END_COLLECTION<br />    0xc0                           // END_COLLECTION<br />&#125;;<br /></code></pre></div><br /><br />I give both of them two bytes data<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=517">sprhawk</a> — Tue Nov 13, 2007 6:12 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Grendel]]></name></author>
		<updated>2007-11-09T10:05:43+02:00</updated>

		<published>2007-11-09T10:05:43+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=891&amp;p=2982#p2982</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=891&amp;p=2982#p2982"/>
		<title type="html"><![CDATA[General joystick HID question]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=891&amp;p=2982#p2982"><![CDATA[
Here's a working report descriptor for a &quot;live&quot; joystick for reference, 4 axis -- X (10bit),  Y (10bit), Rz (9bit, handle twist), throttle (10bit, slider) -- 8 buttons (4 on the stick, 4 on the base), and a POV hat switch.<br /><br /><div class="codebox"><p>Code: </p><pre><code>#define CFG_HID_REPORT_DESC_SZ_3DP 102<br /><br />PROGMEM char<br />    usbHidReportDesc3DP&#91;&#93; =<br />    &#123;<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 />   0x95,0x02,      //     REPORT_COUNT &#40;2&#41;<br />   0x75,0x0A,      //     REPORT_SIZE &#40;10&#41;<br />   0x16,0x00,0xFE,      //     LOGICAL_MINIMUM &#40;-512&#41;<br />   0x26,0xFF,0x01,      //     LOGICAL_MAXIMUM &#40;511&#41;<br />   0x35,0x00,      //     PHYSICAL_MINIMUM &#40;0&#41;<br />   0x46,0xFF,0x03,      //     PHYSICAL_MAXIMUM &#40;1023&#41;<br />   0xA4,         //     PUSH<br />   0x09,0x30,      //     USAGE &#40;X&#41;<br />   0x09,0x31,      //     USAGE &#40;Y&#41;<br />   0x81,0x02,      //     INPUT &#40;Data,Var,Abs&#41;             20b X/Y<br />   0x95,0x01,      //     REPORT_COUNT &#40;1&#41;<br />   0x75,0x09,      //     REPORT_SIZE &#40;9&#41;<br />   0x16,0x00,0xFF,      //     LOGICAL_MINIMUM &#40;-256&#41;<br />   0x26,0xFF,0x00,      //     LOGICAL_MAXIMUM &#40;255&#41;<br />   0x45,0x2E,      //     PHYSICAL_MAXIMUM &#40;46&#41;<br />   0x65,0x14,      //     UNIT &#40;Eng Rot:Angular Pos&#41;<br />   0x09,0x35,      //     USAGE &#40;Rz&#41;<br />   0x81,0x02,      //     INPUT &#40;Data,Var,Abs&#41;              9b Rz<br />   0x95,0x01,      //     REPORT_COUNT &#40;1&#41;<br />   0x75,0x04,      //     REPORT_SIZE &#40;4&#41;<br />   0x15,0x00,      //     LOGICAL_MINIMUM &#40;0&#41;<br />   0x25,0x07,      //     LOGICAL_MAXIMUM &#40;7&#41;<br />   0x46,0x3B,0x01,      //     PHYSICAL_MAXIMUM &#40;315&#41;<br />   0x09,0x39,      //     USAGE &#40;Hat switch&#41;<br />   0x81,0x42,      //     INPUT &#40;Data,Var,Abs,Null&#41;         4b Hat<br />   0x95,0x04,      //     REPORT_COUNT &#40;4&#41;<br />   0x75,0x01,      //     REPORT_SIZE &#40;1&#41;<br />   0x25,0x01,      //     LOGICAL_MAXIMUM &#40;1&#41;<br />   0x45,0x01,      //     PHYSICAL_MAXIMUM &#40;1&#41;<br />   0x65,0x00,      //     UNIT &#40;None&#41;<br />   0x05,0x09,      //     USAGE_PAGE &#40;Button&#41;<br />   0x19,0x01,      //     USAGE_MINIMUM &#40;Button 1&#41;<br />   0x29,0x04,      //     USAGE_MAXIMUM &#40;Button 4&#41;<br />   0x81,0x02,      //     INPUT &#40;Data,Var,Abs&#41;              4b B1-4<br />   0xC0,         //   END_COLLECTION<br />   0x19,0x05,      //   USAGE_MINIMUM &#40;Button 5&#41;<br />   0x29,0x08,      //   USAGE_MAXIMUM &#40;Button 8&#41;<br />   0x81,0x02,      //   INPUT &#40;Data,Var,Abs&#41;                4b B5-8<br />   0xB4,         //   POP<br />   0x95,0x01,      //   REPORT_COUNT &#40;1&#41;<br />   0x09,0x36,      //   USAGE &#40;Slider&#41;<br />   0x81,0x02,      //   INPUT &#40;Data,Var,Abs&#41;               10b Throttle<br />   0x75,0x05,      //   REPORT_SIZE &#40;5&#41;<br />   0x81,0x01,      //   INPUT &#40;Cnst,Ary,Abs&#41;                5b Fill<br />   0xC0         // END_COLLECTION                       56b -&gt; 7bytes<br />    &#125; ;</code></pre></div><br /><br />The report data array is defined as:<br /><br /><div class="codebox"><p>Code: </p><pre><code>uint8_t<br />    sw_report&#91;7&#93; ;                              // USB report data<br /><br />//      USB report data structure<br />//      =========================<br />//<br />//      -------0 -------1 -------2 -------3 -------4 -------5 -------6<br />//      XXXXXXXX YYYYYYXX RRRRYYYY HHHRRRRR BBBBBBBH TTTTTTTB 00000TTT<br />//      76543210 54321098 32109876 21087654 76543213 65432108      987<br />//<br />//      R = Rz, H = POV hat, B = button, T = throttle</code></pre></div><p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=101">Grendel</a> — Fri Nov 09, 2007 10:05 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ozel]]></name></author>
		<updated>2007-11-09T04:37:03+02:00</updated>

		<published>2007-11-09T04:37:03+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=891&amp;p=2976#p2976</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=891&amp;p=2976#p2976"/>
		<title type="html"><![CDATA[General joystick HID question]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=891&amp;p=2976#p2976"><![CDATA[
hey,<br /><br />no its really strange. I started sending just 8bit, as the touchscreen sensing part is my first goal. I think there is serious knowledge missing, on how all the hid parameters get interpreted. For example it doesn't make much difference at all (on my host), when I change the logical maximums!<br />As I will use my controller on a linux driven device later, I thought, I won't care to much on how it performs on my mac. Maybe the absolute mouse behaviour is later completly different in xorg's window system...<br /><br />But I'd be interetested in your test code, where you said, you could step in 16 bit through all the axis values. Could you post it? I don't care if its no mouse but a joystick profile. I think it could be a good starting point to track the difference to my absolute mouse profile code.<br /><br />Good night,<br />Oli<br />p.s. I know the reset cycles well <img class="smilies" src="./../../../images/smilies/icon_wink.gif" alt=";)" title="Wink" /> just switched off veryfing the flash on uploads, so it gets one second faster... anyone ever used JTAG for debugging? It might save some hours... and not to forget a USB HID analyzer of course <img class="smilies" src="./../../../images/smilies/icon_wink.gif" alt=";)" title="Wink" /><p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=542">ozel</a> — Fri Nov 09, 2007 4:37 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Rukus]]></name></author>
		<updated>2007-11-09T03:44:42+02:00</updated>

		<published>2007-11-09T03:44:42+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=891&amp;p=2975#p2975</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=891&amp;p=2975#p2975"/>
		<title type="html"><![CDATA[General joystick HID question]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=891&amp;p=2975#p2975"><![CDATA[
Ozel,  did you get it working?<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=544">Rukus</a> — Fri Nov 09, 2007 3:44 am</p><hr />
]]></content>
	</entry>
	</feed>
