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 XBOX_WIRELESS_RECEIVER_PID 0x0719 // Microsoft Wireless Gaming Receiver
52 #define XBOX_WIRELESS_RECEIVER_THIRD_PARTY_PID 0x0291 // Third party Wireless Gaming Receiver
54 #define MADCATZ_VID 0x1BAD // For unofficial Mad Catz receivers
56 #define XBOX_MAX_ENDPOINTS 9
79 virtual uint8_t
Init(uint8_t parent, uint8_t port,
bool lowspeed);
89 virtual uint8_t
Poll();
156 void setRumbleOn(uint8_t lValue, uint8_t rValue, uint8_t controller = 0);
164 void setLedRaw(uint8_t value, uint8_t controller = 0);
222 uint32_t ButtonState[4];
223 uint32_t OldButtonState[4];
224 uint16_t ButtonClickState[4];
225 int16_t hatValue[4][4];
226 uint16_t controllerStatus[4];
227 bool buttonStateChanged[4];
237 void readReport(uint8_t controller);
238 void printReport(uint8_t controller, uint8_t nBytes);
241 void XboxCommand(uint8_t controller, uint8_t* data, uint16_t nbytes);