aboutsummaryrefslogtreecommitdiffstats
path: root/Demos/Device/LowLevel/GenericHID
diff options
context:
space:
mode:
Diffstat (limited to 'Demos/Device/LowLevel/GenericHID')
-rw-r--r--Demos/Device/LowLevel/GenericHID/Descriptors.c10
-rw-r--r--Demos/Device/LowLevel/GenericHID/Descriptors.h27
-rw-r--r--Demos/Device/LowLevel/GenericHID/GenericHID.c4
-rw-r--r--Demos/Device/LowLevel/GenericHID/GenericHID.h6
4 files changed, 8 insertions, 39 deletions
diff --git a/Demos/Device/LowLevel/GenericHID/Descriptors.c b/Demos/Device/LowLevel/GenericHID/Descriptors.c
index 440179645..79cecb587 100644
--- a/Demos/Device/LowLevel/GenericHID/Descriptors.c
+++ b/Demos/Device/LowLevel/GenericHID/Descriptors.c
@@ -130,12 +130,12 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
.HID_GenericHID =
{
- .Header = {.Size = sizeof(USB_Descriptor_HID_t), .Type = DTYPE_HID},
+ .Header = {.Size = sizeof(USB_HID_Descriptor_HID_t), .Type = HID_DTYPE_HID},
.HIDSpec = VERSION_BCD(01.11),
.CountryCode = 0x00,
.TotalReportDescriptors = 1,
- .HIDReportType = DTYPE_Report,
+ .HIDReportType = HID_DTYPE_Report,
.HIDReportLength = sizeof(GenericReport)
},
@@ -237,11 +237,11 @@ uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
}
break;
- case DTYPE_HID:
+ case HID_DTYPE_HID:
Address = &ConfigurationDescriptor.HID_GenericHID;
- Size = sizeof(USB_Descriptor_HID_t);
+ Size = sizeof(USB_HID_Descriptor_HID_t);
break;
- case DTYPE_Report:
+ case HID_DTYPE_Report:
Address = &GenericReport;
Size = sizeof(GenericReport);
break;
diff --git a/Demos/Device/LowLevel/GenericHID/Descriptors.h b/Demos/Device/LowLevel/GenericHID/Descriptors.h
index 2033c27e7..4d952e563 100644
--- a/Demos/Device/LowLevel/GenericHID/Descriptors.h
+++ b/Demos/Device/LowLevel/GenericHID/Descriptors.h
@@ -42,25 +42,6 @@
#include <avr/pgmspace.h>
/* Type Defines: */
- /** Type define for the HID class specific HID descriptor, to describe the HID device's specifications. Refer to the HID
- * specification for details on the structure elements.
- */
- typedef struct
- {
- USB_Descriptor_Header_t Header;
-
- uint16_t HIDSpec;
- uint8_t CountryCode;
-
- uint8_t TotalReportDescriptors;
-
- uint8_t HIDReportType;
- uint16_t HIDReportLength;
- } USB_Descriptor_HID_t;
-
- /** Type define for the data type used to store HID report descriptor elements. */
- typedef uint8_t USB_Descriptor_HIDReport_Datatype_t;
-
/** Type define for the device configuration descriptor structure. This must be defined in the
* application code, as the configuration descriptor contains several sub-descriptors which
* vary between devices, and which describe the device's usage to the host.
@@ -69,7 +50,7 @@
{
USB_Descriptor_Configuration_Header_t Config;
USB_Descriptor_Interface_t HID_Interface;
- USB_Descriptor_HID_t HID_GenericHID;
+ USB_HID_Descriptor_HID_t HID_GenericHID;
USB_Descriptor_Endpoint_t HID_ReportINEndpoint;
USB_Descriptor_Endpoint_t HID_ReportOUTEndpoint;
} USB_Descriptor_Configuration_t;
@@ -87,12 +68,6 @@
/** Size in bytes of the Generic HID reports (including report ID byte). */
#define GENERIC_REPORT_SIZE 8
- /** Descriptor header type value, to indicate a HID class HID descriptor. */
- #define DTYPE_HID 0x21
-
- /** Descriptor header type value, to indicate a HID class HID report descriptor. */
- #define DTYPE_Report 0x22
-
/* Function Prototypes: */
uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
const uint8_t wIndex,
diff --git a/Demos/Device/LowLevel/GenericHID/GenericHID.c b/Demos/Device/LowLevel/GenericHID/GenericHID.c
index d7c2e3728..d0e89ca84 100644
--- a/Demos/Device/LowLevel/GenericHID/GenericHID.c
+++ b/Demos/Device/LowLevel/GenericHID/GenericHID.c
@@ -116,7 +116,7 @@ void EVENT_USB_Device_UnhandledControlRequest(void)
/* Handle HID Class specific requests */
switch (USB_ControlRequest.bRequest)
{
- case REQ_GetReport:
+ case HID_REQ_GetReport:
if (USB_ControlRequest.bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))
{
uint8_t GenericData[GENERIC_REPORT_SIZE];
@@ -130,7 +130,7 @@ void EVENT_USB_Device_UnhandledControlRequest(void)
}
break;
- case REQ_SetReport:
+ case HID_REQ_SetReport:
if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
{
uint8_t GenericData[GENERIC_REPORT_SIZE];
diff --git a/Demos/Device/LowLevel/GenericHID/GenericHID.h b/Demos/Device/LowLevel/GenericHID/GenericHID.h
index 840902e51..d8900271c 100644
--- a/Demos/Device/LowLevel/GenericHID/GenericHID.h
+++ b/Demos/Device/LowLevel/GenericHID/GenericHID.h
@@ -51,12 +51,6 @@
#include <LUFA/Drivers/Board/LEDs.h>
/* Macros: */
- /** HID Class specific request to get the next HID report from the device. */
- #define REQ_GetReport 0x01
-
- /** HID Class specific request to send the next HID report to the device. */
- #define REQ_SetReport 0x09
-
/** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
#define LEDMASK_USB_NOTREADY LEDS_LED1