Skip to content

Commit 12a8eaf

Browse files
pyhyskartben
authored andcommitted
boards: shields: Add Adafruit APDS9960 proximity sensor shield
Product photo from https://learn.adafruit.com/assets/89850 Tested with the command mentioned on the index.rst page. Signed-off-by: Jonas Berg <[email protected]>
1 parent 7428a84 commit 12a8eaf

File tree

6 files changed

+97
-1
lines changed

6 files changed

+97
-1
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Copyright (c) 2025 Jonas Berg
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config SHIELD_ADAFRUIT_APDS9960
5+
def_bool $(shields_list_contains,adafruit_apds9960)
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/*
2+
* Copyright (c) 2025 Jonas Berg
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
&zephyr_i2c {
8+
status = "okay";
9+
10+
adafruit_apds9960: apds9960@39 {
11+
compatible = "avago,apds9960";
12+
status = "okay";
13+
reg = <0x39>;
14+
};
15+
};
35.1 KB
Loading
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
.. _adafruit_apds9960:
2+
3+
Adafruit APDS9960 Shield
4+
########################
5+
6+
Overview
7+
********
8+
9+
The `Adafruit APDS9960 Proximity, Light, RGB, and Gesture Sensor Shield`_ features
10+
a `Broadcom APDS9960 sensor`_ and two STEMMA QT connectors.
11+
12+
.. figure:: adafruit_apds9960.webp
13+
:align: center
14+
:alt: Adafruit APDS9960 Shield
15+
16+
Adafruit APDS9960 Shield (Credit: Adafruit)
17+
18+
19+
Requirements
20+
************
21+
22+
This shield can be used with boards which provide an I2C connector, for
23+
example STEMMA QT or Qwiic connectors.
24+
The target board must define a ``zephyr_i2c`` node label.
25+
See :ref:`shields` for more details.
26+
27+
28+
Pin Assignments
29+
===============
30+
31+
+--------------+------------------------+
32+
| Shield Pin | Function |
33+
+==============+========================+
34+
| SDA | APDS9960 I2C SDA |
35+
+--------------+------------------------+
36+
| SCL | APDS9960 I2C SCL |
37+
+--------------+------------------------+
38+
| INT | APDS9960 interrupt out |
39+
+--------------+------------------------+
40+
41+
In order to use interrupts you need to connect a separate wire from the
42+
shield to a GPIO pin on your microcontroller board. See
43+
:dtcompatible:`avago,apds9960` for documentation on how to adjust the
44+
devicetree file.
45+
46+
Programming
47+
***********
48+
49+
Set ``--shield adafruit_apds9960`` when you invoke ``west build``. For example
50+
when running the :zephyr:code-sample:`apds9960` proximity and light sample:
51+
52+
.. zephyr-app-commands::
53+
:zephyr-app: samples/sensor/apds9960
54+
:board: adafruit_qt_py_rp2040
55+
:shield: adafruit_apds9960
56+
:goals: build
57+
58+
.. _Adafruit APDS9960 Proximity, Light, RGB, and Gesture Sensor Shield:
59+
https://learn.adafruit.com/adafruit-apds9960-breakout
60+
61+
.. _Broadcom APDS9960 sensor:
62+
https://www.broadcom.com/products/optical-sensors/integrated-ambient-light-and-proximity-sensors/apds-9960
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
#
3+
# Copyright (c) 2025, Jonas Berg
4+
5+
shield:
6+
name: adafruit_apds9960
7+
full_name: Adafruit APDS9960 Proximity, Light, RGB and Gesture Sensor Shield
8+
vendor: adafruit
9+
supported_features:
10+
- sensor

samples/sensor/apds9960/sample.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,14 @@ sample:
33
tests:
44
sample.sensor.apds9960:
55
harness: console
6-
platform_allow: reel_board
6+
platform_allow:
7+
- adafruit_qt_py_rp2040/rp2040
8+
- reel_board
79
integration_platforms:
810
- reel_board
911
tags: sensors
12+
extra_args:
13+
- platform:adafruit_qt_py_rp2040/rp2040:SHIELD="adafruit_apds9960"
1014
depends_on:
1115
- i2c
1216
- gpio

0 commit comments

Comments
 (0)