From 7cf124b4a96414dcf72eb564e700e8d3a895f222 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Cab=C3=A9?= Date: Sun, 25 Aug 2024 11:46:29 +0200 Subject: [PATCH] samples: sensors: drop ti_hdc sample as a more generic one exists MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This sample adds no value compared to generic dht polling sample Signed-off-by: Benjamin Cabé --- samples/sensor/ti_hdc/CMakeLists.txt | 9 --- samples/sensor/ti_hdc/README.rst | 81 ------------------- .../ti_hdc/boards/nucleo_l496zg.overlay | 14 ---- samples/sensor/ti_hdc/prj.conf | 4 - samples/sensor/ti_hdc/sample.yaml | 12 --- samples/sensor/ti_hdc/src/main.c | 44 ---------- 6 files changed, 164 deletions(-) delete mode 100644 samples/sensor/ti_hdc/CMakeLists.txt delete mode 100644 samples/sensor/ti_hdc/README.rst delete mode 100644 samples/sensor/ti_hdc/boards/nucleo_l496zg.overlay delete mode 100644 samples/sensor/ti_hdc/prj.conf delete mode 100644 samples/sensor/ti_hdc/sample.yaml delete mode 100644 samples/sensor/ti_hdc/src/main.c diff --git a/samples/sensor/ti_hdc/CMakeLists.txt b/samples/sensor/ti_hdc/CMakeLists.txt deleted file mode 100644 index 147f22fc987a..000000000000 --- a/samples/sensor/ti_hdc/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -# SPDX-License-Identifier: Apache-2.0 - -cmake_minimum_required(VERSION 3.20.0) - -find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) -project(ti_hdc) - -FILE(GLOB app_sources src/*.c) -target_sources(app PRIVATE ${app_sources}) diff --git a/samples/sensor/ti_hdc/README.rst b/samples/sensor/ti_hdc/README.rst deleted file mode 100644 index c60cd00497a2..000000000000 --- a/samples/sensor/ti_hdc/README.rst +++ /dev/null @@ -1,81 +0,0 @@ -.. _ti_hdc_sample: - -TI_HDC Sample -############## - -Description -*********** - -This sample application periodically takes Temperature and Humidity -using the ti_hdc sensor driver. The result is written to the console. - -Requirements -************ - -This sample needs a compatible sensor like HDC1010 or HDC1080 -connected to the target board's I2C connector. - -Example Breakout Boards: - -* Pmod HYGRO: Humidity and Temperature Sensor Breakout board - - -Wiring -****** - -This sample is tested with the STM32L496ZG nucleo and the Pmod HYGRO -Temp/RH breakout board. - -The sensor operates at 3.3V and uses I2C to communicate with the board. - -External Wires: - -* Breakout **GND** pin <--> Nucleo **GND** pin -* Breakout **VCC** pin <--> Nucleo **3V3** pin -* Breakout **SDA** pin <--> Nucleo **CN7-D14** pin -* Breakout **SCL** pin <--> Nucleo **CN7-D15** pin - -Building and Running -******************** - -This sample builds one application for the HDC1080 sensor. -Build/Flash Steps: - -.. zephyr-app-commands:: - :zephyr-app: samples/sensor/ti_hdc/ - :board: nucleo_l496zg - :goals: build flash - :compact: - -Sample Output -************* -.. code-block:: console - - Running on arm! - Dev 0x20001160 name HDC1080 is ready! - Fetching... - Raw Temp = 25144, Temp = 23.305053 C, Raw RH = 32292, RH = 49.273681 % - Fetching... - Raw Temp = 25148, Temp = 23.315124 C, Raw RH = 32424, RH = 49.475097 % - ... - -Build Testing -************** - -.. code-block:: bash - - $ZEPHYR_BASE/scripts/twister -T $ZEPHYR_BASE/samples/sensor/ti_hdc/ -p nucleo_l496zg --device-testing --device-serial /dev/ttyACM0 -t build - -Target Testing -************** - -.. code-block:: bash - - $ZEPHYR_BASE/scripts/twister -T $ZEPHYR_BASE/samples/sensor/ti_hdc/ -p nucleo_l496zg --device-testing --device-serial /dev/ttyACM0 -t target - - -References -********** - -.. _Nucleo STM32L496ZG board: https://www.st.com/en/evaluation-tools/nucleo-l496zg.html -.. _HDC1080 Breakout board: https://store.digilentinc.com/pmod-hygro-digital-humidity-and-temperature-sensor/ diff --git a/samples/sensor/ti_hdc/boards/nucleo_l496zg.overlay b/samples/sensor/ti_hdc/boards/nucleo_l496zg.overlay deleted file mode 100644 index 380c786299c7..000000000000 --- a/samples/sensor/ti_hdc/boards/nucleo_l496zg.overlay +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Copyright (c) 2019 Centaur Analytics, Inc - * - * SPDX-License-Identifier: Apache-2.0 - */ - -&arduino_i2c { - - ti_hdc: ti_hdc@40 { - compatible = "ti,hdc","ti,hdc1080"; - reg = <0x40>; - }; - -}; diff --git a/samples/sensor/ti_hdc/prj.conf b/samples/sensor/ti_hdc/prj.conf deleted file mode 100644 index 44863eaa3a08..000000000000 --- a/samples/sensor/ti_hdc/prj.conf +++ /dev/null @@ -1,4 +0,0 @@ -CONFIG_ASSERT=y # validation -CONFIG_I2C=y -CONFIG_GPIO=y -CONFIG_SENSOR=y diff --git a/samples/sensor/ti_hdc/sample.yaml b/samples/sensor/ti_hdc/sample.yaml deleted file mode 100644 index 4328fa3d0877..000000000000 --- a/samples/sensor/ti_hdc/sample.yaml +++ /dev/null @@ -1,12 +0,0 @@ -sample: - name: TI HDC Humidity/Temperature Sensor -tests: - sample.sensor.ti_hdc: - harness: sensor - platform_allow: - - reel_board - - nucleo_l496zg - integration_platforms: - - reel_board - tags: sensors - depends_on: i2c diff --git a/samples/sensor/ti_hdc/src/main.c b/samples/sensor/ti_hdc/src/main.c deleted file mode 100644 index 2ef90a8c85e3..000000000000 --- a/samples/sensor/ti_hdc/src/main.c +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2019 Centaur Analytics - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include -#include -#include -#include -#include -#include - -int main(void) -{ - printk("Running on %s!\n", CONFIG_ARCH); - const struct device *const dev = DEVICE_DT_GET_ONE(ti_hdc); - - if (!device_is_ready(dev)) { - printk("sensor: device not ready.\n"); - return 0; - } - - printk("Dev %p name %s is ready!\n", dev, dev->name); - - struct sensor_value temp, humidity; - - while (1) { - /* take a sample */ - printk("Fetching...\n"); - sensor_sample_fetch(dev); - sensor_channel_get(dev, SENSOR_CHAN_AMBIENT_TEMP, &temp); - sensor_channel_get(dev, SENSOR_CHAN_HUMIDITY, &humidity); - - /* print the result */ - printk("Temp = %d.%06d C, RH = %d.%06d %%\n", - temp.val1, temp.val2, humidity.val1, humidity.val2); - - /* wait for the next sample */ - k_sleep(K_SECONDS(10)); - } - return 0; -}