|
|
View previous topic :: View next topic |
Author |
Message |
Prefekt
Joined: 21 Oct 2010 Posts: 85
|
USB HID with more then 2 bytes |
Posted: Wed Aug 28, 2013 11:28 am |
|
|
Hello,
I have tried the ex_usb_hid example. I need to transmit more then 2 bytes in both directions.
But I don't know what I must change.
In the documentation is written to change the package size, but how?
thanks
Volker |
|
|
Prefekt
Joined: 21 Oct 2010 Posts: 85
|
|
Posted: Wed Aug 28, 2013 1:02 pm |
|
|
I have change this value to transmit 3 bytes...
in usb_cdc_hid.h:
Code: |
0x75, 8, // Report size = 8 (bits)
0x95, 3, // Report count = 16 bits (2 bytes)
0x81, 3, // Input (Data, Var, Abs)
0x19, 1, // Usage minimum
0x29, 8, // Usage maximum
0x75, 8, // Report size = 8 (bits)
0x95, 3, // Report count = 16 bits (2 bytes)
0x91, 3, // Output (Data, Var, Abs)
0xc0 // End Collection
|
and in the sample:
Code: |
usb_put_packet(1, out_data, 3, USB_DTS_TOGGLE)
...
usb_get_packet(1, in_data, 3);
|
it works... are these all places? |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19520
|
|
Posted: Thu Aug 29, 2013 11:25 am |
|
|
Don't change the file.
Just set the two defines:
USB_CONFIG_HID_TX_SIZE
and
USB_CONFIG_HID_RX_SIZE
_Before_ you load the HID descriptor.
Maximum value you can set is 64.
These change everything needed for you.
If undefined, they default to two (the size wanted by the demo). Otherwise your values override the settings.
Best Wishes |
|
|
Prefekt
Joined: 21 Oct 2010 Posts: 85
|
|
Posted: Sat Aug 31, 2013 5:34 am |
|
|
Hello,
thank for the information. I thought about this, but I was not shure.
Thanks
Volker |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|