zephyr/samples/drivers/counter/alarm
Fabio Baltieri 792469aae9 yamllint: indentation: fix files in samples/
Fix the YAML files indentation for files in samples/.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-01-04 14:23:53 +01:00
..
boards samples: counter: alarm: add support for GD32 boards 2022-12-12 10:08:12 +01:00
src samples: drivers: counter: support alarm sample in counter_gecko_stimer 2022-12-20 22:50:19 +01:00
CMakeLists.txt samples: drivers: counter: alarm: Add support to TFM 2022-11-29 13:40:27 +00:00
Kconfig esp32: counter: samples: fix build config 2022-08-08 13:00:38 -05:00
README.rst
prj.conf
sample.yaml yamllint: indentation: fix files in samples/ 2023-01-04 14:23:53 +01:00

README.rst

.. _alarm_sample:

Counter Alarm Sample
#####################

Overview
********
This sample provides an example of alarm application using counter API.
It sets an alarm with an initial delay of 2 seconds. At each alarm
expiry, a new alarm is configured with a delay multiplied by 2.

.. note::
   In case of 1Hz frequency (RTC for example), precision is 1 second.
   Therefore, the sample output may differ in 1 second

Requirements
************

This sample requires the support of a timer IP compatible with alarm setting.

References
**********

- :ref:`disco_l475_iot1_board`

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

 .. zephyr-app-commands::
    :zephyr-app: samples/drivers/counter/alarm
    :host-os: unix
    :board: disco_l475_iot1
    :goals: run
    :compact:

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

 .. code-block:: console

    Counter alarm sample

    Set alarm in 2 sec
    !!! Alarm !!!
    Now: 2
    Set alarm in 4 sec
    !!! Alarm !!!
    Now: 6
    Set alarm in 8 sec
    !!! Alarm !!!
    Now: 14
    Set alarm in 16 sec
    !!! Alarm !!!
    Now: 30

    <repeats endlessly>