LPCOpen Platform
LPCOpen Platform for NXP LPC Microcontrollers
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
USB_ClassInfo_HID_Device_t Struct Reference

HID Class Device Mode Configuration and State Structure. More...

#include "HIDClassDevice.h"

Data Fields

struct {
   uint8_t   InterfaceNumber
 
   uint8_t   ReportINEndpointNumber
 
   uint16_t   ReportINEndpointSize
 
   bool   ReportINEndpointDoubleBank
 
   void *   PrevReportINBuffer
 
   uint8_t   PrevReportINBufferSize
 
Config
 
struct {
   bool   UsingReportProtocol
 
   uint16_t   IdleCount
 
   uint16_t   IdleMSRemaining
 
State
 

Detailed Description

HID Class Device Mode Configuration and State Structure.

Class state structure. An instance of this structure should be made for each HID interface within the user application, and passed to each of the HID class driver functions as the HIDInterfaceInfo parameter. This stores each HID interface's configuration and state information.

Note
Due to technical limitations, the HID device class driver does not utilize a separate OUT endpoint for host->device communications. Instead, the host->device data (if any) is sent to the device via the control endpoint.

Definition at line 75 of file HIDClassDevice.h.

Field Documentation

struct { ... } Config

Config data for the USB class interface within the device. All elements in this section must be set or the interface will fail to enumerate and operate correctly.

uint16_t IdleCount

Report idle period, in milliseconds, set by the host.

Definition at line 107 of file HIDClassDevice.h.

uint16_t IdleMSRemaining

Total number of milliseconds remaining before the idle period elapsed - this should be decremented by the user application if non-zero each millisecond.

Definition at line 108 of file HIDClassDevice.h.

uint8_t InterfaceNumber

Interface number of the HID interface within the device.

Definition at line 77 of file HIDClassDevice.h.

void* PrevReportINBuffer

Pointer to a buffer where the previously created HID input report can be stored by the driver, for comparison purposes to detect report changes that must be sent immediately to the host. This should point to a buffer big enough to hold the largest HID input report sent from the HID interface. If this is set to NULL, it is up to the user to force transfers when needed in the CALLBACK_HID_Device_CreateHIDReport() callback function.

Note
Due to the single buffer, the internal driver can only correctly compare subsequent reports with identical report IDs. In multiple report devices, this buffer should be set to NULL and the decision to send reports made by the user application instead.

Definition at line 83 of file HIDClassDevice.h.

uint8_t PrevReportINBufferSize

Size in bytes of the given input report buffer. This is used to create a second buffer of the same size within the driver so that subsequent reports can be compared. If the user app is to determine when reports are to be sent exclusively (i.e. PrevReportINBuffer is NULL) this value must still be set to the size of the largest report the device can issue to the host.

Definition at line 95 of file HIDClassDevice.h.

bool ReportINEndpointDoubleBank

Indicates if the HID interface's IN report endpoint should use double banking.

Definition at line 81 of file HIDClassDevice.h.

uint8_t ReportINEndpointNumber

Endpoint number of the HID interface's IN report endpoint.

Definition at line 79 of file HIDClassDevice.h.

uint16_t ReportINEndpointSize

Size in bytes of the HID interface's IN report endpoint.

Definition at line 80 of file HIDClassDevice.h.

struct { ... } State

State data for the USB class interface within the device. All elements in this section are reset to their defaults when the interface is enumerated.

bool UsingReportProtocol

Indicates if the HID interface is set to Boot or Report protocol mode.

Definition at line 106 of file HIDClassDevice.h.


The documentation for this struct was generated from the following file: