Example #1
0
#define HID_INPUT_REPORT_BYTES       1              /* size of report in Bytes */
#define HID_OUTPUT_REPORT_BYTES      1              /* size of report in Bytes */
#define HID_FEATURE_REPORT_BYTES     1              /* size of report in Bytes */

#ifdef __GNUC__
#define ALIGN4 __attribute__ ((aligned(4)))
#else // Keil
#define ALIGN4 __align(4)
#endif

ALIGN4 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  ( HID_INPUT_REPORT_BYTES   ),
    HID_Usage        ( 0x01                     ),
    HID_Input        ( HID_Data | HID_Variable | HID_Absolute ),
    HID_ReportCount  ( HID_OUTPUT_REPORT_BYTES  ),
    HID_Usage        ( 0x01                     ),
    HID_Output       ( HID_Data | HID_Variable | HID_Absolute ),
    HID_ReportCount  ( HID_FEATURE_REPORT_BYTES ),
    HID_Usage        ( 0x01                     ),
    HID_Feature      ( HID_Data | HID_Variable | HID_Absolute ),
  HID_EndCollection,
};
const uint16_t HID_ReportDescSize = sizeof(HID_ReportDescriptor);
    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**************************************************************************/
#include "descriptors.h"

#ifdef CFG_USB

#ifdef CFG_USB_HID_KEYBOARD
ALIGNED(4) const uint8_t HID_KeyboardReportDescriptor[] = {
  HID_UsagePage  ( HID_USAGE_PAGE_GENERIC     ),
  HID_Usage      ( HID_USAGE_GENERIC_KEYBOARD ),
  HID_Collection ( HID_Application            ),
    HID_UsagePage (HID_USAGE_PAGE_KEYBOARD),
      HID_UsageMin    (224                                     ),
      HID_UsageMax    (231                                     ),
      HID_LogicalMin  ( 0                                      ),
      HID_LogicalMax  ( 1                                      ),

      HID_ReportCount ( 8                                      ), /* 8 bits */
      HID_ReportSize  ( 1                                      ),
      HID_Input       ( HID_Data | HID_Variable | HID_Absolute ), /* maskable modifier key */

      HID_ReportCount ( 1                                      ),
      HID_ReportSize  ( 8                                      ),
      HID_Input       (HID_Constant                            ), /* reserved */

    HID_UsagePage  ( HID_USAGE_PAGE_LED                   ),
      HID_UsageMin    (1                                       ),
      HID_UsageMax    (5                                       ),
      HID_ReportCount (5                                       ),
      HID_ReportSize  (1                                       ),
Example #3
0
#include "usb.h"
#include "hid.h"
#include "usbcfg.h"
#include "usbdesc.h"


/* HID Report Descriptor */
const uint8_t HID_ReportDescriptor[] = {
    HID_UsagePageVendor(0x00),
    HID_Usage(0x01),
    HID_Collection(HID_Application),
    HID_UsagePage(HID_USAGE_PAGE_BUTTON),
    HID_UsageMin(1),
    HID_UsageMax(3),
    HID_LogicalMin(0),
    HID_LogicalMax(1),
    HID_ReportCount(3),
    HID_ReportSize(1),
    HID_Input(HID_Data | HID_Variable | HID_Absolute),
    HID_ReportCount(1),
    HID_ReportSize(5),
    HID_Input(HID_Constant),
    HID_UsagePage(HID_USAGE_PAGE_LED),
    HID_Usage(HID_USAGE_LED_GENERIC_INDICATOR),
    HID_LogicalMin(0),
    HID_LogicalMax(1),
    HID_ReportCount(8),
    HID_ReportSize(1),
    HID_Output(HID_Data | HID_Variable | HID_Absolute),
    HID_EndCollection,
Example #4
0
 * Public types/enumerations/variables
 ****************************************************************************/

/**
 * HID Mouse Report Descriptor
 */
const uint8_t Mouse_ReportDescriptor[] = {
	HID_UsagePage(HID_USAGE_PAGE_GENERIC),
	HID_Usage(HID_USAGE_GENERIC_MOUSE),
	HID_Collection(HID_Application),
	HID_Usage(HID_USAGE_GENERIC_POINTER),
	HID_Collection(HID_Physical),
	HID_UsagePage(HID_USAGE_PAGE_BUTTON),
	HID_UsageMin(1),
	HID_UsageMax(3),
	HID_LogicalMin(0),
	HID_LogicalMax(1),
	HID_ReportCount(3),
	HID_ReportSize(1),
	HID_Input(HID_Data | HID_Variable | HID_Absolute),
	HID_ReportCount(1),
	HID_ReportSize(5),
	HID_Input(HID_Constant),
	HID_UsagePage(HID_USAGE_PAGE_GENERIC),
	HID_Usage(HID_USAGE_GENERIC_X),
	HID_Usage(HID_USAGE_GENERIC_Y),
	HID_LogicalMin( (uint8_t) -127),
	HID_LogicalMax(127),
	HID_ReportSize(8),
	HID_ReportCount(2),
	HID_Input(HID_Data | HID_Variable | HID_Relative),