summaryrefslogtreecommitdiff
path: root/include/usb_hid_touchpad.h
diff options
context:
space:
mode:
authorNicolas Boichat <drinkcat@chromium.org>2017-08-07 16:20:02 +0800
committerchrome-bot <chrome-bot@chromium.org>2017-08-16 06:03:49 -0700
commitfb58920c9e6c301d2e1931e3c783230af992c647 (patch)
tree78793abe226c3418e0b281573413e1c8458b4758 /include/usb_hid_touchpad.h
parent845739c02267db7596a9388012af0cb3f0629703 (diff)
downloadchrome-ec-fb58920c9e6c301d2e1931e3c783230af992c647.tar.gz
usb_hid_touchpad: Add timestamp field to touch events
We use the unofficial, Windows 8, Relative Scan time HID usage (Digitizer page, 0x56) to add timestamps to our HID touchpad events. The timestamps is a rolling, unsigned, 16-bit integer, with a resolution of 100us (so it wraps around every 6.5s). The host will be able to synchronize to that timestamp, resetting an offset every time the touchpad is quiet a certain amount of time (e.g. 1 second). BRANCH=none BUG=b:63685117 TEST=Flash hammer, timestamps are reported in HID descriptor. Change-Id: Ie5d56a9df14e464d2cdcd559f550d6e3cc81961f Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/603041 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'include/usb_hid_touchpad.h')
-rw-r--r--include/usb_hid_touchpad.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/usb_hid_touchpad.h b/include/usb_hid_touchpad.h
index 16d95b76a1..d7d6dc0363 100644
--- a/include/usb_hid_touchpad.h
+++ b/include/usb_hid_touchpad.h
@@ -8,6 +8,8 @@
#ifndef __CROS_EC_USB_HID_KEYBOARD_H
#define __CROS_EC_USB_HID_KEYBOARD_H
+#define USB_HID_TOUCHPAD_TIMESTAMP_UNIT 100 /* usec */
+
struct usb_hid_touchpad_report {
uint8_t id; /* 0x01 */
struct {
@@ -22,6 +24,7 @@ struct usb_hid_touchpad_report {
} __packed finger[5];
uint8_t count:7;
uint8_t button:1;
+ uint16_t timestamp;
} __packed;
/* class implementation interfaces */