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> |
||
|---|---|---|
| .. | ||
| src | ||
| CMakeLists.txt | ||
| prj.conf | ||
| README.rst | ||
| sample.yaml | ||
.. _lsm6dso:
LSM6DSO: IMU Sensor Monitor
###########################
Overview
********
This sample sets the date rate of LSM6DSO accelerometer and gyroscope to
12.5Hz and enables a trigger on data ready. It displays on the console
the values for accelerometer and gyroscope.
Requirements
************
This sample uses the LSM6DSO sensor controlled using the I2C interface.
It has been tested on the :ref:`stm32l562e_dk_board`.
References
**********
- LSM6DSO http://www.st.com/en/mems-and-sensors/lsm6dso.html
Building and Running
********************
This project outputs sensor data to the console. It requires an LSM6DSO
sensor, which is present on the :ref:`stm32l562e_dk_board`.
Building on stm32l562e_dk board
===============================
.. zephyr-app-commands::
:zephyr-app: samples/sensor/lsm6dso
:host-os: unix
:board: stm32l562e_dk
:goals: build
:compact:
Sample Output
=============
.. code-block:: console
Testing LSM6DSO sensor in trigger mode.
accel x:-0.650847 ms/2 y:-5.300102 ms/2 z:-8.163114 ms/2
gyro x:-0.167835 dps y:-0.063377 dps z:0.002367 dps
trig_cnt:1
accel x:0.341575 ms/2 y:5.209773 ms/2 z:-7.938787 ms/2
gyro x:-0.034284 dps y:-0.004428 dps z:-0.003512 dps
trig_cnt:2
<repeats endlessly>