Re: Gamepad HID (32Buttons) dimanche 17 avril 2011 17:34:29 |
Membre depuis : 13 ans Messages: 17 |
ROM struct{BYTE report[HID_RPT01_SIZE];}hid_rpt01={{ 0x05,0x01, //USAGE_PAGE (Generic Desktop) 0x09,0x05, //USAGE (Game Pad) 0xa1,0x01, // COLLECTION (Application) 0x05,0x09, // USAGE_PAGE (Button) 0x19,0x01, // USAGE_MINIMUM (Button 1) 0x29,0x20, // USAGE_MAXIMUM (Button 32) 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 }
0x04, // Size of this descriptor in bytes
Re: Gamepad HID (32Buttons) lundi 18 avril 2011 20:42:43 |
Administrateur Membre depuis : 18 ans Messages: 640 |
Re: Gamepad HID (32Buttons) mardi 19 avril 2011 07:05:50 |
Membre depuis : 13 ans Messages: 17 |
Re: Gamepad HID (32Buttons) mardi 19 avril 2011 18:54:01 |
Membre depuis : 13 ans Messages: 17 |
Re: Gamepad HID (32Buttons) mercredi 20 avril 2011 06:40:12 |
Administrateur Membre depuis : 18 ans Messages: 640 |
Re: Gamepad HID (32Buttons) mercredi 20 avril 2011 07:09:35 |
Membre depuis : 13 ans Messages: 17 |
Re: Gamepad HID (32Buttons) mercredi 20 avril 2011 12:03:26 |
Membre depuis : 13 ans Messages: 17 |
Re: Gamepad HID (32Buttons) mercredi 20 avril 2011 17:21:10 |
Membre depuis : 13 ans Messages: 17 |
#define mInitAllLEDs() LATD &= 0xF0; TRISD &= 0xF0; #define mLED_1 LATDbits.LATD0 #define mLED_2 LATDbits.LATD1 #define mLED_3 LATDbits.LATD2 #define mLED_4 LATDbits.LATD3 #define mLED_5 LATDbits.LATD5
if(!HIDTxHandleBusy(lastTransmission)) { //If the button is pressed if(Switch3IsPressed()) { //Indicate that the "x" button is pressed, but none others
Re: Gamepad HID (32Buttons) jeudi 21 avril 2011 20:28:29 |
Administrateur Membre depuis : 18 ans Messages: 640 |
BOOL Switch3IsPressed(void) { if(sw3 != old_sw3) { old_sw3 = sw3; // Save new value if(sw3 == 0) // If pressed return TRUE; // Was pressed }//end if return FALSE; // Was not pressed }//end Switch3IsPressed
/** SWITCH *********************************************************/ #define mInitAllSwitches() TRISBbits.TRISB4=1;TRISBbits.TRISB0=1; #define mInitSwitch2() TRISBbits.TRISB4=1; #define mInitSwitch3() TRISBbits.TRISB0=1; #define sw2 PORTBbits.RB4 #define sw3 PORTBbits.RB0
Re: Gamepad HID (32Buttons) vendredi 22 avril 2011 07:08:37 |
Membre depuis : 13 ans Messages: 17 |