eve: Enable double tap gesture

The LED spec requires a double tap gesture. This CL adds the
appropriate CONFIG options to enable double tap gesture for Eve and
enables the interrupt for the bmi160. The board specific function in
this CL is just a placeholder.

BUG=b:35584895
BRANCH=none
TEST=Manual Verifed double tap is detected by seeing the console print
that's generated each time a double tap event occurs.

Change-Id: If3506cf1fbcfc2b380ac36c9d3039e0a8823eba1
Signed-off-by: Scott Collyer <scollyer@google.com>
Reviewed-on: https://chromium-review.googlesource.com/516547
Commit-Ready: Scott Collyer <scollyer@chromium.org>
Tested-by: Scott Collyer <scollyer@chromium.org>
Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-by: Duncan Laurie <dlaurie@google.com>
This commit is contained in:
Scott Collyer
2017-05-23 16:35:44 -07:00
committed by chrome-bot
parent 2992ee1771
commit 440146ca11
2 changed files with 23 additions and 5 deletions

View File

@@ -25,6 +25,7 @@
#include "driver/tcpm/tcpm.h"
#include "driver/temp_sensor/bd99992gw.h"
#include "extpower.h"
#include "gesture.h"
#include "gpio.h"
#include "hooks.h"
#include "host_command.h"
@@ -728,6 +729,12 @@ int board_get_version(void)
return ver;
}
void sensor_board_proc_double_tap(void)
{
/* TODO: Call led update function */
CPRINTS("Call LED status update");
}
/* Base Sensor mutex */
static struct mutex g_base_mutex;
@@ -792,7 +799,7 @@ struct motion_sensor_t motion_sensors[] = {
[BASE_ACCEL] = {
.name = "Base Accel",
.active_mask = SENSOR_ACTIVE_S0_S3,
.active_mask = SENSOR_ACTIVE_S0_S3_S5,
.chip = MOTIONSENSE_CHIP_BMI160,
.type = MOTIONSENSE_TYPE_ACCEL,
.location = MOTIONSENSE_LOC_BASE,
@@ -813,18 +820,18 @@ struct motion_sensor_t motion_sensors[] = {
},
/* EC use accel for angle detection */
[SENSOR_CONFIG_EC_S0] = {
.odr = 10000 | ROUND_UP_FLAG,
.odr = TAP_ODR,
.ec_rate = 100 * MSEC,
},
/* Sensor on for lid angle detection */
[SENSOR_CONFIG_EC_S3] = {
.odr = 10000 | ROUND_UP_FLAG,
.odr = TAP_ODR,
.ec_rate = 100 * MSEC,
},
/* Sensor off in S5 */
[SENSOR_CONFIG_EC_S5] = {
.odr = 0,
.ec_rate = 0
.odr = TAP_ODR,
.ec_rate = 100 * MSEC,
},
},
},

View File

@@ -140,6 +140,17 @@
/* Depends on how fast the AP boots and typical ODRs */
#define CONFIG_ACCEL_FIFO_THRES (CONFIG_ACCEL_FIFO / 3)
/* Enable double tap detection */
#define CONFIG_GESTURE_DETECTION
#define CONFIG_GESTURE_HOST_DETECTION
#define CONFIG_GESTURE_SENSOR_BATTERY_TAP 1
#define CONFIG_GESTURE_SAMPLING_INTERVAL_MS 5
#define CONFIG_GESTURE_TAP_THRES_MG 100
#define CONFIG_GESTURE_TAP_MAX_INTERSTICE_T 500
#define CONFIG_GESTURE_DETECTION_MASK \
(1 << CONFIG_GESTURE_SENSOR_BATTERY_TAP)
#define CONFIG_GESTURE_TAP_EVENT TASK_EVENT_CUSTOM(1024)
/* USB */
#define CONFIG_USB_CHARGER
#define CONFIG_USB_PD_ALT_MODE