zephyr/samples/sensor/ti_hdc
Gerard Marull-Paretas 79e6b0e0f6 includes: prefer <zephyr/kernel.h> over <zephyr/zephyr.h>
As of today <zephyr/zephyr.h> is 100% equivalent to <zephyr/kernel.h>.
This patch proposes to then include <zephyr/kernel.h> instead of
<zephyr/zephyr.h> since it is more clear that you are including the
Kernel APIs and (probably) nothing else. <zephyr/zephyr.h> sounds like a
catch-all header that may be confusing. Most applications need to
include a bunch of other things to compile, e.g. driver headers or
subsystem headers like BT, logging, etc.

The idea of a catch-all header in Zephyr is probably not feasible
anyway. Reason is that Zephyr is not a library, like it could be for
example `libpython`. Zephyr provides many utilities nowadays: a kernel,
drivers, subsystems, etc and things will likely grow. A catch-all header
would be massive, difficult to keep up-to-date. It is also likely that
an application will only build a small subset. Note that subsystem-level
headers may use a catch-all approach to make things easier, though.

NOTE: This patch is **NOT** removing the header, just removing its usage
in-tree. I'd advocate for its deprecation (add a #warning on it), but I
understand many people will have concerns.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-09-05 16:31:47 +02:00
..
boards samples: sensors: Remove label property from devicetree overlays 2022-07-19 08:23:35 -05:00
src includes: prefer <zephyr/kernel.h> over <zephyr/zephyr.h> 2022-09-05 16:31:47 +02:00
CMakeLists.txt cmake: increase minimal required version to 3.20.0 2021-08-20 09:47:34 +02:00
README.rst cleanup: rename sanitycheck references to twister 2021-01-14 07:50:52 -06:00
prj.conf sensors: Remove unnecessary Kconfig setting of sensors 2022-07-25 15:18:56 +02:00
sample.yaml samples: sensor: add integration_platforms 2021-04-09 06:50:47 -04:00

README.rst

.. _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/