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 controllers
56 #define XBOX_MAX_ENDPOINTS 9
87 virtual uint8_t
Init(uint8_t parent, uint8_t port,
bool lowspeed);
97 virtual uint8_t
Poll();
107 virtual bool isReady() {
return bPollEnable; };
149 void setRumbleOn(uint8_t controller, uint8_t lValue, uint8_t rValue);
157 void setLedRaw(uint8_t controller, uint8_t value);
212 uint32_t ButtonState[4];
213 uint32_t OldButtonState[4];
214 uint16_t ButtonClickState[4];
215 int16_t hatValue[4][4];
216 uint16_t controllerStatus[4];
217 bool buttonStateChanged[4];
227 void readReport(uint8_t controller);
228 void printReport(uint8_t controller, uint8_t nBytes);
231 void XboxCommand(uint8_t controller, uint8_t* data, uint16_t nbytes);