diff options
author | Dean Camera <dean@fourwalledcubicle.com> | 2011-01-23 20:02:51 +0000 |
---|---|---|
committer | Dean Camera <dean@fourwalledcubicle.com> | 2011-01-23 20:02:51 +0000 |
commit | 6c7ed7ecd6d4727e33ddb8c5e4321499a2b76151 (patch) | |
tree | ee950b43a3aaa32a72b7d24f65e0b179f00810cc /Demos/Device/ClassDriver/Joystick/Descriptors.c | |
parent | 6d67b1df3cb8300612ad7b2f16e6bffe08fb8f30 (diff) | |
download | lufa-6c7ed7ecd6d4727e33ddb8c5e4321499a2b76151.tar.gz lufa-6c7ed7ecd6d4727e33ddb8c5e4321499a2b76151.tar.bz2 lufa-6c7ed7ecd6d4727e33ddb8c5e4321499a2b76151.zip |
Added new HID_DESCRIPTOR_MOUSE, HID_DESCRIPTOR_KEYBOARD and HID_DESCRIPTOR_JOYSTICK macros for easy automatic creation of basic USB HID device reports.
Diffstat (limited to 'Demos/Device/ClassDriver/Joystick/Descriptors.c')
-rw-r--r-- | Demos/Device/ClassDriver/Joystick/Descriptors.c | 35 |
1 files changed, 8 insertions, 27 deletions
diff --git a/Demos/Device/ClassDriver/Joystick/Descriptors.c b/Demos/Device/ClassDriver/Joystick/Descriptors.c index 09f12f06a..e421d3f02 100644 --- a/Demos/Device/ClassDriver/Joystick/Descriptors.c +++ b/Demos/Device/ClassDriver/Joystick/Descriptors.c @@ -44,33 +44,14 @@ * more details on HID report descriptors. */ USB_Descriptor_HIDReport_Datatype_t PROGMEM JoystickReport[] = -{ - HID_RI_USAGE_PAGE(8, 0x01), /* Generic Desktop */ - HID_RI_USAGE(8, 0x04), /* Joystick */ - HID_RI_COLLECTION(8, 0x01), /* Application */ - HID_RI_USAGE(8, 0x01), /* Pointer */ - HID_RI_COLLECTION(8, 0x00), /* Physical */ - HID_RI_USAGE(8, 0x30), /* Usage X */ - HID_RI_USAGE(8, 0x31), /* Usage Y */ - HID_RI_LOGICAL_MINIMUM(8, -100), - HID_RI_LOGICAL_MAXIMUM(8, 100), - HID_RI_REPORT_SIZE(8, 0x08), - HID_RI_REPORT_COUNT(8, 0x02), - HID_RI_INPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_ABSOLUTE | HID_IOF_NON_VOLATILE), - HID_RI_END_COLLECTION(0), - HID_RI_USAGE_PAGE(8, 0x09), /* Button */ - HID_RI_USAGE_MINIMUM(8, 0x01), - HID_RI_USAGE_MAXIMUM(8, 0x02), - HID_RI_LOGICAL_MINIMUM(8, 0x00), - HID_RI_LOGICAL_MAXIMUM(8, 0x01), - HID_RI_REPORT_SIZE(8, 0x01), - HID_RI_REPORT_COUNT(8, 0x02), - HID_RI_INPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_ABSOLUTE | HID_IOF_NON_VOLATILE), - HID_RI_REPORT_SIZE(8, 0x06), - HID_RI_REPORT_COUNT(8, 0x01), - HID_RI_INPUT(8, HID_IOF_CONSTANT), - HID_RI_END_COLLECTION(0), -}; + { + /* Use the HID class driver's standard Joystick report. + * Min X/Y Axis values: -100 + * Max X/Y Axis values: 100 + * Buttons: 2 + */ + HID_DESCRIPTOR_JOYSTICK(-100, 100, 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 |