CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

USB HID with more then 2 bytes

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Prefekt



Joined: 21 Oct 2010
Posts: 85

View user's profile Send private message

USB HID with more then 2 bytes
PostPosted: Wed Aug 28, 2013 11:28 am     Reply with quote

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

View user's profile Send private message

PostPosted: Wed Aug 28, 2013 1:02 pm     Reply with quote

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: 19396

View user's profile Send private message

PostPosted: Thu Aug 29, 2013 11:25 am     Reply with quote

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. Smile

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

View user's profile Send private message

PostPosted: Sat Aug 31, 2013 5:34 am     Reply with quote

Hello,

thank for the information. I thought about this, but I was not shure.


Thanks
Volker
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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