/** HID class report descriptor. This is a special descriptor constructed with values from the
 *  USBIF HID class specification to describe the reports and capabilities of the HID device. This
 *  descriptor is parsed by the host and its contents used to determine what data (and in what encoding)
 *  the device will send, and what it may be sent back from the host. Refer to the HID specification for
 *  more details on HID report descriptors.
 */
const USB_Descriptor_HIDReport_Datatype_t PROGMEM JoystickReport[] =
{
	/* Use the HID class driver's standard Joystick report.
	 *   Min X/Y/Z Axis values: -100
	 *   Max X/Y/Z Axis values:  100
	 *   Min physical X/Y/Z Axis values (used to determine resolution): -1
	 *   Max physical X/Y/Z Axis values (used to determine resolution):  1
	 *   Buttons: 2
	 */
	HID_DESCRIPTOR_JOYSTICK(-100, 100, -1, 1, 2)
};

/** Device descriptor structure. This descriptor, located in FLASH memory, describes the overall
 *  device characteristics, including the supported USB version, control endpoint size and the
 *  number of device configurations. The descriptor is read out by the USB host when the enumeration
 *  process begins.
 */
const USB_Descriptor_Device_t PROGMEM DeviceDescriptor =
{
	.Header                 = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device},

	.USBSpecification       = VERSION_BCD(01.10),
	.Class                  = USB_CSCP_NoDeviceClass,
	.SubClass               = USB_CSCP_NoDeviceSubclass,
	.Protocol               = USB_CSCP_NoDeviceProtocol,
Exemplo n.º 2
0
#include "Descriptors.h"

const USB_Descriptor_HIDReport_Datatype_t PROGMEM MouseReport[] = {
	/* from -127 to 127, 1 button (fake), relative */
	HID_DESCRIPTOR_MOUSE(-128, 127, -128, 127, 1, false)
};

const USB_Descriptor_HIDReport_Datatype_t PROGMEM JoystickReport[] = {
	/* Digital Joystick with three buttons:
	 * Mind the report id!
	 *   Min X/Y Axis values: -1 (left/down)
	 *   Max X/Y Axis values:  1 (right/up)
	 *   Buttons: 3
	 */
	HID_DESCRIPTOR_JOYSTICK(-1, 1, -1, 1, 3)
};

/** Device descriptor structure. This descriptor, located in FLASH memory, describes the overall
 *  device characteristics, including the supported USB version, control endpoint size and the
 *  number of device configurations. The descriptor is read out by the USB host when the enumeration
 *  process begins.
 */
const USB_Descriptor_Device_t PROGMEM DeviceDescriptor = {
	.Header                 = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device},

	.USBSpecification       = VERSION_BCD(01.10),
	.Class                  = USB_CSCP_NoDeviceClass,
	.SubClass               = USB_CSCP_NoDeviceSubclass,
	.Protocol               = USB_CSCP_NoDeviceProtocol,