USBLibAPIGuide  1.00.00.01
Data Fields
tUSBDHIDDevice Struct Reference

#include <usbdhid.h>

Collaboration diagram for tUSBDHIDDevice:
Collaboration graph
[legend]

Data Fields

uint16_t ui16VID
 The vendor ID that this device is to present in the device descriptor. More...
 
uint16_t ui16PID
 The product ID that this device is to present in the device descriptor. More...
 
uint16_t ui16MaxPowermA
 The maximum power consumption of the device, expressed in milliamps. More...
 
uint8_t ui8PwrAttributes
 
uint8_t ui8Subclass
 The interface subclass to publish to the server for this HID device. More...
 
uint8_t ui8Protocol
 The interface protocol to publish to the server for this HID device. More...
 
uint8_t ui8NumInputReports
 
tHIDReportIdlepsReportIdle
 
tUSBCallback pfnRxCallback
 
void * pvRxCBData
 
tUSBCallback pfnTxCallback
 
void * pvTxCBData
 
bool bUseOutEndpoint
 
const tHIDDescriptor * psHIDDescriptor
 
const uint8_t *const * ppui8ClassDescriptors
 
const uint8_t *const * ppui8StringDescriptors
 
uint32_t ui32NumStringDescriptors
 
const tConfigHeader *const * ppsConfigDescriptor
 
tHIDInstance sPrivateData
 

Detailed Description

The structure used by the application to define operating parameters for the HID device.

Field Documentation

§ ui16VID

uint16_t tUSBDHIDDevice::ui16VID

The vendor ID that this device is to present in the device descriptor.

Referenced by USBDHIDGamepadCompositeInit(), USBDHIDInit(), USBDHIDKeyboardCompositeInit(), USBDHIDMouseCompositeInit(), and USBDHIDSensorCompositeInit().

§ ui16PID

uint16_t tUSBDHIDDevice::ui16PID

The product ID that this device is to present in the device descriptor.

Referenced by USBDHIDGamepadCompositeInit(), USBDHIDInit(), USBDHIDKeyboardCompositeInit(), USBDHIDMouseCompositeInit(), and USBDHIDSensorCompositeInit().

§ ui16MaxPowermA

uint16_t tUSBDHIDDevice::ui16MaxPowermA

The maximum power consumption of the device, expressed in milliamps.

Referenced by USBDHIDGamepadCompositeInit(), USBDHIDKeyboardCompositeInit(), USBDHIDMouseCompositeInit(), and USBDHIDSensorCompositeInit().

§ ui8PwrAttributes

uint8_t tUSBDHIDDevice::ui8PwrAttributes

Indicates whether the device is self- or bus-powered and whether or not it supports remote wakeup. Valid values are USB_CONF_ATTR_SELF_PWR or USB_CONF_ATTR_BUS_PWR, optionally ORed with USB_CONF_ATTR_RWAKE.

Referenced by USBDHIDGamepadCompositeInit(), USBDHIDKeyboardCompositeInit(), USBDHIDMouseCompositeInit(), and USBDHIDSensorCompositeInit().

§ ui8Subclass

uint8_t tUSBDHIDDevice::ui8Subclass

The interface subclass to publish to the server for this HID device.

Referenced by USBDHIDGamepadCompositeInit(), USBDHIDKeyboardCompositeInit(), USBDHIDMouseCompositeInit(), and USBDHIDSensorCompositeInit().

§ ui8Protocol

uint8_t tUSBDHIDDevice::ui8Protocol

The interface protocol to publish to the server for this HID device.

Referenced by USBDHIDGamepadCompositeInit(), USBDHIDKeyboardCompositeInit(), USBDHIDMouseCompositeInit(), and USBDHIDSensorCompositeInit().

§ ui8NumInputReports

uint8_t tUSBDHIDDevice::ui8NumInputReports

The number of Input reports that this device supports. This field must equal the number of reports published in the HID class descriptors for the device and also the number of entries in the array whose first element is pointed to by field pi16ReportIdle below.

Referenced by USBDHIDCompositeInit(), USBDHIDGamepadCompositeInit(), USBDHIDInit(), USBDHIDKeyboardCompositeInit(), USBDHIDMouseCompositeInit(), and USBDHIDSensorCompositeInit().

§ psReportIdle

tHIDReportIdle* tUSBDHIDDevice::psReportIdle

A pointer to the first element in an array of structures used to track idle time for each Input report. When USBDHIDInit() is called, the ui8Duration4mS and ui8ReportID fields of each of these array members should be initialized to indicate the default idle timeout for each input report. This array must be in RAM since the HID device class driver updates values in it in response to requests from the host and to track elapsed time. The number of elements in the array must match the number supplied in the ui8NumInputReports field above.

Referenced by USBDHIDCompositeInit(), USBDHIDGamepadCompositeInit(), USBDHIDInit(), USBDHIDKeyboardCompositeInit(), USBDHIDMouseCompositeInit(), and USBDHIDSensorCompositeInit().

§ pfnRxCallback

tUSBCallback tUSBDHIDDevice::pfnRxCallback

A pointer to the callback function which is called to notify the application of general events, events related to report transfers on endpoint zero and events related to reception of Output and Feature reports via the (optional) interrupt OUT endpoint.

Referenced by USBDHIDCompositeInit(), USBDHIDInit(), USBDHIDKeyboardCompositeInit(), USBDHIDMouseCompositeInit(), and USBDHIDSensorCompositeInit().

§ pvRxCBData

void* tUSBDHIDDevice::pvRxCBData

A client-supplied pointer which is sent as the first parameter in all calls made to the receive channel callback, pfnRxCallback.

§ pfnTxCallback

tUSBCallback tUSBDHIDDevice::pfnTxCallback

A pointer to the callback function which is called to notify the application of events related to transmission of Input reports via the interrupt IN endpoint.

Referenced by USBDHIDCompositeInit(), USBDHIDGamepadCompositeInit(), and USBDHIDInit().

§ pvTxCBData

void* tUSBDHIDDevice::pvTxCBData

A client-supplied pointer which is sent as the first parameter in all calls made to the transmit channel callback, pfnTxCallback.

§ bUseOutEndpoint

bool tUSBDHIDDevice::bUseOutEndpoint

If set to true, this field indicates that the device should use a dedicated interrupt OUT endpoint to receive reports from the host. In this case, reports from the host are passed to the application via the receive callback using USB_EVENT_RX_AVAILABLE events. If false, reports from the host are received via endpoint zero and passed to the application via USBD_HID_EVENT_REPORT_SENT events.

§ psHIDDescriptor

const tHIDDescriptor* tUSBDHIDDevice::psHIDDescriptor

The HID descriptor that the device is to publish (following the standard interface descriptor and prior to the endpoint descriptors for the interface).

Referenced by USBDHIDCompositeInit(), and USBDHIDInit().

§ ppui8ClassDescriptors

const uint8_t* const* tUSBDHIDDevice::ppui8ClassDescriptors

The HID class descriptors offered by the device are defined in an array of byte pointers and this field points to that array. The order and number of elements in the array must match the associated information provided in the HID descriptor in field by pi16HIDDescriptor.

Referenced by USBDHIDCompositeInit(), and USBDHIDInit().

§ ppui8StringDescriptors

const uint8_t* const* tUSBDHIDDevice::ppui8StringDescriptors

A pointer to the string descriptor array for this device. This array must contain the following string descriptor pointers in this order. Language descriptor, Manufacturer name string (language 1), Product name string (language 1), Serial number string (language 1),HID Interface description string (language 1), Configuration description string (language 1), (optionally) First HID device-specific string (language 1), (optionally) Second HID device-specific string (language 1), etc.

If supporting more than 1 language, the descriptor block (except for string descriptor 0) must be repeated for each language defined in the language descriptor.

The number of HID device-specific strings is dependent upon the content of the report descriptor passed to the interface and is, thus, application controlled.

Referenced by USBDHIDCompositeInit(), and USBDHIDInit().

§ ui32NumStringDescriptors

uint32_t tUSBDHIDDevice::ui32NumStringDescriptors

The number of descriptors provided in the ppStringDescriptors array. This must be 1 + ((5 + (num HID strings)) * (num languages)).

Referenced by USBDHIDCompositeInit().

§ ppsConfigDescriptor

const tConfigHeader* const* tUSBDHIDDevice::ppsConfigDescriptor

Referenced by USBDHIDCompositeInit().

§ sPrivateData

tHIDInstance tUSBDHIDDevice::sPrivateData

The private instance data for this device instance. This memory must remain accessible for as long as the HID device is in use and must not be modified by any code outside the HID class driver.

Referenced by USBDHIDCompositeInit(), and USBDHIDInit().


The documentation for this struct was generated from the following file:
© Copyright 1995-2020, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale