<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.arm.com/utility/feedstylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>2 HIDs in one composite USB code</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/31001/2-hids-in-one-composite-usb-code</link><description> 
I need to write 2HIds in one composite device in STM32
microcontrollers.One for pointer mouse operation and other one for
keypad operation.So i wish to know is it possible to do so?If yes
will I need to write 2 separate report descriptors.I am using</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: 2 HIDs in one composite USB code</title><link>https://community.arm.com/thread/143457?ContentTypeID=1</link><pubDate>Wed, 13 Nov 2013 07:09:22 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:5527c647-1150-4ca0-9ccc-fa43fe15f233</guid><dc:creator>Chinzei Tsuneo</dc:creator><description>&lt;p&gt;&lt;p&gt;
&lt;i&gt;&amp;gt; I am using STM32F103R8&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
And what is the USB library?&lt;/p&gt;

&lt;p&gt;
Tsuneo&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 2 HIDs in one composite USB code</title><link>https://community.arm.com/thread/140647?ContentTypeID=1</link><pubDate>Tue, 12 Nov 2013 02:49:29 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:4fffd1ea-c79f-4c5d-8364-30e252dff988</guid><dc:creator>dhanush nair</dc:creator><description>&lt;p&gt;&lt;p&gt;
I am using STM32F103R8 and making it work as keypad-controller ***
pointing device.&lt;/p&gt;

&lt;p&gt;
It was working for both individually however together they always
fail.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 2 HIDs in one composite USB code</title><link>https://community.arm.com/thread/137060?ContentTypeID=1</link><pubDate>Tue, 12 Nov 2013 02:09:51 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:dd72a9df-0ae6-4bcd-859b-f7afdaa1291d</guid><dc:creator>Chinzei Tsuneo</dc:creator><description>&lt;p&gt;&lt;p&gt;
&lt;i&gt;&amp;gt; Can you also explain me how to proceed with 2HID report
descriptor composite device ??&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
The implementation of composite device heavily depends on the USB
stack on which you are working. Not just the descriptors, you have to
modify&lt;br /&gt;
- Get_Descriptor( HID_Report ) process&lt;br /&gt;
- Enabling additional EP(s)&lt;br /&gt;
etc.&lt;/p&gt;

&lt;p&gt;
Which one are you playing?&lt;br /&gt;
- Keil RL-USB&lt;br /&gt;
- ST&amp;#39;s STSW-STM32046 - STM32_USB-Host-Device_Lib_V2.1.0&lt;br /&gt;
- ST&amp;#39;s STSW-STM32121 - STM32_USB-FS-Device_Lib_V4.0.0&lt;br /&gt;
etc.&lt;/p&gt;

&lt;p&gt;
Tsuneo&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 2 HIDs in one composite USB code</title><link>https://community.arm.com/thread/128377?ContentTypeID=1</link><pubDate>Tue, 12 Nov 2013 00:46:18 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:a4cdf9c7-651d-4061-a1d4-9c57cc43e798</guid><dc:creator>dhanush nair</dc:creator><description>&lt;p&gt;&lt;p&gt;
Hi Tsuneo ,&lt;/p&gt;

&lt;p&gt;
Can you also explain me how to proceed with 2HID report descriptor
composite device ??&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 2 HIDs in one composite USB code</title><link>https://community.arm.com/thread/117416?ContentTypeID=1</link><pubDate>Tue, 12 Nov 2013 00:37:02 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:c8691106-5d70-4a57-84d8-3b7a8ca4df41</guid><dc:creator>dhanush nair</dc:creator><description>&lt;p&gt;&lt;p&gt;
Hi Tsuneo ,&lt;/p&gt;

&lt;p&gt;
I tried doing as you said , I wrote report id (1) , then copied
Mouse HID and Report id(2) ,then copied keyboard HID and changed
descriptor size accordingly . Thats it . However this time my PC is
not detecting the new HID, It shows an exclamation mark along side
and noew i am stuck .Is there anything else to do . Can you once
again explain in detail how to sending both mouse and keyboard data
through the same interface and same endpoint . Because I didnt
understand the idea.How OS understands that which is report id and
which is data.&lt;/p&gt;

&lt;p&gt;
The actual mouse data sends 4 bytes ,So now iam sending 5 bytes
i.e reportid + 4byte mouse data&lt;br /&gt;
It seems that I am doing something wrong somewhere.. ;)&lt;/p&gt;

&lt;p&gt;
Dhanush&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 2 HIDs in one composite USB code</title><link>https://community.arm.com/thread/107373?ContentTypeID=1</link><pubDate>Sun, 03 Nov 2013 01:48:31 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:b7941bd4-2173-4572-be55-51ac099b4ce0</guid><dc:creator>Chinzei Tsuneo</dc:creator><description>&lt;p&gt;&lt;p&gt;
&lt;i&gt;&amp;gt; 1. In Multi-TLCs as Rport-ID comes to picture
Modifier-type ( INPUT(DATA,VARIABLE,ABSOLUTE) )&lt;br /&gt;
so do i need to change INPUT (0x81)&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
Report ID is applied when the report descriptor defines two or
more Input (or Output or Feature) reports,&lt;br /&gt;
to identify each report. Report ID doesn&amp;#39;t have any other side
effect.&lt;br /&gt;
You may bind keyboard and mouse report descriptors without any
change.&lt;/p&gt;

&lt;p&gt;
&lt;i&gt;&amp;gt; 2. Mine is a custom Keypad with 30 buttons but still i
will be sending 9 bytes ???&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
As Per said, yes.&lt;/p&gt;

&lt;p&gt;
&lt;i&gt;&amp;gt; 3. My mouse sends 4 bytes from ENDP1 so as ReportID comes
to picture will this increment to 5 bytes ???&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
One-byte of Report ID (2) preceeds your original mouse input
report,&lt;br /&gt;
to distiguish it from the keyboard input report (report ID 1).&lt;/p&gt;

&lt;p&gt;
&lt;i&gt;&amp;gt; 4. My keypad is custom one so i am using both ENDP1 and
ENDP2 in my HID for keypad.&lt;br /&gt;
So my interface will be 1 and endpoints 2 . Am I correct ???&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
HID device should have single interrupt IN endpoint.&lt;br /&gt;
If your &amp;quot;custom&amp;quot; keyboard would really need two IN EPs, you may
append another keyboard report descriptor (TLC) for the second
keyboard, and assign report ID 3 to it.&lt;/p&gt;

&lt;p&gt;
But I believe, even for &amp;quot;custom&amp;quot; keyboard, two keyboards aren&amp;#39;t
required.&lt;br /&gt;
For example of full-keybaord, all keytops of alphabet, tenkeys,
function keys are supported by single TLC.&lt;/p&gt;

&lt;p&gt;
Anyway, tell the details of your customization.&lt;/p&gt;

&lt;p&gt;
Tsuneo&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 2 HIDs in one composite USB code</title><link>https://community.arm.com/thread/107371?ContentTypeID=1</link><pubDate>Fri, 01 Nov 2013 22:57:28 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:c80fec9a-9182-4783-b8bf-87a92f87ddc5</guid><dc:creator>ImPer Westermark</dc:creator><description>&lt;p&gt;&lt;p&gt;
&amp;quot;2. Mine is a custom Keypad with 30 buttons but still i will be
sending 9 bytes ???&amp;quot;&lt;/p&gt;

&lt;p&gt;
The total number of keys on the keyboard doesn&amp;#39;t matter. The
standard 8-byte message have 6 bytes to report which buttons are
concurrently pressed.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 2 HIDs in one composite USB code</title><link>https://community.arm.com/thread/81542?ContentTypeID=1</link><pubDate>Fri, 01 Nov 2013 22:25:01 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:ba7b06c6-a229-4f24-a9eb-37a4264ee195</guid><dc:creator>dhanush nair</dc:creator><description>&lt;p&gt;&lt;p&gt;
Hi Tsuneo ,&lt;/p&gt;

&lt;p&gt;
Your idea of Multi-TLCs seems good but actually I already
proceeded with 2 HID composite device and now I am stuck in need for
multiple Report descriptors.So I will switch to Multi-TLC&lt;/p&gt;

&lt;p&gt;
I have small doubts in the descriptors:&lt;/p&gt;

&lt;p&gt;
1. In Multi-TLCs as Rport-ID comes to picture Modifier-type (
INPUT(DATA,VARIABLE,ABSOLUTE) )&lt;br /&gt;
so do i need to change INPUT (0x81)&lt;/p&gt;

&lt;p&gt;
2. Mine is a custom Keypad with 30 buttons but still i will be
sending 9 bytes ???&lt;/p&gt;

&lt;p&gt;
3. My mouse sends 4 bytes from ENDP1 so as ReportID comes to
picture will this increment to 5 bytes ???&lt;/p&gt;

&lt;p&gt;
4. My keypad is custom one so i am using both ENDP1 and ENDP2 in
my HID for keypad.&lt;br /&gt;
So my interface will be 1 and endpoints 2 . Am I correct ???&lt;/p&gt;

&lt;p&gt;
Regards,&lt;br /&gt;
Dhanush&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 2 HIDs in one composite USB code</title><link>https://community.arm.com/thread/62377?ContentTypeID=1</link><pubDate>Fri, 01 Nov 2013 10:03:02 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:18fc479c-3ce8-489e-9353-634a2bcf84ee</guid><dc:creator>Chinzei Tsuneo</dc:creator><description>&lt;p&gt;&lt;p&gt;
Two HID &amp;quot;device&amp;quot; on single USB device&lt;/p&gt;

&lt;p&gt;
There are two ways,&lt;br /&gt;
a) Multi-TLCs (Top-Level Collections) on single HID&lt;br /&gt;
b) HID + HID interfaces on composite device&lt;/p&gt;

&lt;p&gt;
a) is easier than b), when you have base code of both.&lt;/p&gt;

&lt;p&gt;
In Multi-TLCs method, the major modification is applied just to
the report descriptor.&lt;/p&gt;

&lt;p&gt;
a-1) Report descriptor&lt;br /&gt;
When you start with keyboard example,&lt;br /&gt;
- Insert &amp;quot;REPORT ID (1)&amp;quot; before the keyboard report descriptor&lt;br /&gt;
- Append &amp;quot;REPORT ID (2)&amp;quot; after the keyboard report descriptor&lt;br /&gt;
- Append mouse report descriptor, as is&lt;/p&gt;

&lt;pre&gt;
Report descriptor
- REPORT ID (1)   0x85, 0x01
- - full-contents of keyboard report descriptor
- REPORT ID (2)   0x85, 0x02
- - full-contents of mouse report descriptor
&lt;/pre&gt;

&lt;p&gt;
Of course, the size of report descriptor increases by the
appendage.&lt;br /&gt;
Tune the constant (#define) of the report descriptor size,&lt;br /&gt;
referred at HID interface, and Get_Descriptor( HID_REPORT )
process.&lt;/p&gt;

&lt;p&gt;
a-2) Report ID&lt;br /&gt;
As the one-byte report ID is attached before each input/output
report,&lt;/p&gt;

&lt;p&gt;
- wMaxPacketSize field of the interrupt IN/OUT endpoint
descriptors should be tuned to fit to this report size. Usually,
&amp;quot;standard&amp;quot; keyboard puts 8 bytes input report (1 modifier, 1
constant, 6 key index array), at least 9 bytes (+1 byte report ID) is
required.&lt;/p&gt;

&lt;pre&gt;
    /******************** Descriptor of Joystick Mouse endpoint ********************/
    /* 27 */
    0x07,          /*bLength: Endpoint Descriptor size*/
    USB_ENDPOINT_DESCRIPTOR_TYPE, /*bDescriptorType:*/

    0x81,          /*bEndpointAddress: Endpoint Address (IN)*/
    0x03,          /*bmAttributes: Interrupt endpoint*/
    0x04,          /*wMaxPacketSize: 4 Byte max */      // &amp;lt;------ 9 bytes
    0x00,
    0x20,          /*bInterval: Polling Interval (32 ms)*/  // &amp;lt;---- 1ms is better
&lt;/pre&gt;

&lt;p&gt;
The interrupt IN endpoint is shared by keyboard and mouse.&lt;br /&gt;
The keyboard code puts an input report with one-byte report ID
(1).&lt;br /&gt;
- 1 (report ID), keyboard input report follows.&lt;/p&gt;

&lt;p&gt;
The mouse code puts an input report with one-byte report ID
(2).&lt;br /&gt;
- 2 (report ID), mouse input report follows.&lt;/p&gt;

&lt;p&gt;
That&amp;#39;s all&lt;/p&gt;

&lt;p&gt;
Tsuneo&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>