• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..--

boards/29-Dec-2025-3227

src/29-Dec-2025-5639

CMakeLists.txtD29-Dec-2025194 95

README.rstD29-Dec-2025830 3927

prj.confD29-Dec-202565 43

sample.yamlD29-Dec-2025471 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