USB Host Shield 2.0
|
#include <SwitchProUSB.h>
Protected Member Functions | |
HIDUniversal implementation | |
virtual void | ParseHIDData (USBHID *hid, bool is_rpt_id, uint8_t len, uint8_t *buf) |
virtual uint8_t | OnInitSuccessful () |
SwitchProParser implementation | |
virtual void | sendOutputReport (uint8_t *data, uint8_t len) |
virtual void | sendHandshake () |
virtual void | disableTimeout () |
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) |
![]() | |
void | Parse (uint8_t len, uint8_t *buf) |
void | Reset () |
This class implements support for the Switch Pro controller via USB. It uses the HIDUniversal class for all the USB communication.
Definition at line 31 of file SwitchProUSB.h.
|
inline |
Constructor for the SwitchProUSB class.
p | Pointer to the USB class instance. |
Definition at line 37 of file SwitchProUSB.h.
|
inline |
Used to check if a Switch Pro controller is connected.
Definition at line 46 of file SwitchProUSB.h.
Used to call your own function when the device is successfully initialized.
funcOnInit | Function to call. |
Definition at line 54 of file SwitchProUSB.h.
|
inlineprotectedvirtual |
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 67 of file SwitchProUSB.h.
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 77 of file SwitchProUSB.h.
Send the output to the Switch Pro controller. This is implemented in SwitchProBT.h and SwitchProUSB.h.
data | Pointer to buffer to send by the derived class. |
len | Length of buffer. |
Implements SwitchProParser.
Definition at line 98 of file SwitchProUSB.h.
Used to send a handshake command via USB before disabling the timeout.
Reimplemented from SwitchProParser.
Definition at line 118 of file SwitchProUSB.h.
Needed to disable USB timeout for the controller, so it sends out data without the host having to send data continuously.
Reimplemented from SwitchProParser.
Definition at line 129 of file SwitchProUSB.h.
Used by the USB core to check what this driver support.
vid | The device's VID. |
pid | The device's PID. |
Reimplemented from USBDeviceConfig.
Definition at line 148 of file SwitchProUSB.h.