USB Host Shield 2.0
|
#include <PSBuzz.h>
Protected Member Functions | |
void | Reset () |
HIDUniversal implementation | |
void | ParseHIDData (USBHID *hid, bool is_rpt_id, uint8_t len, uint8_t *buf) |
uint8_t | OnInitSuccessful () |
USBDeviceConfig implementation | |
virtual bool | VIDPIDOK (uint16_t vid, uint16_t pid) |
![]() | |
uint16_t | GetHidClassDescrLen (uint8_t type, uint8_t num) |
void | Initialize () |
HIDInterface * | FindInterface (uint8_t iface, uint8_t alt, uint8_t proto) |
void | ZeroMemory (uint8_t len, uint8_t *buf) |
HIDReportParser * | GetReportParser (uint8_t id) |
![]() | |
void | PrintEndpointDescriptor (const USB_ENDPOINT_DESCRIPTOR *ep_ptr) |
void | PrintHidDescriptor (const USB_HID_DESCRIPTOR *pDesc) |
Additional Inherited Members | |
![]() | |
struct HIDComposite::ReportParser | rptParsers [MAX_REPORT_PARSERS] |
HID_CLASS_DESCRIPTOR_LEN_AND_TYPE | descrInfo [HID_MAX_HID_CLASS_DESCRIPTORS] |
uint8_t | bConfNum |
uint8_t | bNumIface |
uint8_t | bNumEP |
uint32_t | qNextPollTime |
uint8_t | pollInterval |
bool | bPollEnable |
EpInfo | epInfo [totalEndpoints] |
HIDInterface | hidInterfaces [maxHidInterfaces] |
bool | bHasReportId |
uint16_t | PID |
uint16_t | VID |
![]() | |
USB * | pUsb |
uint8_t | bAddress |
![]() | |
static const uint16_t | constBuffLen = 64 |
![]() | |
static const uint8_t | epInterruptInIndex = 1 |
static const uint8_t | epInterruptOutIndex = 2 |
static const uint8_t | maxHidInterfaces = 5 |
static const uint8_t | maxEpPerInterface = 2 |
static const uint8_t | totalEndpoints = (maxHidInterfaces * maxEpPerInterface + 1) |
This class implements support for the PS Buzz controllers via USB. It uses the HIDUniversal class for all the USB communication.
|
inline |
|
inline |
bool PSBuzz::getButtonPress | ( | ButtonEnum | b, |
uint8_t | controller = 0 |
||
) |
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. |
controller | The controller to read from. Default to 0. |
Definition at line 58 of file PSBuzz.cpp.
bool PSBuzz::getButtonClick | ( | ButtonEnum | b, |
uint8_t | controller = 0 |
||
) |
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. |
controller | The controller to read from. Default to 0. |
Definition at line 63 of file PSBuzz.cpp.
Set LED value without using LEDEnum.
value | See: LEDEnum. Set LED values directly. |
value | Used to set whenever the LED should be on or off |
controller | The controller to control. Defaults to 0. |
Definition at line 72 of file PSBuzz.cpp.
|
protectedvirtual |
Used to parse USB HID data.
hid | Pointer to the HID class. |
is_rpt_id | Only used for Hubs. |
len | The length of the incoming data. |
buf | Pointer to the data buffer. |
Reimplemented from HIDUniversal.
Definition at line 23 of file PSBuzz.cpp.
|
protectedvirtual |
Called when a device is successfully initialized. Use attachOnInit(void (*funcOnInit)(void)) to call your own function. This is useful for instance if you want to set the LEDs in a specific way.
Reimplemented from HIDComposite.
Definition at line 41 of file PSBuzz.cpp.
|
inlineprotected |
Used by the USB core to check what this driver support.
vid | The device's VID. |
pid | The device's PID. |
Reimplemented from USBDeviceConfig.