zephyr/samples/drivers/led_pwm
Manuel Argüelles 5d2670ac1f drivers: pwm: mcux_ftm: allow to select clock source
FTM internal counter can be clocked by one of three clock sources
independent of the module bus clock. This patch introduces a DT property
to perform the clock selection from DT.

DT sources are updated to keep the current clock selection for all boards,
with exception of ucans32k1sic board which is migrated to use system
clock by default, as this seems to be a better choice for most cases.
Some PWM LED samples require slower clock so overlays are added for
those cases.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2024-04-19 10:08:53 +02:00
..
boards drivers: pwm: mcux_ftm: allow to select clock source 2024-04-19 10:08:53 +02:00
src
CMakeLists.txt
README.rst doc: driver: samples: Update driver samples to use new Sphinx extension 2023-09-22 09:21:43 +02:00
prj.conf
sample.yaml

README.rst

.. zephyr:code-sample:: led-pwm
   :name: LED PWM
   :relevant-api: led_interface

   Control PWM LEDs using the LED API.

Overview
********

This sample allows to test the led-pwm driver. The first "pwm-leds" compatible
device instance found in DT is used. For each LEDs attached to this device
(child nodes) the same test pattern (described below) is executed. The LED API
functions are used to control the LEDs.

Test pattern
============

For each PWM LEDs (one after the other):

- Turning on
- Turning off
- Increasing brightness gradually
- Blinking on: 0.1 sec, off: 0.1 sec
- Blinking on: 1 sec, off: 1 sec
- Turning off

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

This sample can be built and executed on all the boards with PWM LEDs connected.
The LEDs must be correctly described in the DTS: the compatible property of the
device node must match "pwm-leds". And for each LED, a child node must be
defined and the PWM configuration must be provided through a "pwms" phandle's
node.