boards: shields: Add Adafruit HTS221 humidity sensor shield

Tested with the command mentioned in index.rst

Compile testing of the overlay file is done via
the dht_polling sample.

Product photo from https://learn.adafruit.com/assets/89387

Signed-off-by: Jonas Berg <jonas.s.t.berg@gmail.com>
This commit is contained in:
Jonas Berg
2026-01-18 13:25:04 +01:00
committed by Henrik Brix Andersen
parent be501ebb06
commit 7c66a65c73
6 changed files with 101 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
# Copyright (c) 2026 Jonas Berg
# SPDX-License-Identifier: Apache-2.0
config SHIELD_ADAFRUIT_HTS221
def_bool $(shields_list_contains,adafruit_hts221)

View File

@@ -0,0 +1,21 @@
/*
* Copyright (c) 2026 Jonas Berg
*
* SPDX-License-Identifier: Apache-2.0
*/
/ {
aliases {
dht0 = &adafruit_hts221;
};
};
&zephyr_i2c {
status = "okay";
adafruit_hts221: hts221@5f {
status = "okay";
compatible = "st,hts221";
reg = <0x5f>;
};
};

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

View File

@@ -0,0 +1,63 @@
.. _adafruit_hts221:
Adafruit HTS221 Shield
######################
Overview
********
The `Adafruit HTS221 Temperature and Humidity Sensor Shield`_ features
a `ST Microelectronics HTS221 Humidity and Temperature Sensor`_ and two STEMMA QT connectors.
It measures temperature and humidity.
.. figure:: adafruit_hts221.webp
:align: center
:alt: Adafruit HTS221 Shield
Adafruit HTS221 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 | I2C SDA |
+--------------+------------------------------------+
| SCL | I2C SCL |
+--------------+------------------------------------+
| DRDY | Data ready output |
+--------------+------------------------------------+
| CS | Keep at high level to use I2C mode |
+--------------+------------------------------------+
See :dtcompatible:`st,hts221` for details on possible devicetree settings, for example if you
are using the DRDY pin.
Programming
***********
Set ``--shield adafruit_hts221`` when you invoke ``west build``. For example
when running the :zephyr:code-sample:`dht_polling` sample:
.. zephyr-app-commands::
:zephyr-app: samples/sensor/dht_polling
:board: adafruit_feather_scorpio_rp2040
:shield: adafruit_hts221
:goals: build flash
.. _Adafruit HTS221 Temperature and Humidity Sensor Shield:
https://learn.adafruit.com/adafruit-hts221-temperature-humidity-sensor
.. _ST Microelectronics HTS221 Humidity and Temperature Sensor:
https://www.st.com/resource/en/datasheet/hts221.pdf

View File

@@ -0,0 +1,10 @@
# SPDX-License-Identifier: Apache-2.0
#
# Copyright (c) 2026, Jonas Berg
shield:
name: adafruit_hts221
full_name: Adafruit HTS221 Temperature and Humidity Sensor Shield
vendor: adafruit
supported_features:
- sensor

View File

@@ -17,11 +17,13 @@ tests:
- adafruit_qt_py_rp2040/rp2040
- adafruit_feather_rp2040/rp2040
- adafruit_feather_canbus_rp2040/rp2040
- adafruit_feather_scorpio_rp2040/rp2040
- nucleo_f401re
extra_args:
- platform:adafruit_qt_py_rp2040/rp2040:SHIELD="adafruit_aht20"
- platform:adafruit_feather_rp2040/rp2040:SHIELD="adafruit_sht4x"
- platform:adafruit_feather_canbus_rp2040/rp2040:SHIELD="sparkfun_shtc3"
- platform:adafruit_feather_scorpio_rp2040/rp2040:SHIELD="adafruit_hts221"
harness: console
harness_config:
fixture: fixture_i2c_hs300x