README.rst
1.. zephyr:code-sample:: event
2 :name: PWM Event
3 :relevant-api: pwm_interface
4
5 Events on a PWM signal.
6
7Overview
8********
9This sample provides an example application using the :ref:`PWM API <pwm_api>` event
10API to get events on a PWM signal. The sample demonstrates how events can be used to
11precisely time x periods of a PWM signal. A usecase for this would be the transmitting
12part of an IR remote, where precise pulse timing is needed.
13
14Requirements
15************
16
17This sample requires the support of the :ref:`PWM API <pwm_api>` event API.
18
19Building and Running
20********************
21
22 .. zephyr-app-commands::
23 :zephyr-app: samples/drivers/pwm/event
24 :host-os: unix
25 :board: sam4s_xplained
26 :goals: run
27 :compact:
28
29Sample Output
30=============
31
32When capturing the signal using an oscilloscope or logic analyzer, it should look like
33the following repeating sequence (after a startup transient)
34
35 .. code-block::
36
37 ┌─┐ ┌─┐ ┌─┐ ┌─┐ ┌─┐ ┌─┐ ┌─┐ ┌─┐ ┌─┐ ┌─┐
38 ─┘ └─┘ └─┘ └─┘ └─┘ └───────────────────┘ └─┘ └─┘ └─┘ └─┘ └─────
39