summaryrefslogtreecommitdiffstats
path: root/app/mouse.c
diff options
context:
space:
mode:
Diffstat (limited to 'app/mouse.c')
-rw-r--r--app/mouse.c28
1 files changed, 21 insertions, 7 deletions
diff --git a/app/mouse.c b/app/mouse.c
index 0431349..03879f0 100644
--- a/app/mouse.c
+++ b/app/mouse.c
@@ -38,6 +38,20 @@ static const uint8_t mouse_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 */
};
@@ -64,22 +78,22 @@ static const struct
const struct usb_endpoint_descriptor mouse_endpoint = {
.bLength = USB_DT_ENDPOINT_SIZE,
.bDescriptorType = USB_DT_ENDPOINT,
- .bEndpointAddress = 0x82,
+ .bEndpointAddress = 0x84,
.bmAttributes = USB_ENDPOINT_ATTR_INTERRUPT,
- .wMaxPacketSize = 4,
- .bInterval = 0x1, //0x20,
+ .wMaxPacketSize = 5,
+ .bInterval = 0x1, //0x20,
};
const struct usb_interface_descriptor mouse_iface = {
.bLength = USB_DT_INTERFACE_SIZE,
.bDescriptorType = USB_DT_INTERFACE,
- .bInterfaceNumber = 1,
+ .bInterfaceNumber = 3,
.bAlternateSetting = 0,
.bNumEndpoints = 1,
.bInterfaceClass = USB_CLASS_HID,
.bInterfaceSubClass = 1, /* boot */
.bInterfaceProtocol = 2, /* mouse */
- .iInterface = 0,
+ .iInterface = 8,
.endpoint = &mouse_endpoint,
@@ -101,7 +115,7 @@ void
mouse_test (void)
{
static int c = 1;
- uint8_t buf[4] = { 0, 0, 0, 0 };
+ uint8_t buf[5] = { 0, 0, 0, 0 };
buf[0] = c & 7;
@@ -111,5 +125,5 @@ mouse_test (void)
c++;
- usbd_ep_write_packet (usbd_dev, 0x82, buf, 4);
+ usbd_ep_write_packet (usbd_dev, 0x84, buf, 5);
}