21 #if defined(ARDUINO) && ARDUINO >= 100
31 #define EP_MAXPKTSIZE 32 // Max size for data via USB
34 #define EP_INTERRUPT 0x03
37 #define XBOX_CONTROL_PIPE 0
38 #define XBOX_INPUT_PIPE 1
39 #define XBOX_OUTPUT_PIPE 2
42 #define XBOX_VID 0x045E // Microsoft Corporation
43 #define MADCATZ_VID 0x1BAD // For unofficial Mad Catz controllers
44 #define JOYTECH_VID 0x162E // For unofficial Joytech controllers
46 #define XBOX_OLD_PID1 0x0202 // Original Microsoft Xbox controller (US)
47 #define XBOX_OLD_PID2 0x0285 // Original Microsoft Xbox controller (Japan)
48 #define XBOX_OLD_PID3 0x0287 // Microsoft Microsoft Xbox Controller S
49 #define XBOX_OLD_PID4 0x0289 // Smaller Microsoft Xbox controller (US)
52 #define bmREQ_HID_OUT USB_SETUP_HOST_TO_DEVICE|USB_SETUP_TYPE_CLASS|USB_SETUP_RECIPIENT_INTERFACE
53 #define HID_REQUEST_SET_REPORT 0x09
55 #define XBOX_MAX_ENDPOINTS 3
74 virtual uint8_t
Init(uint8_t parent, uint8_t port,
bool lowspeed);
84 virtual uint8_t
Poll();
108 virtual boolean VIDPIDOK(uint16_t vid, uint16_t pid) {
153 pFuncOnInit = funcOnInit;
174 void (*pFuncOnInit)(void);
180 uint8_t OldButtonState;
181 uint8_t ButtonClickState;
184 uint8_t buttonValues[8];
185 uint8_t oldButtonValues[8];
186 bool buttonClicked[8];
193 void printReport(uint16_t length);
196 void XboxCommand(uint8_t* data, uint16_t nbytes);