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.
Dependents: STM32F407VET6_USBHostMSD STM32F407VET6_USBHostMouse STM32F407VET6_USBHostKeyboard STM32F407VET6_USBHostMSD_1
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 btnX, uint8_t btnY, uint8_t btnABCD, uint8_t btnSpecial)) |
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 45 of file USBHostGamepad.h.
Constructor & Destructor Documentation
USBHostGamepad | ( | ) |
Constructor.
Definition at line 24 of file USBHostGamepad.cpp.
Member Function Documentation
void attachEvent | ( | void(*)(uint8_t btnX, uint8_t btnY, uint8_t btnABCD, uint8_t btnSpecial) | ptr ) |
Attach a callback called when a gamepad event is received.
- Parameters:
-
ptr function pointer
Definition at line 73 of file USBHostGamepad.h.
bool connect | ( | ) |
Try to connect a gamepad device.
- Returns:
- true if connection was successful
- Note:
- Parameters:
-
@retval
Definition at line 69 of file USBHostGamepad.cpp.
bool connected | ( | ) |
Check if a gamepad is connected.
- Returns:
- true if a gamepad is connected
- Note:
- Parameters:
-
@retval
Definition at line 58 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
- Note:
- Parameters:
-
@retval
Definition at line 193 of file USBHostGamepad.cpp.
Generated on Wed Jul 13 2022 07:15:48 by
