summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorNick Vaccaro <nvaccaro@google.com>2019-04-10 17:28:16 -0700
committerchrome-bot <chrome-bot@chromium.org>2019-05-07 17:22:34 -0700
commitc9840a44d64f8037e83acec7d970c3627bea4f8c (patch)
tree38874c55fcf325c2f7342116c90d6f4b88b84468 /include
parent7e910fa108c6e34b2f27f1980d1cd229a743454b (diff)
downloadchrome-ec-c9840a44d64f8037e83acec7d970c3627bea4f8c.tar.gz
driver: add tcs3400 RGB channel sensor driver
Implements a MOTIONSENSE_TYPE_LIGHT_RGB sensor using the tcs3400. BUG=b:129419982 BRANCH=master CQ-DEPEND=CL:1541955 TEST=cherry-pick CLs to enable tcs3400 for flapjack and to add alslog, build and flash to flapjack; boot flapjack, from ec console, execute 'sysjump rw', then execute "alslog" to enable logging of als data. Verify als data is generated and logged to ec console. Change-Id: Ia8000d27ff4f9683ceb4c9522bc7f0fed20c2045 Signed-off-by: Nick Vaccaro <nvaccaro@google.com> Reviewed-on: https://chromium-review.googlesource.com/1551748 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
Diffstat (limited to 'include')
-rw-r--r--include/accelgyro.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/accelgyro.h b/include/accelgyro.h
index 0d00116ed6..a8724a43ee 100644
--- a/include/accelgyro.h
+++ b/include/accelgyro.h
@@ -165,6 +165,18 @@ struct als_calibration_t {
int16_t offset;
};
+/* RGB ALS Calibration Data */
+struct rgb_calibration_t {
+ /*
+ * Each channel has a scaling factor for normalization, representing
+ * a value between 0 and 2 (1 is translated as 1 << 15)
+ */
+ uint16_t scale;
+
+ /* Any offset to add to raw channel data */
+ int16_t offset;
+};
+
#define SENSOR_APPLY_SCALE(_input, _scale) \
(((_input) * (_scale)) / MOTION_SENSE_DEFAULT_SCALE)