USB Host Shield 2.0
|
#include <XBOXONE.h>
Public Member Functions | |
XBOXONE (USB *pUsb) | |
USBDeviceConfig implementation | |
virtual uint8_t | Init (uint8_t parent, uint8_t port, bool lowspeed) |
virtual uint8_t | Release () |
virtual uint8_t | Poll () |
virtual uint8_t | GetAddress () |
virtual bool | isReady () |
virtual bool | VIDPIDOK (uint16_t vid, uint16_t pid) |
Xbox Controller functions | |
uint16_t | getButtonPress (ButtonEnum b) |
bool | getButtonClick (ButtonEnum b) |
int16_t | getAnalogHat (AnalogHatEnum a) |
void | attachOnInit (void(*funcOnInit)(void)) |
Public Member Functions inherited from USBDeviceConfig | |
virtual uint8_t | ConfigureDevice (uint8_t parent, uint8_t port, bool lowspeed) |
virtual void | ResetHubPort (uint8_t port) |
virtual bool | DEVCLASSOK (uint8_t klass) |
virtual bool | DEVSUBCLASSOK (uint8_t subklass) |
Public Attributes | |
bool | XboxOneConnected |
Protected Attributes | |
USB * | pUsb |
uint8_t | bAddress |
EpInfo | epInfo [XBOX_MAX_ENDPOINTS] |
This class implements support for a Xbox ONE controller connected via USB.
XBOXONE::XBOXONE | ( | USB * | pUsb | ) |
Constructor for the XBOXONE class.
pUsb | Pointer to USB class instance. |
Definition at line 27 of file XBOXONE.cpp.
|
virtual |
Initialize the Xbox Controller.
parent | Hub number. |
port | Port number on the hub. |
lowspeed | Speed of the device. |
Reimplemented from USBDeviceConfig.
Definition at line 43 of file XBOXONE.cpp.
|
virtual |
Release the USB device.
Reimplemented from USBDeviceConfig.
Definition at line 226 of file XBOXONE.cpp.
|
virtual |
Poll the USB Input endpoins and run the state machines.
Reimplemented from USBDeviceConfig.
Definition at line 237 of file XBOXONE.cpp.
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
Used by the USB core to check what this driver support.
vid | The device's VID. |
pid | The device's PID. |
Reimplemented from USBDeviceConfig.
uint16_t XBOXONE::getButtonPress | ( | ButtonEnum | b | ) |
getButtonPress(ButtonEnum b) will return true as long as the button is held down.
While getButtonClick(ButtonEnum b) will only return it once.
So you instance if you need to increase a variable once you would use getButtonClick(ButtonEnum b), but if you need to drive a robot forward you would use getButtonPress(ButtonEnum b).
b | ButtonEnum to read. |
Definition at line 316 of file XBOXONE.cpp.
bool XBOXONE::getButtonClick | ( | ButtonEnum | b | ) |
getButtonPress(ButtonEnum b) will return true as long as the button is held down.
While getButtonClick(ButtonEnum b) will only return it once.
So you instance if you need to increase a variable once you would use getButtonClick(ButtonEnum b), but if you need to drive a robot forward you would use getButtonPress(ButtonEnum b).
b | ButtonEnum to read. |
Definition at line 324 of file XBOXONE.cpp.
int16_t XBOXONE::getAnalogHat | ( | AnalogHatEnum | a | ) |
|
inline |
bool XBOXONE::XboxOneConnected |
|
protected |
|
protected |