diff --git a/boards/shields/adafruit_ds2484/Kconfig.shield b/boards/shields/adafruit_ds2484/Kconfig.shield new file mode 100644 index 0000000000000..19d1473cf6bc4 --- /dev/null +++ b/boards/shields/adafruit_ds2484/Kconfig.shield @@ -0,0 +1,5 @@ +# Copyright (c) 2025 Jonas Berg +# SPDX-License-Identifier: Apache-2.0 + +config SHIELD_ADAFRUIT_DS2484 + def_bool $(shields_list_contains,adafruit_ds2484) diff --git a/boards/shields/adafruit_ds2484/adafruit_ds2484.overlay b/boards/shields/adafruit_ds2484/adafruit_ds2484.overlay new file mode 100644 index 0000000000000..540ca332c741d --- /dev/null +++ b/boards/shields/adafruit_ds2484/adafruit_ds2484.overlay @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2025 Jonas Berg + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&zephyr_i2c { + status = "okay"; + + w1_adafruit_ds2482: w1@18 { + compatible = "maxim,ds2484"; + status = "okay"; + reg = <0x18>; + }; +}; + +/* Alternate node label for samples/drivers/w1/scanner */ +w1: &w1_adafruit_ds2482 {}; diff --git a/boards/shields/adafruit_ds2484/doc/adafruit_ds2484.webp b/boards/shields/adafruit_ds2484/doc/adafruit_ds2484.webp new file mode 100644 index 0000000000000..377dc95d1015f Binary files /dev/null and b/boards/shields/adafruit_ds2484/doc/adafruit_ds2484.webp differ diff --git a/boards/shields/adafruit_ds2484/doc/index.rst b/boards/shields/adafruit_ds2484/doc/index.rst new file mode 100644 index 0000000000000..a4c6499548ed4 --- /dev/null +++ b/boards/shields/adafruit_ds2484/doc/index.rst @@ -0,0 +1,65 @@ +.. _adafruit_ds2484: + +Adafruit DS2484 Shield +###################### + +Overview +******** + +The `Adafruit DS2484 I2C to 1-Wire Bus Adapter Shield`_ features +an `Analog Devices DS2484 1-Wire Master`_ and two STEMMA QT connectors. + +.. figure:: adafruit_ds2484.webp + :align: center + :alt: Adafruit DS2484 Shield + + Adafruit DS2484 Shield (Credit: Adafruit) + + +Requirements +************ + +This shield can be used with boards which provide an I2C connector, for +example STEMMA QT or Qwiic connectors. +The target board must define a ``zephyr_i2c`` node label. +See :ref:`shields` for more details. + + +Pin Assignments +=============== + ++--------------+------------------------------+ +| Shield Pin | Function | ++==============+==============================+ +| SDA | DS2484 I2C SDA | ++--------------+------------------------------+ +| SCL | DS2484 I2C SCL | ++--------------+------------------------------+ +| 1WIRE | Connection to 1-Wire devices | ++--------------+------------------------------+ +| SLPZ | Digital input for sleep mode | ++--------------+------------------------------+ + +See :dtcompatible:`maxim,ds2484` for documentation on how to adjust the +devicetree file for sleep mode etc. + + +Programming +*********** + +Set ``--shield adafruit_ds2484`` when you invoke ``west build``. For example +when running the :zephyr:code-sample:`w1-scanner` 1-Wire scanning sample: + +.. zephyr-app-commands:: + :zephyr-app: samples/drivers/w1/scanner + :board: adafruit_qt_py_rp2040 + :shield: adafruit_ds2484 + :goals: build + +Connect one or several 1-Wire devices to the shield before running the scanning sample. + +.. _Adafruit DS2484 I2C to 1-Wire Bus Adapter Shield: + https://learn.adafruit.com/adafruit-ds2484-i2c-to-1-wire-bus-adapter-breakout + +.. _Analog Devices DS2484 1-Wire Master: + https://www.analog.com/en/products/ds2484.html diff --git a/boards/shields/adafruit_ds2484/shield.yml b/boards/shields/adafruit_ds2484/shield.yml new file mode 100644 index 0000000000000..757552acf3120 --- /dev/null +++ b/boards/shields/adafruit_ds2484/shield.yml @@ -0,0 +1,10 @@ +# SPDX-License-Identifier: Apache-2.0 +# +# Copyright (c) 2025, Jonas Berg + +shield: + name: adafruit_ds2484 + full_name: Adafruit DS2484 I2C to 1-Wire Bus Adapter Shield + vendor: adafruit + supported_features: + - w1 diff --git a/samples/drivers/w1/scanner/sample.yaml b/samples/drivers/w1/scanner/sample.yaml index 776eb3babb568..9a4690b7a0b46 100644 --- a/samples/drivers/w1/scanner/sample.yaml +++ b/samples/drivers/w1/scanner/sample.yaml @@ -67,3 +67,15 @@ tests: regex: - "Number of devices found on bus: .*" fixture: w1_scanner_w1_max + sample.drivers.w1.scanner.shields: + platform_allow: + - adafruit_qt_py_rp2040/rp2040 + integration_platforms: + - adafruit_qt_py_rp2040/rp2040 + extra_args: + - platform:adafruit_qt_py_rp2040/rp2040:SHIELD="adafruit_ds2484" + harness_config: + type: one_line + regex: + - "Number of devices found on bus: .*" + fixture: zepyhr_i2c_ds2484