2017-05-13 05:40 PM
Hi I would like to ask if it is possible to use 2 end point for HID device?
for example: EP1 IN and out for maintenance commands/status
then EP2 IN and out for remote command and status
for transfer mode, i like to have the first as interrupt transfer then the other as bulk transfer..
if not possible, both interrupt transfer..
can anyone give me advice on this? is this feasible using generic HID driver?
Thanks,
Mike
2017-05-16 05:46 AM
Well, physically there are enough EPs available in MCU. But there is a restriction for HID device - it can only have 1 IN and 1 OUT endpoints, so I'm afraid you won't be able to configure 2 IN endpoints in a single HID interface.
However, you can make it a composite device with 2 separate HID devices, with each having its own IN EP. For this purpose you would need to change descriptors respectively, to add second interface descriptor, HID report descriptor for it and so on.
By the way, why do you think you would need to use two IN EPs? Is this something related with max throughput?
Basically speaking, you could define two or more collections in one HID report descriptor and send different types of reports using single IN EP..
2017-05-16 10:07 AM
Hi,
Thanks for the reply.
If composite device is possible, that will fit my project also.
'By the way, why do you think you would need to use two IN EPs? Is this something related with max throughput?'
- I did not think it could increase
throughput, but if it could, i would be also good. Right now, it think there is no way I can extend 64 byte
per report tp 512 bytes for HID. Im constrained to HID because of project requirement and may be, the benefit of no need to install driver compared to
generic usb drivers. In my image, I cannot use Bulk transfer with HID right?
The real reason why I like to use 2 end point is, the device im creating has two functions for external output.
1.) Status report and result report. for some weird reason, my client request us to have some sort of protocol exchange for geting status and result,
similar to RS232 standard, with ENQ/ACK/Checksum and EOT..
2.)I will be implementing remote operation where i'm planning to send LCD display from VRAM of my panel to mirror the device GUI to the Application using USB.
I dont like to put such complicated control for this function. My image is I will just use simple Report strucutre. My image also is I will use DMA to transfer data from
panels VRAM directly to endpoint.. though I still have to consider maybe I have to append control for each record packet.
Bottom line is, I dont want to mix up these 2 functions of my device.
I will research how to implement and try it for now. If you have some advice, I would really appreciate it.
Thanks,
Mike
2017-05-16 10:09 AM
Im using STM32F103ZE.
2017-05-16 01:17 PM
If you like to separate two logical functions of your HID device then you definitely don't need to have an additional endpoint for that. Let's imaging a complex HID deivce - keyboard with a trackball. It has two different usage collections defined in its HID descriptor - one is for keyboard and another one for trackball. So that these functions are logically separated.
It sends different reports for these functions, but still it is a single HID device which uses a single IN EP.
However, as for bulk data transferring, I don't think it is a good idea to use HID for this purpose. Of course it would be technically feasible, but you would experience serious limitations and performance problems. I would recommend you to setup a composite device with two interfaces: HID for commands, statuses, etc and CDC for bulk data transfer. You would not need to use any custom driver for CDC device either. It will appear just like an additional COM port in your host system.