README.rst
1.. zephyr:code-sample:: sensor_clock
2 :name: Sensor Clock
3 :relevant-api: sensor_interface
4
5 Test and debug Sensor Clock functionality.
6
7Overview
8********
9
10This sample application demonstrates how to select the sensor clock source
11and utilize the Sensor Clock API.
12
13Building and Running
14********************
15
16The sample below uses the :ref:`nrf52840dk_nrf52840` and :ref:`nrf52833dk_nrf52833` boards.
17
18To run this sample, ensure the following configurations:
19
20 * Enable one of the Kconfig options:
21 :kconfig:option:`CONFIG_SENSOR_CLOCK_COUNTER`,
22 :kconfig:option:`CONFIG_SENSOR_CLOCK_RTC`, or
23 :kconfig:option:`CONFIG_SENSOR_CLOCK_SYSTEM`.
24
25Build and run the sample with the following command:
26
27.. zephyr-app-commands::
28 :zephyr-app: samples/sensor/clock
29 :board: <board to use>
30 :goals: build flash
31
32Sample Output
33=============
34
35The application will print the current sensor clock cycles and
36their corresponding time in nanoseconds.
37
38.. code-block:: console
39
40 Cycles: 143783087
41 Nanoseconds: 8986442937
42 Cycles: 159776386
43 Nanoseconds: 9986024125
44 Cycles: 175772543
45 Nanoseconds: 10985783937
46 Cycles: 191771203
47 Nanoseconds: 11985700187
48 Cycles: 207758870
49 Nanoseconds: 12984929375
50 Cycles: 223752074
51 Nanoseconds: 13984504625
52
53 ...
54