• Home
  • Annotate
  • current directory
Name Date Size #Lines LOC

..22-Aug-2025-

boards/22-Aug-2025-

src/22-Aug-2025-

CMakeLists.txt A D22-Aug-2025202 95

README.rst A D22-Aug-2025868 3927

prj.conf A D22-Aug-202568 43

sample.yaml A D22-Aug-2025491 2120

README.rst

1.. zephyr:code-sample:: capture
2   :name: PWM Capture
3   :relevant-api: pwm_interface
4
5   Capture a PWM signal.
6
7Overview
8********
9This sample provides an example application using the :ref:`PWM API <pwm_api>` capture
10API to measure the period and pulse width of an external PWM signal.
11
12Requirements
13************
14
15This sample requires the support of a timer IP compatible with pwm capture block.
16
17Building and Running
18********************
19
20 .. zephyr-app-commands::
21    :zephyr-app: samples/drivers/pwm/capture
22    :host-os: unix
23    :board: lp_mspm0g3507
24    :goals: run
25    :compact:
26
27Sample Output
28=============
29
30 .. code-block:: console
31
32    PWM capture lp_mspm0g3507/mspm0g350
33
34    timclk 80000000 Hz
35    {period:1000  pulse width: 499} in TIMCLK cycle
36    {period: 80000.000000 Hz duty: 49.900002}
37
38    <repeats endlessly>
39