diff options
author | Boris Mittelberg <bmbm@google.com> | 2021-04-06 18:00:27 +0000 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-04-08 18:30:24 +0000 |
commit | 3304abadecb256cc584fd2952d2925b8acc93f64 (patch) | |
tree | e1195781c1cbce5d8c94f79faa68693e0e5cf083 /board/brya/board.h | |
parent | ed9b4784c53ca03de59d410341d477b43a78537a (diff) | |
download | chrome-ec-3304abadecb256cc584fd2952d2925b8acc93f64.tar.gz |
brya: add ALS and ALS RGB sensors
Add ambient light sensor (with RGB) to motionsense task
BRANCH=none
BUG=b:179648721
TEST=manual tests. ALS test from AP console:
$ ectool motionsense calibrate 3
$ ectool motionsense
See the reading for sensor #3 (clear light) and #4 (RGB)
Sensor 3: 18366 0 0
Sensor 4: 9673 5656 3832
The values above change with light intensity and color. I've used Lifx
RGB light bulb to verify each channel works.
Signed-off-by: Boris Mittelberg <bmbm@google.com>
Change-Id: I5f0c1529ae1e05f4df0b0ec6fa01808f64092466
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2808136
Reviewed-by: caveh jalali <caveh@chromium.org>
Reviewed-by: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'board/brya/board.h')
-rw-r--r-- | board/brya/board.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/board/brya/board.h b/board/brya/board.h index 7bbd19a6f5..149fe8c684 100644 --- a/board/brya/board.h +++ b/board/brya/board.h @@ -38,6 +38,13 @@ #define CONFIG_ACCEL_LSM6DSO_INT_EVENT \ TASK_EVENT_MOTION_SENSOR_INTERRUPT(BASE_ACCEL) +/* TCS3400 ALS */ +#define CONFIG_ALS +#define ALS_COUNT 1 +#define CONFIG_ALS_TCS3400 +#define CONFIG_ALS_TCS3400_INT_EVENT \ + TASK_EVENT_MOTION_SENSOR_INTERRUPT(CLEAR_ALS) + /* Enable sensor fifo, must also define the _SIZE and _THRES */ #define CONFIG_ACCEL_FIFO /* FIFO size is in power of 2. */ @@ -47,7 +54,7 @@ /* Sensors without hardware FIFO are in forced mode */ #define CONFIG_ACCEL_FORCE_MODE_MASK \ - (BIT(LID_ACCEL)) + (BIT(LID_ACCEL) | BIT(CLEAR_ALS)) /* Lid accel */ #define CONFIG_ACCEL_LIS2DWL @@ -206,6 +213,8 @@ enum sensor_id { LID_ACCEL = 0, BASE_ACCEL, BASE_GYRO, + CLEAR_ALS, + RGB_ALS, SENSOR_COUNT }; |