AN249 Silicon_Laboratories, AN249 Datasheet - Page 28

no-image

AN249

Manufacturer Part Number
AN249
Description
Human Interface Device Tutorial
Manufacturer
Silicon_Laboratories
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
AN2490NFHP
Manufacturer:
PANASONIC/松下
Quantity:
20 000
Part Number:
AN2491NFHP
Manufacturer:
PANASON
Quantity:
5 510
Part Number:
AN2491NFHP
Manufacturer:
MAXIM
Quantity:
5 510
AN249
This item chooses the “Mouse” protocol for the Boot Interface HID subclass. It must be set to 0x02 so that the
system will know how to interpret the incoming Reports.
7.2.4. IN Endpoint Descriptor
// IN endpoint (mandatory for HID)
{ // endpoint_descriptor hid_endpoint_in_descriptor
}
In the USB_Descriptor.h header file, this pre-compiler directive is defined to be “3”. which will be big enough to
allow transfers of the example’s only defined Report Structure.
7.2.5. HID Descriptor
descriptor)
This pre-compiler directive is defined in the USB_Descriptor.h file and reflects the size of the Mouse example’s
Report Descriptor.
7.2.6. Report Descriptor
The Report Descriptor contains the definition for a Report that includes one bit describing the state of the left
mouse button and two bytes describing the relative X- and Y- axis positions of the mouse pointer. This example will
require that only one Report be defined.
This example’s only Report groups all data inside an Application Collection that contains Generic Desktop
information pertaining to a mouse. Inside this Application Collection is a Physical Collection pertaining to a pointer
that contains all information about a single data point, in this case information about the mouse. This Physical
Collection will group a byte of data containing the bit of data describing the left mouse button state and 7 bits of
padding with two bytes of data describing the X- and Y- axis positions of the pointer.
The report descriptor for the Mouse Emulation Example looks as follows:
28
0x02,
EP1_PACKET_SIZE_LE
{ // class_descriptor hid_descriptor
0x09,
0x21,
0x0101,
0x00,
0x01,
0x22,
HID_REPORT_DESCRIPTOR_SIZE_LE // wItemLength (total length of report descriptor)
}
HID_REPORT_DESCRIPTOR_SIZE_LE
0x07,
0x05,
0x81,
0x03,
EP1_PACKET_SIZE_LE,
10
// bInterfaceProcotol
// bLength
// bDescriptorType
// bcdHID
// bCountryCode
// bNumDescriptors
// bDescriptorType
// bLength
// bDescriptorType
// bEndpointAddress
// bmAttributes
// MaxPacketSize (LITTLE ENDIAN)
// bInterval
//
Rev. 0.2
wItemLength
(total
length
of
report

Related parts for AN249