:orphan:
.. raw:: html
.. dtcompatible:: nordic,npm10xx-led
.. _dtbinding_nordic_npm10xx_led:
nordic,npm10xx-led
##################
.. sidebar:: Overview
:Name: ``nordic,npm10xx-led``
:Vendor: :ref:`Nordic Semiconductor `
:Used in: :zephyr:board-catalog:`List of boards <#compatibles=nordic,npm10xx-led>` using
this compatible
:Driver: :zephyr_file:`drivers/led/led_npm10xx.c`
Description
***********
.. code-block:: none
Nordic nPM10 Series PMIC's LED driver
Nordic's nPM10 Series PMICs feature an LED driver whose outputs are multiplexed with GPIOs.
GPIO number to use for each LED child node is specified by its "index" property, therefore it is
required. Using GPIO interface on a GPIO configured as LED will lead to undefined behaviour and
must be avoided.
Every LED can be controlled either by the host SoC or automatically. When an automatic mode is
used, the SW is allowed to control only the brightness of this LED (except for the "error" mode).
HW limitation: the on/off delays passed to the API function `led_blink` are shared between all
LED instances, i.e. blinking different LEDs with different delays is not supported.
Examples
********
.. code-block:: dts
npm1012: pmic@6a {
/* ... */
leds {
compatible = "nordic,npm10xx-led";
pwm-freq-hz = <488>;
charge_indicator: led0 {
index = <1>;
label = "Charge indication LED on GPIO1";
led-mode = "charge";
};
user_led: led1 {
index = <0>;
label = "Red LED on GPIO0";
drive-current-ma = <10>;
};
};
/* ... */
};
Properties
**********
Top level properties
====================
These property descriptions apply to "nordic,npm10xx-led"
nodes themselves. This page also describes child node
properties in the following sections.
.. tabs::
.. group-tab:: Node specific properties
Properties not inherited from the base binding file.
.. list-table::
:widths: 1 1 4
:header-rows: 1
* - Name
- Type
- Details
* - ``pwm-freq-hz``
- ``int``
- .. code-block:: none
PWM frequency in Hz.
Default value: ``977``
Legal values: ``122``, ``244``, ``488``, ``977``
* - ``phase-shift-enable``
- ``boolean``
- .. code-block:: none
Enable phase shifting to minimize peak load currents. Useful when multiple LEDs are used at
once, for example in RGB setting.
* - ``blink-mode``
- ``string``
- .. code-block:: none
Perform a single or a double blink, or blink forever on blink tasks.
Default value: ``forever``
Legal values: ``single``, ``double``, ``forever``
.. group-tab:: Deprecated node specific properties
Deprecated properties not inherited from the base binding file.
(None)
.. group-tab:: Base properties
Properties inherited from the base binding file, which defines
common properties that may be set on many nodes. Not all of these
may apply to the "nordic,npm10xx-led" compatible.
(None)
Child node properties
=====================
.. list-table::
:widths: 1 1 4
:header-rows: 1
* - Name
- Type
- Details
* - ``index``
- ``int``
- .. code-block:: none
Index of the LED on a controller. It can be used by drivers or
applications to map a logical LED to its real position on the
controller. For example, this allows to handle boards where the
LEDs in an array/strip are not wired following the LED order of
the controller.
This property is **required**.
Legal values: ``0``, ``1``, ``2``
* - ``led-mode``
- ``string``
- .. code-block:: none
LED operation mode. Available options are as follows:
host: LED is controlled through LED device driver APIs, on/off, blink, brightness.
charge: LED indicates charging. Brightness control available.
error: LED indicates charging errors. No controls available.
vbus-good: LED indicates VBUS GOOD status. Brightness control available.
Default value: ``host``
Legal values: ``host``, ``charge``, ``error``, ``vbus-good``
* - ``drive-current-ma``
- ``int``
- .. code-block:: none
LED drive strength in mA.
Default value: ``5``
Legal values: ``5``, ``10``
* - ``label``
- ``string``
- .. code-block:: none
Human readable string describing the LED. It can be used by an
application to identify this LED or to retrieve its number/index
(i.e. child node number) on the parent device.
See :ref:`zephyr:dt-important-props` for more information.
* - ``color-mapping``
- ``array``
- .. code-block:: none
Channel to color mapping of a multicolor LED. If a LED supports
several colors, then the color-mapping property can be used to
describe how the hardware channels and the colors are mapped.
For example the channel to color mapping of RGB LEDs would be
color-mapping =
,
,
;