zephyr/samples/sensor/adxl362
Tomasz Bursztyka e18fcbba5a device: Const-ify all device driver instance pointers
Now that device_api attribute is unmodified at runtime, as well as all
the other attributes, it is possible to switch all device driver
instance to be constant.

A coccinelle rule is used for this:

@r_const_dev_1
  disable optional_qualifier
@
@@
-struct device *
+const struct device *

@r_const_dev_2
 disable optional_qualifier
@
@@
-struct device * const
+const struct device *

Fixes #27399

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2020-09-02 13:48:13 +02:00
..
boards spi-device: set CS gpio flags for all devices that had none 2020-07-09 06:07:07 -05:00
src device: Const-ify all device driver instance pointers 2020-09-02 13:48:13 +02:00
CMakeLists.txt
README.rst
prj.conf
sample.yaml sanitycheck: inclusive language 2020-08-27 07:04:07 -04:00

README.rst

.. _adxl362:

ADXL362: Three Axis Accelerometer
#################################

Overview
********

This sample application demonstrates how to use the ADXL362 with data ready and
threshold triggers. The upper and lower threshold triggers are configured in
link mode with referenced detection. See the `ADXL362 Datasheet`_ for additional
details.

Building and Running
********************

This sample requires an ADXL362 sensor. It should work with any platform
featuring a I2C peripheral interface. It does not work on QEMU.

.. zephyr-app-commands::
   :zephyr-app: samples/sensor/adxl362
   :board: <board to use>
   :goals: build flash
   :compact:

Sample Output
=============

The application will print acceleration values to the console at the default
sampling rate of 12.5 Hz. Shake the board continuously to trigger an upper
threshold event. Stop shaking the board to trigger a lower threshold event. In
both cases, ``Threshold trigger`` will be printed to the console.

.. code-block:: console

    x: -0.1, y: -0.0, z: 16.0 (m/s^2)
    x: -1.0, y: 7.0, z: 21.0 (m/s^2)
    Threshold trigger
    x: -3.1, y: 4.0, z: 0.0 (m/s^2)
    x: 1.1, y: 4.0, z: 15.1 (m/s^2)

References
**********

ADXL362 Datasheet and Product Info:
  https://www.analog.com/en/products/adxl362.html

.. _ADXL362 Datasheet:
   https://www.analog.com/media/en/technical-documentation/data-sheets/ADXL362.pdf