79e6b0e0f6
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> |
||
---|---|---|
.. | ||
boards | ||
src | ||
CMakeLists.txt | ||
prj.conf | ||
README.rst | ||
sample.yaml |
.. _adt7420: ADT7420: High accuracy digital I2C temperature sensor ##################################################### Description *********** This sample application periodically (1Hz) measures the ambient temperature in degrees Celsius. The result is written to the console. When configured in trigger mode the update interval is 5 s, and the sample maintains a |plusminus| 1 |deg| C window around a recent temperature. As soon as the temperature goes outside the window an interrupt causes the application to display an event and update the upper and lower window boundaries. References ********** - ADT7420: http://www.analog.com/adt7420 Wiring ******* This sample uses the ADT7420 sensor controlled using the I2C interface. Connect Supply: **VDD**, **GND** and Interface: **SDA**, **SCL** and optionally connect the **INT** to a interrupt capable GPIO. The supply voltage can be in the 2.7V to 5.5V range. Depending on the baseboard used, the **SDA** and **SCL** lines require Pull-Up resistors. Building and Running ******************** This project outputs sensor data to the console. It requires an ADT7420 sensor. It should work with any platform featuring a I2C peripheral interface. It does not work on QEMU. In this example below the :ref:`nrf52dk_nrf52832` board is used. .. zephyr-app-commands:: :zephyr-app: samples/sensor/adt7420 :board: nrf52dk_nrf52832 :goals: build flash Sample Output ============= .. code-block:: console *** Booting Zephyr OS build zephyr-v2.1.0-538-g12b2ed2cf7c3 *** device is 0x2000101c, name is ADT7420 [0:00:00.011]: temperature 21.203125 Cel [0:00:01.015]: temperature 21.171875 Cel [0:00:02.019]: temperature 21.171875 Cel [0:00:03.023]: temperature 21.187500 Cel [0:00:04.027]: temperature 21.140625 Cel <repeats endlessly>