diff options
author | Dean Camera <dean@fourwalledcubicle.com> | 2011-01-30 14:14:04 +0000 |
---|---|---|
committer | Dean Camera <dean@fourwalledcubicle.com> | 2011-01-30 14:14:04 +0000 |
commit | e6dc95163094692d11715711d5c1aaa19841dd77 (patch) | |
tree | f3935657b403333b3578581a2d76944cb9218b12 /Demos/Device/ClassDriver | |
parent | a852ea8e43d6df9642df3524a974073d2229fa4c (diff) | |
download | lufa-e6dc95163094692d11715711d5c1aaa19841dd77.tar.gz lufa-e6dc95163094692d11715711d5c1aaa19841dd77.tar.bz2 lufa-e6dc95163094692d11715711d5c1aaa19841dd77.zip |
Add new HID_DESCRIPTOR_VENDOR() macro, change over all projects and Device ClassDriver demos to use it.
Fix reversed byte ordering of multi-byte HID data.
Added support to the HID parser for extended USAGE items that contain the usage page as well as the usage index.
Removed the HID_IOF_NON_VOLATILE and HID_IOF_VOLATILE flags from HID INPUT items where the flag is invalid. Changed over HID OUTPUT items to use HID_IOF_NON_VOLATILE.
Change over MagStripe project to use HID_DESCRIPTOR_KEYBOARD() for its HID report. Change over MouseHostDevice demo to use HID_DESCRIPTOR_MOUSE() for its HID report.
Diffstat (limited to 'Demos/Device/ClassDriver')
5 files changed, 23 insertions, 31 deletions
diff --git a/Demos/Device/ClassDriver/GenericHID/Descriptors.c b/Demos/Device/ClassDriver/GenericHID/Descriptors.c index aeec36db1..6928baa6f 100644 --- a/Demos/Device/ClassDriver/GenericHID/Descriptors.c +++ b/Demos/Device/ClassDriver/GenericHID/Descriptors.c @@ -45,22 +45,14 @@ */ USB_Descriptor_HIDReport_Datatype_t PROGMEM GenericReport[] = { - HID_RI_USAGE_PAGE(16, 0x00FF), /* Vendor Page 1 */ - HID_RI_USAGE(8, 0x01), /* Vendor Usage 1 */ - HID_RI_COLLECTION(8, 0x01), /* Vendor Usage 1 */ - HID_RI_USAGE(8, 0x02), /* Vendor Usage 2 */ - HID_RI_LOGICAL_MINIMUM(8, 0x00), - HID_RI_LOGICAL_MAXIMUM(8, 0xFF), - HID_RI_REPORT_SIZE(8, 0x08), - HID_RI_REPORT_COUNT(8, GENERIC_REPORT_SIZE), - HID_RI_INPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_ABSOLUTE | HID_IOF_VOLATILE), - HID_RI_USAGE(8, 0x03), /* Vendor Usage 3 */ - HID_RI_LOGICAL_MINIMUM(8, 0x00), - HID_RI_LOGICAL_MAXIMUM(8, 0xFF), - HID_RI_REPORT_SIZE(8, 0x08), - HID_RI_REPORT_COUNT(8, GENERIC_REPORT_SIZE), - HID_RI_OUTPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_ABSOLUTE | HID_IOF_VOLATILE), - HID_RI_END_COLLECTION(0), + /* Use the HID class driver's standard Joystick report. + * Vendor Usage Page: 1 + * Vendor Collection Usage: 1 + * Vendor Report IN Usage: 2 + * Vendor Report OUT Usage: 3 + * Vendor Report Size: GENERIC_REPORT_SIZE + */ + HID_DESCRIPTOR_VENDOR(0x00, 0x01, 0x02, 0x03, GENERIC_REPORT_SIZE) }; /** Device descriptor structure. This descriptor, located in FLASH memory, describes the overall diff --git a/Demos/Device/ClassDriver/Joystick/Descriptors.c b/Demos/Device/ClassDriver/Joystick/Descriptors.c index e421d3f02..75605e154 100644 --- a/Demos/Device/ClassDriver/Joystick/Descriptors.c +++ b/Demos/Device/ClassDriver/Joystick/Descriptors.c @@ -44,14 +44,14 @@ * more details on HID report descriptors. */ USB_Descriptor_HIDReport_Datatype_t PROGMEM JoystickReport[] = - { - /* 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) - }; +{ + /* 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 diff --git a/Demos/Device/ClassDriver/KeyboardMouse/Descriptors.h b/Demos/Device/ClassDriver/KeyboardMouse/Descriptors.h index cd8ba0588..0550e69af 100644 --- a/Demos/Device/ClassDriver/KeyboardMouse/Descriptors.h +++ b/Demos/Device/ClassDriver/KeyboardMouse/Descriptors.h @@ -51,10 +51,10 @@ USB_Descriptor_Configuration_Header_t Config; USB_Descriptor_Interface_t HID1_KeyboardInterface; USB_HID_Descriptor_HID_t HID1_KeyboardHID; - USB_Descriptor_Endpoint_t HID1_ReportINEndpoint; + USB_Descriptor_Endpoint_t HID1_ReportINEndpoint; USB_Descriptor_Interface_t HID2_MouseInterface; USB_HID_Descriptor_HID_t HID2_MouseHID; - USB_Descriptor_Endpoint_t HID2_ReportINEndpoint; + USB_Descriptor_Endpoint_t HID2_ReportINEndpoint; } USB_Descriptor_Configuration_t; /* Macros: */ diff --git a/Demos/Device/ClassDriver/KeyboardMouseMultiReport/Descriptors.c b/Demos/Device/ClassDriver/KeyboardMouseMultiReport/Descriptors.c index 6fa6dc56a..19f282f37 100644 --- a/Demos/Device/ClassDriver/KeyboardMouseMultiReport/Descriptors.c +++ b/Demos/Device/ClassDriver/KeyboardMouseMultiReport/Descriptors.c @@ -61,7 +61,7 @@ USB_Descriptor_HIDReport_Datatype_t PROGMEM HIDReport[] = HID_RI_LOGICAL_MAXIMUM(8, 0x01),
HID_RI_REPORT_COUNT(8, 0x03),
HID_RI_REPORT_SIZE(8, 0x01),
- HID_RI_INPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_ABSOLUTE | HID_IOF_VOLATILE),
+ HID_RI_INPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_ABSOLUTE),
HID_RI_REPORT_COUNT(8, 0x01),
HID_RI_REPORT_SIZE(8, 0x05),
HID_RI_INPUT(8, HID_IOF_CONSTANT),
@@ -74,7 +74,7 @@ USB_Descriptor_HIDReport_Datatype_t PROGMEM HIDReport[] = HID_RI_PHYSICAL_MAXIMUM(8, 1),
HID_RI_REPORT_COUNT(8, 0x02),
HID_RI_REPORT_SIZE(8, 0x08),
- HID_RI_INPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_RELATIVE | HID_IOF_NON_VOLATILE),
+ HID_RI_INPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_RELATIVE),
HID_RI_END_COLLECTION(0),
HID_RI_END_COLLECTION(0),
@@ -90,7 +90,7 @@ USB_Descriptor_HIDReport_Datatype_t PROGMEM HIDReport[] = HID_RI_LOGICAL_MAXIMUM(8, 0x01),
HID_RI_REPORT_SIZE(8, 0x01),
HID_RI_REPORT_COUNT(8, 0x08),
- HID_RI_INPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_ABSOLUTE | HID_IOF_NON_VOLATILE),
+ HID_RI_INPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_ABSOLUTE),
HID_RI_REPORT_COUNT(8, 0x01),
HID_RI_REPORT_SIZE(8, 0x08),
HID_RI_INPUT(8, HID_IOF_CONSTANT),
@@ -110,7 +110,7 @@ USB_Descriptor_HIDReport_Datatype_t PROGMEM HIDReport[] = HID_RI_USAGE_MAXIMUM(8, 0x65), /* Keyboard Application */
HID_RI_REPORT_COUNT(8, 0x06),
HID_RI_REPORT_SIZE(8, 0x08),
- HID_RI_INPUT(8, HID_IOF_DATA | HID_IOF_ARRAY | HID_IOF_ABSOLUTE | HID_IOF_NON_VOLATILE),
+ HID_RI_INPUT(8, HID_IOF_DATA | HID_IOF_ARRAY | HID_IOF_ABSOLUTE),
HID_RI_END_COLLECTION(0),
};
diff --git a/Demos/Device/ClassDriver/KeyboardMouseMultiReport/Descriptors.h b/Demos/Device/ClassDriver/KeyboardMouseMultiReport/Descriptors.h index 45dfa0f3b..d6c7a06a2 100644 --- a/Demos/Device/ClassDriver/KeyboardMouseMultiReport/Descriptors.h +++ b/Demos/Device/ClassDriver/KeyboardMouseMultiReport/Descriptors.h @@ -51,7 +51,7 @@ USB_Descriptor_Configuration_Header_t Config;
USB_Descriptor_Interface_t HID_Interface;
USB_HID_Descriptor_HID_t HID_HIDData;
- USB_Descriptor_Endpoint_t HID_ReportINEndpoint;
+ USB_Descriptor_Endpoint_t HID_ReportINEndpoint;
} USB_Descriptor_Configuration_t;
/* Macros: */
|