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 16C765

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



Joined: 28 Nov 2004
Posts: 5

View user's profile Send private message MSN Messenger

USB 16C765
PostPosted: Sun Feb 06, 2005 1:20 pm     Reply with quote

Hello,

I'have a matter with USB_HID_DESC[], because windows can't arrive to recognise the HID Gamepad.

I started to copy ex_usb_mouse.c from example directory to my project, and once compiled and my device (16C765) programmed, the mouse turn in round, and everything is ok.

I tried to write my own USB_HID_DESC to make a joystick according to microsoft advise, and USB.ORG HID TABLE, to directly use windows driver. However, my usb description don't work cause windows recognise it as a "HID Mouse", and in the peripheric description "This peripheric don't want to start".

I don't know if the mater is in my USB_HID_DESC or if it come from another thing I didn't change correctly (I have just changed the HID Description).

Below, my usb description. Please, help me, I try to solve my problem for 2 weeks.

Code:

   const char USB_HID_DESC[] = {
    0x05, 0x01,                    // USAGE_PAGE (Generic Desktop)
    0x15, 0x00,                    // LOGICAL_MINIMUM (0)
    0x09, 0x04,                    // USAGE (Joystick)
    0xa1, 0x01,                    // COLLECTION (Application)
       0x05, 0x02,                    //   USAGE_PAGE (Simulation Controls)
       0x09, 0xbb,                    //   USAGE (Throttle)
       0x15, 0x81,                    //   LOGICAL_MINIMUM (-127)
       0x25, 0x7f,                    //   LOGICAL_MAXIMUM (127)
       0x75, 0x08,                    //   REPORT_SIZE (8)
       0x95, 0x01,                    //   REPORT_COUNT (1)
       0x81, 0x02,                    //   INPUT (Data,Var,Abs)
       0x05, 0x01,                    //   USAGE_PAGE (Generic Desktop)
       0x09, 0x01,                    //   USAGE (Pointer)
       0xa1, 0x00,                    //   COLLECTION (Physical)
          0x09, 0x30,                    //     USAGE (X)
          0x09, 0x31,                    //     USAGE (Y)
          0x95, 0x02,                    //     REPORT_COUNT (2)
          0x81, 0x02,                    //     INPUT (Data,Var,Abs)
       0xc0,                          //   END_COLLECTION
       0x09, 0x39,                    //   USAGE (Hat switch)
       0x15, 0x00,                    //   LOGICAL_MINIMUM (0)
       0x25, 0x03,                    //   LOGICAL_MAXIMUM (3)
       0x35, 0x00,                    //   PHYSICAL_MINIMUM (0)
       0x46, 0x0e, 0x01,              //   PHYSICAL_MAXIMUM (270)
       0x65, 0x14,                    //   UNIT (Eng Rot:Angular Pos)
       0x75, 0x04,                    //   REPORT_SIZE (4)
       0x95, 0x01,                    //   REPORT_COUNT (1)
       0x81, 0x02,                    //   INPUT (Data,Var,Abs)
       0x05, 0x09,                    //   USAGE_PAGE (Button)
       0x19, 0x01,                    //   USAGE_MINIMUM (Button 1)
       0x29, 0x04,                    //   USAGE_MAXIMUM (Button 4)
       0x15, 0x00,                    //   LOGICAL_MINIMUM (0)
       0x25, 0x01,                    //   LOGICAL_MAXIMUM (1)
       0x75, 0x01,                    //   REPORT_SIZE (1)
       0x95, 0x04,                    //   REPORT_COUNT (4)
       0x55, 0x00,                    //   UNIT_EXPONENT (0)
       0x65, 0x00,                    //   UNIT (None)
       0x81, 0x02,                    //   INPUT (Data,Var,Abs)
    0xc0                           // END_COLLECTION
   };

   #DEFINE USB_HID_DESC_LEN          sizeof(USB_HID_DESC)
young



Joined: 24 Jun 2004
Posts: 285

View user's profile Send private message

hope this helps
PostPosted: Wed Feb 16, 2005 8:15 am     Reply with quote

http://ww1.microchip.com/downloads/en/AppNotes/91054c.pdf.

From this application report, I first that your device number for a gamepad is wrong. it should be 5 instead of 4. see the detailed application about the description. see if it help
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