25 #define EP_MAXPKTSIZE 32 // Max size for data via USB
28 #define EP_INTERRUPT 0x03
31 #define XBOX_CONTROL_PIPE 0
32 #define XBOX_INPUT_PIPE 1
33 #define XBOX_OUTPUT_PIPE 2
36 #define XBOX_VID 0x045E // Microsoft Corporation
37 #define MADCATZ_VID 0x1BAD // For unofficial Mad Catz controllers
38 #define JOYTECH_VID 0x162E // For unofficial Joytech controllers
40 #define XBOX_OLD_PID1 0x0202 // Original Microsoft Xbox controller (US)
41 #define XBOX_OLD_PID2 0x0285 // Original Microsoft Xbox controller (Japan)
42 #define XBOX_OLD_PID3 0x0287 // Microsoft Microsoft Xbox Controller S
43 #define XBOX_OLD_PID4 0x0289 // Smaller Microsoft Xbox controller (US)
46 #define bmREQ_HID_OUT USB_SETUP_HOST_TO_DEVICE|USB_SETUP_TYPE_CLASS|USB_SETUP_RECIPIENT_INTERFACE
47 #define HID_REQUEST_SET_REPORT 0x09
49 #define XBOX_MAX_ENDPOINTS 3
68 virtual uint8_t
Init(uint8_t parent, uint8_t port,
bool lowspeed);
78 virtual uint8_t
Poll();
102 virtual boolean VIDPIDOK(uint16_t vid, uint16_t pid) {
146 pFuncOnInit = funcOnInit;
167 void (*pFuncOnInit)(void);
173 uint8_t OldButtonState;
174 uint8_t ButtonClickState;
177 uint8_t buttonValues[8];
178 uint8_t oldButtonValues[8];
179 bool buttonClicked[8];
186 void printReport(uint16_t length);
189 void XboxCommand(uint8_t* data, uint16_t nbytes);
virtual uint8_t Release()
void attachOnInit(void(*funcOnInit)(void))
virtual uint8_t GetAddress()
void setRumbleOn(uint8_t lValue, uint8_t rValue)
virtual boolean VIDPIDOK(uint16_t vid, uint16_t pid)
EpInfo epInfo[XBOX_MAX_ENDPOINTS]
int16_t getAnalogHat(AnalogHatEnum a)
virtual uint8_t Init(uint8_t parent, uint8_t port, bool lowspeed)
#define XBOX_MAX_ENDPOINTS
bool getButtonClick(ButtonEnum b)
uint8_t getButtonPress(ButtonEnum b)