|
|
@@ -406,53 +406,53 @@ const USB_Descriptor_HIDReport_Datatype_t PROGMEM RawReport[] = {
|
|
|
};
|
|
|
#endif
|
|
|
|
|
|
-#ifdef XAP_ENABLE
|
|
|
-const USB_Descriptor_HIDReport_Datatype_t PROGMEM XapReport[] = {
|
|
|
- HID_RI_USAGE_PAGE(16, 0xFF51), // Vendor Defined ('Q')
|
|
|
- HID_RI_USAGE(8, 0x58), // Vendor Defined ('X')
|
|
|
+#ifdef CONSOLE_ENABLE
|
|
|
+const USB_Descriptor_HIDReport_Datatype_t PROGMEM ConsoleReport[] = {
|
|
|
+ HID_RI_USAGE_PAGE(16, 0xFF31), // Vendor Defined (PJRC Teensy compatible)
|
|
|
+ HID_RI_USAGE(8, 0x74), // Vendor Defined (PJRC Teensy compatible)
|
|
|
HID_RI_COLLECTION(8, 0x01), // Application
|
|
|
// Data to host
|
|
|
- HID_RI_USAGE(8, 0x62), // Vendor Defined
|
|
|
+ HID_RI_USAGE(8, 0x75), // Vendor Defined
|
|
|
HID_RI_LOGICAL_MINIMUM(8, 0x00),
|
|
|
HID_RI_LOGICAL_MAXIMUM(16, 0x00FF),
|
|
|
- HID_RI_REPORT_COUNT(8, XAP_EPSIZE),
|
|
|
+ HID_RI_REPORT_COUNT(8, CONSOLE_EPSIZE),
|
|
|
HID_RI_REPORT_SIZE(8, 0x08),
|
|
|
HID_RI_INPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_ABSOLUTE),
|
|
|
|
|
|
// Data from host
|
|
|
- HID_RI_USAGE(8, 0x63), // Vendor Defined
|
|
|
+ HID_RI_USAGE(8, 0x76), // Vendor Defined
|
|
|
HID_RI_LOGICAL_MINIMUM(8, 0x00),
|
|
|
HID_RI_LOGICAL_MAXIMUM(16, 0x00FF),
|
|
|
- HID_RI_REPORT_COUNT(8, XAP_EPSIZE),
|
|
|
+ HID_RI_REPORT_COUNT(8, CONSOLE_EPSIZE),
|
|
|
HID_RI_REPORT_SIZE(8, 0x08),
|
|
|
HID_RI_OUTPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_ABSOLUTE | HID_IOF_NON_VOLATILE),
|
|
|
HID_RI_END_COLLECTION(0),
|
|
|
};
|
|
|
-#endif // XAP_ENABLE
|
|
|
+#endif
|
|
|
|
|
|
-#ifdef CONSOLE_ENABLE
|
|
|
-const USB_Descriptor_HIDReport_Datatype_t PROGMEM ConsoleReport[] = {
|
|
|
- HID_RI_USAGE_PAGE(16, 0xFF31), // Vendor Defined (PJRC Teensy compatible)
|
|
|
- HID_RI_USAGE(8, 0x74), // Vendor Defined (PJRC Teensy compatible)
|
|
|
+#ifdef XAP_ENABLE
|
|
|
+const USB_Descriptor_HIDReport_Datatype_t PROGMEM XapReport[] = {
|
|
|
+ HID_RI_USAGE_PAGE(16, 0xFF51), // Vendor Defined ('Q')
|
|
|
+ HID_RI_USAGE(8, 0x58), // Vendor Defined ('X')
|
|
|
HID_RI_COLLECTION(8, 0x01), // Application
|
|
|
// Data to host
|
|
|
- HID_RI_USAGE(8, 0x75), // Vendor Defined
|
|
|
+ HID_RI_USAGE(8, 0x62), // Vendor Defined
|
|
|
HID_RI_LOGICAL_MINIMUM(8, 0x00),
|
|
|
HID_RI_LOGICAL_MAXIMUM(16, 0x00FF),
|
|
|
- HID_RI_REPORT_COUNT(8, CONSOLE_EPSIZE),
|
|
|
+ HID_RI_REPORT_COUNT(8, XAP_EPSIZE),
|
|
|
HID_RI_REPORT_SIZE(8, 0x08),
|
|
|
HID_RI_INPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_ABSOLUTE),
|
|
|
|
|
|
// Data from host
|
|
|
- HID_RI_USAGE(8, 0x76), // Vendor Defined
|
|
|
+ HID_RI_USAGE(8, 0x63), // Vendor Defined
|
|
|
HID_RI_LOGICAL_MINIMUM(8, 0x00),
|
|
|
HID_RI_LOGICAL_MAXIMUM(16, 0x00FF),
|
|
|
- HID_RI_REPORT_COUNT(8, CONSOLE_EPSIZE),
|
|
|
+ HID_RI_REPORT_COUNT(8, XAP_EPSIZE),
|
|
|
HID_RI_REPORT_SIZE(8, 0x08),
|
|
|
HID_RI_OUTPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_ABSOLUTE | HID_IOF_NON_VOLATILE),
|
|
|
HID_RI_END_COLLECTION(0),
|
|
|
};
|
|
|
-#endif
|
|
|
+#endif // XAP_ENABLE
|
|
|
|
|
|
/*
|
|
|
* Device descriptor
|
|
|
@@ -603,56 +603,6 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = {
|
|
|
},
|
|
|
#endif
|
|
|
|
|
|
-#ifdef XAP_ENABLE
|
|
|
- /*
|
|
|
- * QMK XAP
|
|
|
- */
|
|
|
- .Xap_Interface = {
|
|
|
- .Header = {
|
|
|
- .Size = sizeof(USB_Descriptor_Interface_t),
|
|
|
- .Type = DTYPE_Interface
|
|
|
- },
|
|
|
- .InterfaceNumber = XAP_INTERFACE,
|
|
|
- .AlternateSetting = 0x00,
|
|
|
- .TotalEndpoints = 2,
|
|
|
- .Class = HID_CSCP_HIDClass,
|
|
|
- .SubClass = HID_CSCP_NonBootSubclass,
|
|
|
- .Protocol = HID_CSCP_NonBootProtocol,
|
|
|
- .InterfaceStrIndex = NO_DESCRIPTOR
|
|
|
- },
|
|
|
- .Xap_HID = {
|
|
|
- .Header = {
|
|
|
- .Size = sizeof(USB_HID_Descriptor_HID_t),
|
|
|
- .Type = HID_DTYPE_HID
|
|
|
- },
|
|
|
- .HIDSpec = VERSION_BCD(1, 1, 1),
|
|
|
- .CountryCode = 0x00,
|
|
|
- .TotalReportDescriptors = 1,
|
|
|
- .HIDReportType = HID_DTYPE_Report,
|
|
|
- .HIDReportLength = sizeof(XapReport)
|
|
|
- },
|
|
|
- .Xap_INEndpoint = {
|
|
|
- .Header = {
|
|
|
- .Size = sizeof(USB_Descriptor_Endpoint_t),
|
|
|
- .Type = DTYPE_Endpoint
|
|
|
- },
|
|
|
- .EndpointAddress = (ENDPOINT_DIR_IN | XAP_IN_EPNUM),
|
|
|
- .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
|
|
|
- .EndpointSize = XAP_EPSIZE,
|
|
|
- .PollingIntervalMS = 0x01
|
|
|
- },
|
|
|
- .Xap_OUTEndpoint = {
|
|
|
- .Header = {
|
|
|
- .Size = sizeof(USB_Descriptor_Endpoint_t),
|
|
|
- .Type = DTYPE_Endpoint
|
|
|
- },
|
|
|
- .EndpointAddress = (ENDPOINT_DIR_OUT | XAP_OUT_EPNUM),
|
|
|
- .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
|
|
|
- .EndpointSize = XAP_EPSIZE,
|
|
|
- .PollingIntervalMS = 0x01
|
|
|
- },
|
|
|
-#endif
|
|
|
-
|
|
|
#if defined(MOUSE_ENABLE) && !defined(MOUSE_SHARED_EP)
|
|
|
/*
|
|
|
* Mouse
|
|
|
@@ -1122,6 +1072,56 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = {
|
|
|
.PollingIntervalMS = USB_POLLING_INTERVAL_MS
|
|
|
},
|
|
|
#endif
|
|
|
+
|
|
|
+#ifdef XAP_ENABLE
|
|
|
+ /*
|
|
|
+ * QMK XAP
|
|
|
+ */
|
|
|
+ .Xap_Interface = {
|
|
|
+ .Header = {
|
|
|
+ .Size = sizeof(USB_Descriptor_Interface_t),
|
|
|
+ .Type = DTYPE_Interface
|
|
|
+ },
|
|
|
+ .InterfaceNumber = XAP_INTERFACE,
|
|
|
+ .AlternateSetting = 0x00,
|
|
|
+ .TotalEndpoints = 2,
|
|
|
+ .Class = HID_CSCP_HIDClass,
|
|
|
+ .SubClass = HID_CSCP_NonBootSubclass,
|
|
|
+ .Protocol = HID_CSCP_NonBootProtocol,
|
|
|
+ .InterfaceStrIndex = NO_DESCRIPTOR
|
|
|
+ },
|
|
|
+ .Xap_HID = {
|
|
|
+ .Header = {
|
|
|
+ .Size = sizeof(USB_HID_Descriptor_HID_t),
|
|
|
+ .Type = HID_DTYPE_HID
|
|
|
+ },
|
|
|
+ .HIDSpec = VERSION_BCD(1, 1, 1),
|
|
|
+ .CountryCode = 0x00,
|
|
|
+ .TotalReportDescriptors = 1,
|
|
|
+ .HIDReportType = HID_DTYPE_Report,
|
|
|
+ .HIDReportLength = sizeof(XapReport)
|
|
|
+ },
|
|
|
+ .Xap_INEndpoint = {
|
|
|
+ .Header = {
|
|
|
+ .Size = sizeof(USB_Descriptor_Endpoint_t),
|
|
|
+ .Type = DTYPE_Endpoint
|
|
|
+ },
|
|
|
+ .EndpointAddress = (ENDPOINT_DIR_IN | XAP_IN_EPNUM),
|
|
|
+ .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
|
|
|
+ .EndpointSize = XAP_EPSIZE,
|
|
|
+ .PollingIntervalMS = 0x01
|
|
|
+ },
|
|
|
+ .Xap_OUTEndpoint = {
|
|
|
+ .Header = {
|
|
|
+ .Size = sizeof(USB_Descriptor_Endpoint_t),
|
|
|
+ .Type = DTYPE_Endpoint
|
|
|
+ },
|
|
|
+ .EndpointAddress = (ENDPOINT_DIR_OUT | XAP_OUT_EPNUM),
|
|
|
+ .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
|
|
|
+ .EndpointSize = XAP_EPSIZE,
|
|
|
+ .PollingIntervalMS = 0x01
|
|
|
+ },
|
|
|
+#endif
|
|
|
};
|
|
|
|
|
|
/*
|
|
|
@@ -1250,14 +1250,6 @@ uint16_t get_usb_descriptor(const uint16_t wValue, const uint16_t wIndex, const
|
|
|
break;
|
|
|
#endif
|
|
|
|
|
|
-#ifdef XAP_ENABLE
|
|
|
- case XAP_INTERFACE:
|
|
|
- Address = &ConfigurationDescriptor.Xap_HID;
|
|
|
- Size = sizeof(USB_HID_Descriptor_HID_t);
|
|
|
-
|
|
|
- break;
|
|
|
-#endif
|
|
|
-
|
|
|
#ifdef CONSOLE_ENABLE
|
|
|
case CONSOLE_INTERFACE:
|
|
|
Address = &ConfigurationDescriptor.Console_HID;
|
|
|
@@ -1265,12 +1257,14 @@ uint16_t get_usb_descriptor(const uint16_t wValue, const uint16_t wIndex, const
|
|
|
|
|
|
break;
|
|
|
#endif
|
|
|
+
|
|
|
#if defined(JOYSTICK_ENABLE) && !defined(JOYSTICK_SHARED_EP)
|
|
|
case JOYSTICK_INTERFACE:
|
|
|
Address = &ConfigurationDescriptor.Joystick_HID;
|
|
|
Size = sizeof(USB_HID_Descriptor_HID_t);
|
|
|
break;
|
|
|
#endif
|
|
|
+
|
|
|
#if defined(DIGITIZER_ENABLE) && !defined(DIGITIZER_SHARED_EP)
|
|
|
case DIGITIZER_INTERFACE:
|
|
|
Address = &ConfigurationDescriptor.Digitizer_HID;
|
|
|
@@ -1278,6 +1272,14 @@ uint16_t get_usb_descriptor(const uint16_t wValue, const uint16_t wIndex, const
|
|
|
|
|
|
break;
|
|
|
#endif
|
|
|
+
|
|
|
+#ifdef XAP_ENABLE
|
|
|
+ case XAP_INTERFACE:
|
|
|
+ Address = &ConfigurationDescriptor.Xap_HID;
|
|
|
+ Size = sizeof(USB_HID_Descriptor_HID_t);
|
|
|
+
|
|
|
+ break;
|
|
|
+#endif
|
|
|
}
|
|
|
|
|
|
break;
|
|
|
@@ -1315,14 +1317,6 @@ uint16_t get_usb_descriptor(const uint16_t wValue, const uint16_t wIndex, const
|
|
|
break;
|
|
|
#endif
|
|
|
|
|
|
-#ifdef XAP_ENABLE
|
|
|
- case XAP_INTERFACE:
|
|
|
- Address = &XapReport;
|
|
|
- Size = sizeof(XapReport);
|
|
|
-
|
|
|
- break;
|
|
|
-#endif
|
|
|
-
|
|
|
#ifdef CONSOLE_ENABLE
|
|
|
case CONSOLE_INTERFACE:
|
|
|
Address = &ConsoleReport;
|
|
|
@@ -1342,6 +1336,14 @@ uint16_t get_usb_descriptor(const uint16_t wValue, const uint16_t wIndex, const
|
|
|
Size = sizeof(DigitizerReport);
|
|
|
break;
|
|
|
#endif
|
|
|
+
|
|
|
+#ifdef XAP_ENABLE
|
|
|
+ case XAP_INTERFACE:
|
|
|
+ Address = &XapReport;
|
|
|
+ Size = sizeof(XapReport);
|
|
|
+
|
|
|
+ break;
|
|
|
+#endif
|
|
|
}
|
|
|
|
|
|
break;
|