<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Kinetis Microcontrollersのトピック2 HIDs in one Composite device</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/2-HIDs-in-one-Composite-device/m-p/183799#M1879</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I resolved my problem: only correct configuration.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 04 Dec 2011 16:46:27 GMT</pubDate>
    <dc:creator>evgenik</dc:creator>
    <dc:date>2011-12-04T16:46:27Z</dc:date>
    <item>
      <title>2 HIDs in one Composite device</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/2-HIDs-in-one-Composite-device/m-p/183798#M1878</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I runned 2 projects for Kinetis K40 from Freescale USB Stack v3.1.1&amp;nbsp;exmples: HID mouse device and HID keyboard device. After this I tried to change code for define into one system 'Composite device' with HID mouse and Keyboard definitions as in the both projects. I changed code in 'usb_descriptor.c' file :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;uint_8 USB_DESC_CONST g_config_descriptor[CONFIG_DESC_SIZE] =&lt;BR /&gt;{&lt;BR /&gt;CONFIG_ONLY_DESC_SIZE, // bLength - Configuration Descriptor Size - always 9 bytes&lt;BR /&gt;USB_CONFIG_DESCRIPTOR, // bDescriptorType - "Configuration" type of descriptor&lt;BR /&gt;CONFIG_DESC_SIZE, 0x00, // bTotalLength - Total length of the Configuration descriptor&lt;BR /&gt;&amp;nbsp;2, // bNumInterfaces&lt;/P&gt;&lt;P&gt;1, // bConfigurationValue - Configuration Value&lt;BR /&gt;0, // iConfiguration - Configuration Description String Index&lt;BR /&gt;BUS_POWERED|SELF_POWERED|(REMOTE_WAKEUP_SUPPORT&amp;lt;&amp;lt;REMOTE_WAKEUP_SHIFT),&lt;BR /&gt;// bmAttributes - Attributes.support RemoteWakeup and self power&lt;BR /&gt;// S08/CFv1 are both self powered (its compulsory to set bus powered)&lt;BR /&gt;0x32, // bMaxPower(mA) - 50 mA - Current draw from bus&lt;BR /&gt;// &amp;lt;= 100mA: Low power&lt;BR /&gt;// &amp;lt;= 500mA: High power&lt;BR /&gt;&lt;BR /&gt;// Keyboard descriptors&lt;BR /&gt;/* ----------- Interface 0 Descriptor ----------- */&lt;BR /&gt;IFACE_ONLY_DESC_SIZE, // bLength&lt;BR /&gt;USB_IFACE_DESCRIPTOR, // bDescriptorType&lt;BR /&gt;0x00, // bInterfaceNumber&lt;BR /&gt;0x00, // bAlternateSetting&lt;BR /&gt;HID_DESC_ENDPOINT_COUNT, // bNumEndpoints&lt;BR /&gt;0x03, // bInterfaceClass (HID)&lt;BR /&gt;0x01, // bInterfaceSubClass&lt;BR /&gt;0x01, /* 0x01 for keyboard */ // bInterfaceProcotol&lt;BR /&gt;0x00,// iInterface&lt;/P&gt;&lt;P&gt;/* ----------- HID 0 descriptor ----------------- */&lt;BR /&gt;HID_ONLY_DESC_SIZE, // bLength&lt;BR /&gt;USB_HID_DESCRIPTOR, // bDescriptorType&lt;BR /&gt;0x00,0x01, // bcdHID (ver1.00)&lt;BR /&gt;0x00, // bCountryCode&lt;BR /&gt;0x01, // bNumDescriptors&lt;BR /&gt;0x22, // bDescriptorType&lt;BR /&gt;0x3F,0x00, // wDescriptorLength - report descriptor size to follow&lt;BR /&gt;&lt;BR /&gt;/* ----------- Endpoint 0 descriptor ------------ */&lt;BR /&gt;ENDP_ONLY_DESC_SIZE, // bLength&lt;BR /&gt;USB_ENDPOINT_DESCRIPTOR, // bDescriptorType&lt;BR /&gt;HID_ENDPOINT|(USB_SEND &amp;lt;&amp;lt; 7), // bEndpointAddress&lt;BR /&gt;USB_INTERRUPT_PIPE, // bmAttributes&lt;BR /&gt;HID_ENDPOINT_PACKET_SIZE, 0x00, // MaxPacketSize&lt;BR /&gt;0x0A, // bInterval&lt;BR /&gt;#endif&lt;BR /&gt;#if (defined HID_MOUSE) || (defined HID_KEYBOARD_MOUSE)&lt;/P&gt;&lt;P&gt;// Mouse descriptors&lt;BR /&gt;/* ----------- Interface 1 Descriptor ----------- */&lt;BR /&gt;IFACE_ONLY_DESC_SIZE, // bLength&lt;BR /&gt;USB_IFACE_DESCRIPTOR, // bDescriptorType&lt;BR /&gt;0x00, // bInterfaceNumber&lt;BR /&gt;0x00, // bAlternateSetting&lt;BR /&gt;HID_DESC_ENDPOINT_COUNT, // bNumEndpoints&lt;BR /&gt;0x03, // bInterfaceClass (HID)&lt;BR /&gt;0x01, // bInterfaceSubClass&lt;BR /&gt;0x02, /* 0x02 for mouse */ // bInterfaceProcotol&lt;BR /&gt;0x00, // iInterface&lt;BR /&gt;&lt;BR /&gt;/* ----------- HID 1 descriptor ----------------- */&lt;BR /&gt;HID_ONLY_DESC_SIZE, // bLength&lt;BR /&gt;USB_HID_DESCRIPTOR, // bDescriptorType&lt;BR /&gt;0x00,0x01, // bcdHID (ver1.00)&lt;BR /&gt;0x00, // bCountryCode&lt;BR /&gt;0x01, // bNumDescriptors&lt;BR /&gt;0x22, // bDescriptorType&lt;BR /&gt;0x34,0x00, // wDescriptorLength - report descriptor size to follow&lt;/P&gt;&lt;P&gt;/* ----------- Endpoint 1 descriptor ------------ */&lt;BR /&gt;ENDP_ONLY_DESC_SIZE, // bLength&lt;BR /&gt;USB_ENDPOINT_DESCRIPTOR, // bDescriptorType&lt;BR /&gt;HID_ENDPOINT|(USB_SEND &amp;lt;&amp;lt; 7), // bEndpointAddress&lt;BR /&gt;USB_INTERRUPT_PIPE, // bmAttributes&lt;BR /&gt;HID_ENDPOINT_PACKET_SIZE, 0x00, // MaxPacketSize&lt;BR /&gt;0x0A // bInterval&lt;BR /&gt;#endif&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;uint_8 USB_DESC_CONST g_report_descriptor[REPORT_DESC_SIZE] =&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;0x05, 0x01, // Usage Page (Generic Desktop)&lt;BR /&gt;0x09, 0x06, // Usage (Keyboard)&lt;BR /&gt;0xa1, 0x01, // Collection (Application)&lt;BR /&gt;0x05, 0x07, // Usage Page (Keyboard)&lt;BR /&gt;&lt;BR /&gt;0x19, 0xe0, // Usage Minimun (Keyboard LeftControl)&lt;BR /&gt;0x29, 0xe7, // Usage Maximum (Keyboard Right GUI)&lt;BR /&gt;0x15, 0x00, // logical Minimun (0)&lt;BR /&gt;0x25, 0x01, // logical Maximum (1)&lt;BR /&gt;&lt;BR /&gt;0x75, 0x01, // Report Size (1)&lt;BR /&gt;0x95, 0x08, // Report count (8)&lt;BR /&gt;0x81, 0x02, // Input (Data,Var,Abs) modifier keys (CTRL, ALT, etc...&lt;BR /&gt;0x95, 0x01, // Report count (1)&lt;BR /&gt;&lt;BR /&gt;0x75, 0x08, // Report Size (8)&lt;BR /&gt;0x81, 0x01, // Input (Cnst,Var,Abs) filupp to byte boundary&lt;BR /&gt;0x95, 0x05, // Report count (5)&lt;BR /&gt;0x75, 0x01, // Report Size (1)&lt;BR /&gt;&lt;BR /&gt;0x05, 0x08, // Usage Page (LEDs)&lt;BR /&gt;0x19, 0x01, // Usage Minimun (Num Lock)&lt;BR /&gt;0x29, 0x05, // Usage Maximum (Kana)&lt;BR /&gt;0x91, 0x02, // Output (Data,Var,Abs) pc-&amp;gt;kbd&lt;BR /&gt;&lt;BR /&gt;0x95, 0x01, // Report count (1)&lt;BR /&gt;0x75, 0x03, // Report Size (3&lt;BR /&gt;0x91, 0x01, // Output (Cnst,Var,Abs) filupp to byte boundary&lt;BR /&gt;0x95, 0x06, // Report count (6)&lt;BR /&gt;&lt;BR /&gt;0x75, 0x08, // Report Size (8)&lt;BR /&gt;0x15, 0x00, // logical Minimun (0)&lt;BR /&gt;0x25, 0x65, // logical Maximum (101)&lt;BR /&gt;0x05, 0x07, // Usage Page (Keyboard)&lt;BR /&gt;&lt;BR /&gt;0x19, 0x00, // Usage Minimun (Reserved (no event indicated))&lt;BR /&gt;0x29, 0x65, // Usage Maximum (Keyboard Application)&lt;BR /&gt;0x81, 0x00, // Input (Data,Ary,Abs) array for pressed keys&lt;BR /&gt;0xc0, // End collection&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;0x05, 0x01, // Usage Page (Generic Desktop)&lt;BR /&gt;0x09, 0x02, // Usage (Mouse)&lt;BR /&gt;0xA1, 0x01, // Collection (Application)&lt;BR /&gt;0x09, 0x01, // Usage (Pointer)&lt;/P&gt;&lt;P&gt;0xA1, 0x00, // Collection (Physical)&lt;BR /&gt;0x05, 0x09, // Usage Page (Buttons)&lt;BR /&gt;0x19, 0x01, // Usage Minimun (01)&lt;BR /&gt;0x29, 0x03, // Usage Maximum (03)&lt;/P&gt;&lt;P&gt;0x15, 0x00, // logical Minimun (0)&lt;BR /&gt;0x25, 0x01, // logical Maximum (1)&lt;BR /&gt;0x95, 0x03, // Report Count (3)&lt;BR /&gt;0x75, 0x01, // Report Size (1)&lt;/P&gt;&lt;P&gt;0x81, 0x02, // Input(Data, Variable, Absolute) 3 button bits&lt;BR /&gt;0x95, 0x01, // Report count (1)&lt;BR /&gt;0x75, 0x05, // Report Size (5)&lt;BR /&gt;0x81, 0x01, // Input (Constant), 5 bit padding&lt;/P&gt;&lt;P&gt;0x05, 0x01, // Usage Page (Generic Desktop)&lt;BR /&gt;0x09, 0x30, // Usage (X)&lt;BR /&gt;0x09, 0x31, // Usage (Y)&lt;BR /&gt;0x09, 0x38, // Usage (Z)&lt;/P&gt;&lt;P&gt;0x15, 0x81, // Logical Minimum (-127)&lt;BR /&gt;0x25, 0x7F, // Logical Maximum (127)&lt;BR /&gt;0x75, 0x08, // Report Size (8)&lt;BR /&gt;0x95, 0x03, // Report Count (2)&lt;/P&gt;&lt;P&gt;0x81, 0x06, // Input(Data, Variable, Relative), 2 position bytes (X &amp;amp; Y)&lt;BR /&gt;0xC0, // End collection&lt;BR /&gt;0xC0 // End collection&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How programm shall call to Endpoint0 or to&amp;nbsp;Endpoin1? What I need additional to change?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;Evgeni Kosakovski.&lt;/P&gt;&lt;P&gt;R&amp;amp;D Engineer&lt;/P&gt;&lt;P&gt;evgenik@highseclabs.com&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Nov 2011 21:40:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/2-HIDs-in-one-Composite-device/m-p/183798#M1878</guid>
      <dc:creator>evgenik</dc:creator>
      <dc:date>2011-11-17T21:40:31Z</dc:date>
    </item>
    <item>
      <title>2 HIDs in one Composite device</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/2-HIDs-in-one-Composite-device/m-p/183799#M1879</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I resolved my problem: only correct configuration.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 04 Dec 2011 16:46:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/2-HIDs-in-one-Composite-device/m-p/183799#M1879</guid>
      <dc:creator>evgenik</dc:creator>
      <dc:date>2011-12-04T16:46:27Z</dc:date>
    </item>
    <item>
      <title>Re: 2 HIDs in one Composite device</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/2-HIDs-in-one-Composite-device/m-p/183800#M1880</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN&gt;evgenik&amp;nbsp;- what did you change to fix the issue? I'm running into the same issue in MQX.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Aug 2012 01:24:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/2-HIDs-in-one-Composite-device/m-p/183800#M1880</guid>
      <dc:creator>admin</dc:creator>
      <dc:date>2012-08-23T01:24:36Z</dc:date>
    </item>
  </channel>
</rss>

