summaryrefslogtreecommitdiff
path: root/driver/accel_kxcj9.h
diff options
context:
space:
mode:
authorAlec Berg <alecaberg@chromium.org>2014-03-10 12:05:47 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-03-26 19:31:25 +0000
commiteb1406644716d6c3c87fdeea4551eb6ea37be649 (patch)
tree8f5209485fd585aa08f384bca2dd2f9c5d3982ae /driver/accel_kxcj9.h
parent9b420804d88a7adf8a1ded8bd12e52e1aa8ddd84 (diff)
downloadchrome-ec-eb1406644716d6c3c87fdeea4551eb6ea37be649.tar.gz
accel: clapper: glimmer: Add support for accelerometer interrupt.stabilize-5696.B
Adding in support for accelerometer interrupt for use currently in clapper and glimmer. This is disabled by default and can be enabled with CONFIG_ACCEL_INTERRUPTS. BUG=none BRANCH=rambi TEST=Manual test on a glimmer using accelint console command. On console enter: accelint 0 32 When you tap the lid, it should fire the interrupt and print msg to console. accelint 1 32 Tap the base and it will fire another interrupt. Change-Id: Iaab324945e34d527140399ec4f06efd812a62840 Original-Change-Id: I0329112fdcae3c8adc0ca07e74fef7a591d4b9a1 Signed-off-by: Alec Berg <alecaberg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/190099 Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/191549
Diffstat (limited to 'driver/accel_kxcj9.h')
-rw-r--r--driver/accel_kxcj9.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/driver/accel_kxcj9.h b/driver/accel_kxcj9.h
index 9451421be5..e35386d330 100644
--- a/driver/accel_kxcj9.h
+++ b/driver/accel_kxcj9.h
@@ -129,4 +129,16 @@ int accel_write_resolution(const enum accel_id id, const int res);
*/
int accel_write_datarate(const enum accel_id id, const int rate);
+#ifdef CONFIG_ACCEL_INTERRUPTS
+/**
+ * Setup a one-time accel interrupt. If the threshold is low enough, the
+ * interrupt may trigger due simply to noise and not any real motion. If the
+ * threshold is 0, the interrupt will fire immediately.
+ *
+ * @param id Target accelerometer
+ * @param threshold Threshold for interrupt in units of counts.
+ */
+int accel_set_interrupt(const enum accel_id id, unsigned int threshold);
+#endif
+
#endif /* __CROS_EC_ACCEL_KXCJ9_H */