From 39044e272695c5f9c43a0560ae00ea440881d464 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 15 Jul 2015 20:17:30 +0100 Subject: from-no --- app/tablet.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'app/tablet.c') diff --git a/app/tablet.c b/app/tablet.c index 5445c29..9fec20f 100644 --- a/app/tablet.c +++ b/app/tablet.c @@ -44,6 +44,20 @@ static const uint8_t tablet_report_descriptor[] = { 0x75, 0x06, // REPORT_SIZE (6) 0x95, 0x01, // REPORT_COUNT (1) 0xb1, 0x01, // FEATURE (Cnst,Ary,Abs) + 0x05, 0x01, /* USAGE_PAGE (Generic Desktop) */ + 0x09, 0x80, /* USAGE (System Control) */ + 0xA1, 0x01, /* COLLECTION (Application) */ + 0x75, 0x02, /* REPORT_SIZE (2) */ + 0x95, 0x01, /* REPORT_COUNT (1) */ + 0x15, 0x01, /* LOGICAL_MIN (1) */ + 0x25, 0x03, /* LOGICAL_MAX (3) */ + 0x09, 0x82, /* USAGE (System Sleep) */ + 0x09, 0x81, /* USAGE (System Power Down) */ + 0x09, 0x83, /* USAGE (System Wake Up) */ + 0x81, 0x60, /* INPUT (Data Ary Abs NPrf Null) */ + 0x75, 0x06, /* REPORT_SIZE (6) */ + 0x81, 0x03, /* INPUT (Cnst Var Abs) */ + 0xc0, /* END COLLECTION */ 0xc0 // END_COLLECTION }; @@ -72,7 +86,7 @@ const struct usb_endpoint_descriptor tablet_endpoint = { .bDescriptorType = USB_DT_ENDPOINT, .bEndpointAddress = 0x83, .bmAttributes = USB_ENDPOINT_ATTR_INTERRUPT, - .wMaxPacketSize = 6, + .wMaxPacketSize = 7, .bInterval = 0x1 //0x20, }; @@ -85,7 +99,7 @@ const struct usb_interface_descriptor tablet_iface = { .bInterfaceClass = USB_CLASS_HID, .bInterfaceSubClass = 1, /* boot */ .bInterfaceProtocol = 2, /* tablet */ - .iInterface = 0, + .iInterface = 7, .endpoint = &tablet_endpoint, @@ -107,7 +121,7 @@ void tablet_test (void) { static int c = 0; - uint8_t buf[6] = { 0, 0, 0, 0, 0 }; + uint8_t buf[7] = { 0, 0, 0, 0, 0 ,0}; buf[0] = c & 0xff; buf[1] = (c & 0x7fff) >> 8; @@ -118,5 +132,5 @@ tablet_test (void) c++; - usbd_ep_write_packet (usbd_dev, 0x83, buf, 6); + usbd_ep_write_packet (usbd_dev, 0x83, buf, 7); } -- cgit v1.2.3