Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: Connect generic HID device directly to DUEs Native USB port? #31

Open
HellGL opened this issue Aug 7, 2017 · 6 comments
Open

Comments

@HellGL
Copy link

HellGL commented Aug 7, 2017

Hi,
I have a USB HID device that I would like to connect directly to the Native USB port of my DUE. I know what data to expect and what data to send, but I don't know how to approach this problem. Is it at all possible to use this library for that purpose without the USB shield? Do I need to implement my own driver and if so, is there any example for doing this? Thanks for your help.

HellG.


Under linux my device reports the following via lsusb:
Bus 001 Device 044: ID 0c29:020a Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 1.00 bDeviceClass 0 (Defined at Interface level) bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 8 idVendor 0x0c29 idProduct 0x020a bcdDevice 1.00 iManufacturer 0 iProduct 0 iSerial 0 bNumConfigurations 1 Configuration Descriptor: bLength 9 bDescriptorType 2 wTotalLength 34 bNumInterfaces 1 bConfigurationValue 1 iConfiguration 0 bmAttributes 0x40 (Missing must-be-set bit!) Self Powered MaxPower 4mA Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 0 bAlternateSetting 0 bNumEndpoints 1 bInterfaceClass 3 Human Interface Device bInterfaceSubClass 0 No Subclass bInterfaceProtocol 0 None iInterface 0 HID Device Descriptor: bLength 9 bDescriptorType 33 bcdHID 1.00 bCountryCode 8 French bNumDescriptors 1 bDescriptorType 34 Report wDescriptorLength 63 Report Descriptor: (length is 63) Item(Global): Usage Page, data= [ 0x00 ] 0 Undefined Item(Local ): Usage, data= [ 0x00 ] 0 (null) Item(Main ): Collection, data= [ 0x01 ] 1 Application Item(Global): Report ID, data= [ 0x01 ] 1 Item(Local ): Usage Minimum, data= [ 0x01 ] 1 (null) Item(Local ): Usage Maximum, data= [ 0x68 ] 104 (null) Item(Global): Logical Minimum, data= [ 0x00 ] 0 Item(Global): Logical Maximum, data= [ 0x01 ] 1 Item(Global): Report Count, data= [ 0x68 ] 104 Item(Global): Report Size, data= [ 0x01 ] 1 Item(Main ): Input, data= [ 0x02 ] 2 Data Variable Absolute No_Wrap Linear Preferred_State No_Null_Position Non_Volatile Bitfield Item(Global): Usage Page, data= [ 0x00 ] 0 Undefined Item(Local ): Usage, data= [ 0x00 ] 0 (null) Item(Global): Report ID, data= [ 0x01 ] 1 Item(Local ): Usage Minimum, data= [ 0x01 ] 1 (null) Item(Local ): Usage Maximum, data= [ 0x38 ] 56 (null) Item(Global): Report Count, data= [ 0x38 ] 56 Item(Global): Report Size, data= [ 0x01 ] 1 Item(Main ): Output, data= [ 0x02 ] 2 Data Variable Absolute No_Wrap Linear Preferred_State No_Null_Position Non_Volatile Bitfield Item(Global): Report ID, data= [ 0x02 ] 2 Item(Local ): Usage Minimum, data= [ 0x01 ] 1 (null) Item(Local ): Usage Maximum, data= [ 0x38 ] 56 (null) Item(Global): Report Count, data= [ 0x38 ] 56 Item(Global): Report Size, data= [ 0x01 ] 1 Item(Main ): Output, data= [ 0x02 ] 2 Data Variable Absolute No_Wrap Linear Preferred_State No_Null_Position Non_Volatile Bitfield Item(Global): Report ID, data= [ 0x03 ] 3 Item(Local ): Usage Minimum, data= [ 0x01 ] 1 (null) Item(Local ): Usage Maximum, data= [ 0x18 ] 24 (null) Item(Global): Report Count, data= [ 0x18 ] 24 Item(Global): Report Size, data= [ 0x01 ] 1 Item(Main ): Output, data= [ 0x02 ] 2 Data Variable Absolute No_Wrap Linear Preferred_State No_Null_Position Non_Volatile Bitfield Item(Main ): End Collection, data=none Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 3 Transfer Type Interrupt Synch Type None Usage Type Data wMaxPacketSize 0x000e 1x 14 bytes bInterval 4 Device Status: 0x0001 Self Powered

@xxxajk
Copy link
Collaborator

xxxajk commented Aug 7, 2017 via email

@HellGL
Copy link
Author

HellGL commented Aug 7, 2017

Ok, lets start with: https://www.google.de/search?q=kinetis ...
So short answer is rather: yes, but not for me.

But why is it not possible to start with the UHS_HID library? Sorry for the misaligned printout above. The item itself reports to be a HID device (bInterfaceClass 3 Human Interface Device) but I don't understand the HID example. I know my device sends 14 bytes per package of data to the host and can receive 20 bytes of configuration data, but I don't know where to send these...

@xxxajk
Copy link
Collaborator

xxxajk commented Aug 7, 2017 via email

@xxxajk
Copy link
Collaborator

xxxajk commented Aug 7, 2017 via email

@HellGL
Copy link
Author

HellGL commented Aug 8, 2017

Thanks for your input. I found a XBOX Controller driver for USBHost library that I understand much better and I will try to derive my code from this example: http://forum.arduino.cc/index.php?topic=283058
If this dosn't work as expected I will come back.

@xxxajk
Copy link
Collaborator

xxxajk commented Aug 9, 2017

It won't without a lot of porting, unless you actually have a board with the MAX3421E on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants