Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: FATFileSystem3 mbed-rtos
Fork of USBHost by
USBHostGamepad Class Reference
A class to communicate a USB MIDI device. More...
#include <USBHostGamepad.h>
Inherits IUSBEnumerator.
Public Member Functions | |
| USBHostGamepad () | |
| Constructor. | |
| bool | connect () |
| Try to connect a gamepad device. | |
| bool | connected () |
| Check if a gamepad is connected. | |
| void | attachEvent (void(*ptr)(uint8_t btn00, uint8_t btn01, uint8_t btn02, uint8_t btn03, uint8_t btn04, uint8_t btn05, uint8_t btn06, uint8_t btn07, uint8_t btn08, uint8_t btn09, uint8_t btn10, uint8_t btn11, uint8_t btn12, uint8_t btn13, uint8_t btn14, uint8_t btn15, uint16_t gamePadVID, uint16_t gamePadPID)) |
| Attach a callback called when a gamepad event is received. | |
| USB_TYPE | getReportDescriptor (USBDeviceConnected *dev, uint8_t *buf, uint16_t max_len_buf, uint16_t *len_rep_descr=NULL) |
| Request the HID report descriptor. | |
Detailed Description
A class to communicate a USB MIDI device.
Definition at line 44 of file USBHostGamepad.h.
Constructor & Destructor Documentation
| USBHostGamepad | ( | ) |
Constructor.
Definition at line 26 of file USBHostGamepad.cpp.
Member Function Documentation
| void attachEvent | ( | void(*)(uint8_t btn00, uint8_t btn01, uint8_t btn02, uint8_t btn03, uint8_t btn04, uint8_t btn05, uint8_t btn06, uint8_t btn07, uint8_t btn08, uint8_t btn09, uint8_t btn10, uint8_t btn11, uint8_t btn12, uint8_t btn13, uint8_t btn14, uint8_t btn15, uint16_t gamePadVID, uint16_t gamePadPID) | ptr ) |
Attach a callback called when a gamepad event is received.
- Parameters:
-
ptr function pointer
Definition at line 71 of file USBHostGamepad.h.
| bool connect | ( | ) |
Try to connect a gamepad device.
- Returns:
- true if connection was successful
Definition at line 67 of file USBHostGamepad.cpp.
| bool connected | ( | ) |
Check if a gamepad is connected.
- Returns:
- true if a gamepad is connected
Definition at line 63 of file USBHostGamepad.cpp.
| USB_TYPE getReportDescriptor | ( | USBDeviceConnected * | dev, |
| uint8_t * | buf, | ||
| uint16_t | max_len_buf, | ||
| uint16_t * | len_rep_descr = NULL |
||
| ) |
Request the HID report descriptor.
- Parameters:
-
dev request the device descriptor on this device buf buffer to store the device descriptor max_len_buf maximum size of buf len_dev_descr pointer to store the length of the packet transferred
Definition at line 210 of file USBHostGamepad.cpp.
Generated on Fri Jul 15 2022 01:45:06 by
1.7.2
