Files
OpenCellular/include/usb_hid_touchpad.h
Nicolas Boichat 043c550262 chip/stm32/usb_hid_touchpad: Widen pressure field to 10 bits
id only really needs 4 bits (16 touch events should be more than
enough), so we can steal 2 bits from that field.

We also reorder the fields to make sure that width/x are aligned
on 8-bit boundary.

BRANCH=none
BUG=b:63936194
TEST=Flash hammer, touchpad works, ABS_PRESSURE > 255 is reported
     when a palm is pressed on the touchpad.

Change-Id: I1abf1bf53cc9dd998082cea5dc7cd3be17f99ec6
Reviewed-on: https://chromium-review.googlesource.com/583297
Commit-Ready: Nicolas Boichat <drinkcat@chromium.org>
Tested-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-by: Chun-ta Lin <itspeter@chromium.org>
Reviewed-by: KT Liao <kt.liao@emc.com.tw>
2017-07-31 07:38:06 -07:00

31 lines
723 B
C

/* Copyright 2016 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*
* USB HID definitions.
*/
#ifndef __CROS_EC_USB_HID_KEYBOARD_H
#define __CROS_EC_USB_HID_KEYBOARD_H
struct __attribute__((__packed__)) usb_hid_touchpad_report {
uint8_t id; /* 0x01 */
struct __attribute__((__packed__)) {
unsigned tip:1;
unsigned inrange:1;
unsigned id:4;
unsigned pressure:10;
unsigned width:12;
unsigned height:12;
unsigned x:12;
unsigned y:12;
} finger[5];
uint8_t count:7;
uint8_t button:1;
};
/* class implementation interfaces */
void set_touchpad_report(struct usb_hid_touchpad_report *report);
#endif