Beispiel #1
0
 * copyright, permission, and disclaimer notice must appear in all copies of
 * this code.
 */

#include "internal.h"
#include "app_usbd_cfg.h"

/*****************************************************************************
 * Public types/enumerations/variables
 ****************************************************************************/

/**
 * HID Report Descriptor
 */
const uint8_t HID_ReportDescriptor[] = {
	HID_UsagePageVendor(0x00),
	HID_Usage(0x01),
	HID_Collection(HID_Application),
	HID_LogicalMin(0),	/* value range: 0 - 0xFF */
	HID_LogicalMaxS(0xFF),
	HID_ReportSize(8),	/* 8 bits */
	HID_ReportCount(DEVICE_USB_HID_INPUT_REPORT_SIZE),
	HID_Usage(0x01),
	HID_Input(HID_Data | HID_Variable | HID_Absolute),
	HID_ReportCount(DEVICE_USB_HID_OUTPUT_REPORT_SIZE),
	HID_Usage(0x01),
	HID_Output(HID_Data | HID_Variable | HID_Absolute),
	HID_ReportCount(DEVICE_USB_HID_FEATURE_REPORT_SIZE),
	HID_Usage(0x01),
	HID_Feature(HID_Data | HID_Variable | HID_Absolute),
	HID_EndCollection,
    HID_EndCollection,

  HID_EndCollection,
};
#endif

#ifdef CFG_USB_HID_GENERIC

#define  HID_GENERIC_USAGEPAGE_VENDOR  0x00
#define  HID_GENERIC_USAGE_COLLECTION  0x01
#define  HID_GENERIC_USAGE_IN          0x02
#define  HID_GENERIC_USAGE_OUT         0x03

ALIGNED(4) const uint8_t HID_GenericReportDescriptor[] = {
    HID_UsagePageVendor (HID_GENERIC_USAGEPAGE_VENDOR ),
    HID_Usage           (HID_GENERIC_USAGE_COLLECTION ),
    HID_Collection      (HID_Application              ),
      HID_Usage       (HID_GENERIC_USAGE_IN                   ),
      HID_LogicalMin  (0x00                                   ),
      HID_LogicalMax  (0xff                                   ),
      HID_ReportSize  (8                                      ),
      HID_ReportCount (CFG_USB_HID_GENERIC_REPORT_SIZE        ),
      HID_Input       (HID_Data | HID_Variable | HID_Absolute ),

      HID_Usage       (HID_GENERIC_USAGE_OUT                   ),
      HID_LogicalMin  (0x00                                    ),
      HID_LogicalMax  (0xff                                    ),
      HID_ReportSize  (8                                       ),
      HID_ReportCount (CFG_USB_HID_GENERIC_REPORT_SIZE         ),
      HID_Output      ( HID_Data | HID_Variable | HID_Absolute ),