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();
99 virtual bool isReady() {
return bPollEnable; };
143 void setRumbleOn(uint8_t controller, uint8_t lValue, uint8_t rValue);
151 void setLedRaw(uint8_t controller, uint8_t value);
206 uint32_t ButtonState[4];
207 uint32_t OldButtonState[4];
208 uint16_t ButtonClickState[4];
209 int16_t hatValue[4][4];
210 uint16_t controllerStatus[4];
211 bool buttonStateChanged[4];
221 void readReport(uint8_t controller);
222 void printReport(uint8_t controller, uint8_t nBytes);
225 void XboxCommand(uint8_t controller, uint8_t* data, uint16_t nbytes);