Put the files that contain the usb descriptors into the newly created usb_descriptors directory.

This commit is contained in:
László Monda
2016-09-26 18:54:16 +02:00
parent 77f956d5bb
commit 9e3d512e89
15 changed files with 2 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
#include "usb_api.h"
#include "usb_descriptor_hid.h"
#include "usb_descriptor_mouse_report.h"
#include "usb_descriptor_generic_hid_report.h"
usb_status_t USB_DeviceGetHidDescriptor(
usb_device_handle handle, usb_device_get_hid_descriptor_struct_t *hidDescriptor)
{
return kStatus_USB_InvalidRequest;
}
usb_status_t USB_DeviceGetHidReportDescriptor(
usb_device_handle handle, usb_device_get_hid_report_descriptor_struct_t *hidReportDescriptor)
{
if (USB_MOUSE_INTERFACE_INDEX == hidReportDescriptor->interfaceNumber) {
hidReportDescriptor->buffer = UsbMouseReportDescriptor;
hidReportDescriptor->length = USB_MOUSE_REPORT_DESCRIPTOR_LENGTH;
} else if (USB_KEYBOARD_INTERFACE_INDEX == hidReportDescriptor->interfaceNumber) {
hidReportDescriptor->buffer = UsbKeyboardReportDescriptor;
hidReportDescriptor->length = USB_KEYBOARD_REPORT_DESCRIPTOR_LENGTH;
} else if (USB_GENERIC_HID_INTERFACE_INDEX == hidReportDescriptor->interfaceNumber) {
hidReportDescriptor->buffer = UsbGenericHidReportDescriptor;
hidReportDescriptor->length = USB_GENERIC_HID_REPORT_DESCRIPTOR_LENGTH;
} else {
return kStatus_USB_InvalidRequest;
}
return kStatus_USB_Success;
}
usb_status_t USB_DeviceGetHidPhysicalDescriptor(
usb_device_handle handle, usb_device_get_hid_physical_descriptor_struct_t *hidPhysicalDescriptor)
{
return kStatus_USB_InvalidRequest;
}