Zoltan Hudak / USBHost-STM32F4

Dependents:   STM32F407VET6_USBHostMSD STM32F407VET6_USBHostMouse STM32F407VET6_USBHostKeyboard STM32F407VET6_USBHostMSD_1

Embed: (wiki syntax)

« Back to documentation index

USBHostGamepad Class Reference

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

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:
ptrfunction 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:
devrequest the device descriptor on this device
bufbuffer to store the device descriptor
max_len_bufmaximum size of buf
len_dev_descrpointer to store the length of the packet transferred
Note:
Parameters:
@retval

Definition at line 193 of file USBHostGamepad.cpp.