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

HID Descriptor with 16Bit ints.

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



Joined: 17 May 2010
Posts: 29
Location: I live in Spain, with the toros, paella and tortilla

View user's profile Send private message

HID Descriptor with 16Bit ints.
PostPosted: Tue May 15, 2012 3:41 pm     Reply with quote

Hello everyone,

I must use this HID descriptor, but I don't know how to send the 16bit ints.

This is the descriptor:
Code:
const char USB_CLASS_SPECIFIC_DESC[] = {
  0x05, 0x01,          /* Usage Page (Generic Desktop)                       */
  0x09, 0x04,          /* Usage (Joystick)                                   */
  0xa1, 0x01,          /* Collection (Application)                           */
  0xa1, 0x02,          /*   Collection (Logical)                             */
  0x15, 0x00,          /*     Logical Minimum (0)                            */
  0x26, 0xFF, 0xFF,    /*     Logical Maximum (65535)                        */
  0x75, 0x10,          /*     Report Size (16)                               */
  0x95, 0x04,          /*     Report Count (4)                               */
  0x09, 0x30,          /*     Usage (X)                                      */
  0x09, 0x31,          /*     Usage (Y)                                      */
  0x09, 0x32,          /*     Usage (Z)                                      */
  0x09, 0x35,          /*     Usage (Rz)                                     */
  0x81, 0x82,          /*     Input (Data, Variable, Absolute, Volatile)     */
  0x25, 0x07,          /*     Logical Maximum (7)                            */
  0x46, 0x3B, 0x01,    /*     Physical Maximum (315)                         */
  0x75, 0x04,          /*     Report Size (4)                                */
  0x95, 0x01,          /*     Report Count (1)                               */
  0x65, 0x14,          /*     Unit (Eng Rot: Degree)                         */
  0x09, 0x39,          /*     Usage (Hat Switch)                             */
  0x81, 0x42,          /*     Input (Data,Var,Abs,NWrp,Lin,Pref,Null,Bit)    */
  0x75, 0x04,          /*     Report Size (4)                                */
  0x95, 0x01,          /*     Report Count (1)                               */
  0x05, 0xFF,          /*     Usage Page (null)                              */
  0x81, 0x01,          /*     Input (Constant)                               */
  0x75, 0x08,          /*     Report Size (8)                                */
  0x95, 0x01,          /*     Report Count (1)                               */
  0x05, 0xFF,          /*     Usage Page (null)                              */
  0x81, 0x01,          /*     Input (Constant)                               */
  0x15, 0x00,          /*     Logical Minimum (0)                            */
  0x25, 0x01,          /*     Logical Maximum (1)                            */
  0x75, 0x01,          /*     Report Size (1)                                */
  0x95, 0x0D,          /*     Report Count (13)                              */
  0x05, 0x09,          /*     Usage Page (Button)                            */
  0x19, 0x01,          /*     Usage Minimum (Button 1)                       */
  0x29, 0x0D,          /*     Usage Maximum (Button 13)                      */
  0x81, 0x02,          /*     Input (Data, Variable, Absolute)               */
  0x75, 0x03,          /*     Report Size (3)                                */
  0x95, 0x01,          /*     Report Count (1)                               */
  0x05, 0xFF,          /*     Usage Page (null)                              */
  0x81, 0x01,          /*     Input (Constant)                               */
  0xc0,                /*   End Collection                                   */
  0xc0                 /* End Collection                                     */
}; 


I tried this:
Code:
unsigned int16 write[4] = {0,0,0,0};

void main() {
   usb_init();
   usb_task();
   usb_wait_for_enumeration();
   //write[0] = 0;
   while(1){
                output_high(PIN_D0);
      usb_task();
      while(!usb_put_packet(1, write, 4, USB_DTS_TOGGLE));
   }
}


But it does not seem to work.

So if someone could help I would really like it.
Thanks.
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