zephyr/samples/drivers/counter/alarm
Sadik Ozer 44e72ab024 samples: drivers: counter: Add MAX32 MCUs overlay files
This commit add MAX32 MCUs overlay file for sample/drivers/counter

Signed-off-by: Sadik Ozer <sadik.ozer@analog.com>
2024-09-11 20:18:33 -04:00
..
boards samples: drivers: counter: Add MAX32 MCUs overlay files 2024-09-11 20:18:33 -04:00
socs samples: esp32c3: Move config files from boards to socs 2024-08-13 18:21:10 -04:00
src samples: drivers: counter: Enable it for MAX32 MCUs 2024-09-11 20:18:33 -04:00
CMakeLists.txt tf-m: Change NS include path for TF-M 2.0.0 2024-01-17 16:52:52 +01:00
Kconfig
prj.conf
README.rst
sample.yaml samples: drivers: counter: alarm: enable on s32z2xxdc2 2024-08-05 07:35:57 -05:00

.. zephyr:code-sample:: alarm
   :name: Counter Alarm
   :relevant-api: counter_interface

   Implement an alarm application using the counter API.

Overview
********
This sample provides an example of alarm application using :ref:`counter API <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>