23 #if defined(ARDUINO) && ARDUINO >= 100
33 #define EP_MAXPKTSIZE 32 // max size for data via USB
36 #define EP_INTERRUPT 0x03
39 #define XBOX_CONTROL_PIPE 0
40 #define XBOX_INPUT_PIPE_1 1
41 #define XBOX_OUTPUT_PIPE_1 2
42 #define XBOX_INPUT_PIPE_2 3
43 #define XBOX_OUTPUT_PIPE_2 4
44 #define XBOX_INPUT_PIPE_3 5
45 #define XBOX_OUTPUT_PIPE_3 6
46 #define XBOX_INPUT_PIPE_4 7
47 #define XBOX_OUTPUT_PIPE_4 8
50 #define XBOX_VID 0x045E // Microsoft Corporation
51 #define MADCATZ_VID 0x1BAD // For unofficial Mad Catz receivers
52 #define JOYTECH_VID 0x162E // For unofficial Joytech controllers
54 #define XBOX_WIRELESS_RECEIVER_PID 0x0719 // Microsoft Wireless Gaming Receiver
55 #define XBOX_WIRELESS_RECEIVER_THIRD_PARTY_PID 0x0291 // Third party Wireless Gaming Receiver
57 #define XBOX_MAX_ENDPOINTS 9
80 virtual uint8_t
Init(uint8_t parent, uint8_t port,
bool lowspeed);
90 virtual uint8_t
Poll();
114 virtual boolean VIDPIDOK(uint16_t vid, uint16_t pid) {
167 void setRumbleOn(uint8_t lValue, uint8_t rValue, uint8_t controller = 0);
175 void setLedRaw(uint8_t value, uint8_t controller = 0);
220 pFuncOnInit = funcOnInit;
244 void onInit(uint8_t controller);
245 void (*pFuncOnInit)(void);
250 uint32_t ButtonState[4];
251 uint32_t OldButtonState[4];
252 uint16_t ButtonClickState[4];
253 int16_t hatValue[4][4];
254 uint16_t controllerStatus[4];
255 bool buttonStateChanged[4];
265 void readReport(uint8_t controller);
266 void printReport(uint8_t controller, uint8_t nBytes);
269 void XboxCommand(uint8_t controller, uint8_t* data, uint16_t nbytes);