-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
doc: hardware: Move LED example to a separate page #19924
doc: hardware: Move LED example to a separate page #19924
Conversation
CI InformationTo view the history of this post, clich the 'edited' button above Inputs:Sources:more detailsGithub labels
List of changed files detected by CI (0)
Outputs:ToolchainVersion: Test Spec & Results: ✅ Success; ❌ Failure; 🟠 Queued; 🟡 Progress; ◻️ Skipped;
|
|
||
You can implement this example either by manually editing devicetree files or by using the |nRFVSC| with its `Devicetree language support`_ and the :ref:`Devicetree Visual Editor <How to work with Devicetree Visual Editor>` (which is recommended). | ||
|
||
For more advanced LED control, you can also use the :ref:`Common Application Framework (CAF) <lib_caf>`'s :ref:`LEDs module <caf_leds>`, which provides additional features like LED effects and power management integration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For more advanced LED control, you can also use the :ref:`Common Application Framework (CAF) <lib_caf>`'s :ref:`LEDs module <caf_leds>`, which provides additional features like LED effects and power management integration. | |
For more advanced LED control, you can also use the :ref:`LEDs module <caf_leds>` of the :ref:`Common Application Framework (CAF) <lib_caf>`, which provides additional features, such as LED effects and power management integration. |
|
||
This example demonstrates how to add support for a dimmable LED node to your board in an overlay file. | ||
|
||
You can implement this example either by manually editing devicetree files or by using the |nRFVSC| with its `Devicetree language support`_ and the :ref:`Devicetree Visual Editor <How to work with Devicetree Visual Editor>` (which is recommended). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can implement this example either by manually editing devicetree files or by using the |nRFVSC| with its `Devicetree language support`_ and the :ref:`Devicetree Visual Editor <How to work with Devicetree Visual Editor>` (which is recommended). | |
To implement this example, you can either edit the devicetree files manually or use the |nRFVSC| with its `Devicetree language support`_ and the `Devicetree Visual Editor <How to work with Devicetree Visual Editor_>`_ (recommended). |
*************************************** | ||
|
||
Overlay files are a category of devicetree's :ref:`zephyr:devicetree-in-out-files`. | ||
These files can override node property values in multiple ways. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These files can override node property values in multiple ways. | |
These files can override node the property values in multiple ways. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoops, article in the wrong place. I meant the node property values.
1. Add the `pwm-leds` binding for the driver to pick up. | ||
1. Add LEDs as child nodes on the `pwmleds` controller node, with `pwms` and `label` properties. | ||
1. Make sure the `pwms` property of the `phandle-array` type points to a PWM instance. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1. Add the `pwm-leds` binding for the driver to pick up. | |
1. Add LEDs as child nodes on the `pwmleds` controller node, with `pwms` and `label` properties. | |
1. Make sure the `pwms` property of the `phandle-array` type points to a PWM instance. | |
#. Add the ``pwm-leds`` binding for the driver to pick up. | |
#. Add LEDs as child nodes on the `pwmleds` controller node, with ``pwms`` and ``label`` properties. | |
#. Make sure the ``pwms`` property of the ``phandle-array`` type points to a PWM instance. |
1. Make sure the `pwms` property of the `phandle-array` type points to a PWM instance. | ||
The PWM instance takes the pin number as its only parameter. | ||
|
||
The following code example uses pins 6 and 7 on the GPIO port 0 (`&pwm0`): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The following code example uses pins 6 and 7 on the GPIO port 0 (`&pwm0`): | |
The following code example uses pins 6 and 7 on the GPIO port 0 (``&pwm0``): |
Enable the LED PWM driver | ||
************************* | ||
|
||
Enable the LED PWM driver by adding the following line to your board's :file:`prj.conf` file: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Enable the LED PWM driver by adding the following line to your board's :file:`prj.conf` file: | |
To enable the LED PWM driver, add the following line to your board's :file:`prj.conf` file: |
|
||
CONFIG_LED_PWM=y | ||
|
||
Once you have added the LED PWM driver, you :ref:`build your application <building>` and :ref:`program it to your board <programming>`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once you have added the LED PWM driver, you :ref:`build your application <building>` and :ref:`program it to your board <programming>`. | |
Once you have added the LED PWM driver, :ref:`build your application <building>` and :ref:`program it to your board <programming>`. |
doc/nrf/shortcuts.txt
Outdated
@@ -263,3 +263,7 @@ | |||
.. |filter_samples_by_board| replace:: If you want to list samples available for one or more specific boards, `use the nRF Connect for Visual Studio Code extension to filter them <Browse samples_>`_. | |||
|
|||
.. |54H_engb_2_8| replace:: The nRF54H20 DK Engineering A and B (up to version 0.8.2) are no longer supported starting with |NCS| v2.9.0. | |||
|
|||
.. |devicetree_bindings| replace:: The devicetree bindings provide structure for the devicetree by declaring requirements for the content of devicetree nodes. | |||
The :ref:`compatible <zephyr:dt-bindings-compatible>` property defines compatibility of a devicetree node with a devicetree binding. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The :ref:`compatible <zephyr:dt-bindings-compatible>` property defines compatibility of a devicetree node with a devicetree binding. | |
The :ref:`compatible <zephyr:dt-bindings-compatible>` property defines the compatibility of a devicetree node with a devicetree binding. |
doc/nrf/shortcuts.txt
Outdated
|
||
.. |devicetree_bindings| replace:: The devicetree bindings provide structure for the devicetree by declaring requirements for the content of devicetree nodes. | ||
The :ref:`compatible <zephyr:dt-bindings-compatible>` property defines compatibility of a devicetree node with a devicetree binding. | ||
For more information about devicetree bindings, read the :ref:`documentation about them in Zephyr <zephyr:dt-binding-compat>`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For more information about devicetree bindings, read the :ref:`documentation about them in Zephyr <zephyr:dt-binding-compat>`. | |
For more information, read the :ref:`documentation about devicetree bindings in Zephyr <zephyr:dt-binding-compat>`. |
doc/nrf/shortcuts.txt
Outdated
@@ -263,3 +263,7 @@ | |||
.. |filter_samples_by_board| replace:: If you want to list samples available for one or more specific boards, `use the nRF Connect for Visual Studio Code extension to filter them <Browse samples_>`_. | |||
|
|||
.. |54H_engb_2_8| replace:: The nRF54H20 DK Engineering A and B (up to version 0.8.2) are no longer supported starting with |NCS| v2.9.0. | |||
|
|||
.. |devicetree_bindings| replace:: The devicetree bindings provide structure for the devicetree by declaring requirements for the content of devicetree nodes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.. |devicetree_bindings| replace:: The devicetree bindings provide structure for the devicetree by declaring requirements for the content of devicetree nodes. | |
.. |devicetree_bindings| replace:: The devicetree bindings provide the structure for the devicetree by declaring requirements for the content of devicetree nodes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't this be simpler?
.. |devicetree_bindings| replace:: The devicetree bindings provide structure for the devicetree by declaring requirements for the content of devicetree nodes. | |
.. |devicetree_bindings| replace:: The devicetree bindings provide structure for the content of the devicetree nodes. |
Enable the LED PWM driver | ||
************************* | ||
|
||
Enable the LED PWM driver by adding the following line to your board's :file:`prj.conf` file: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Enable the LED PWM driver by adding the following line to your board's :file:`prj.conf` file: | |
Enable the LED PWM by adding the following entry in your :file:`prj.conf` file: |
prj.conf the application's related file, not the board's.
doc/nrf/shortcuts.txt
Outdated
@@ -263,3 +263,7 @@ | |||
.. |filter_samples_by_board| replace:: If you want to list samples available for one or more specific boards, `use the nRF Connect for Visual Studio Code extension to filter them <Browse samples_>`_. | |||
|
|||
.. |54H_engb_2_8| replace:: The nRF54H20 DK Engineering A and B (up to version 0.8.2) are no longer supported starting with |NCS| v2.9.0. | |||
|
|||
.. |devicetree_bindings| replace:: The devicetree bindings provide structure for the devicetree by declaring requirements for the content of devicetree nodes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't this be simpler?
.. |devicetree_bindings| replace:: The devicetree bindings provide structure for the devicetree by declaring requirements for the content of devicetree nodes. | |
.. |devicetree_bindings| replace:: The devicetree bindings provide structure for the content of the devicetree nodes. |
fc20246
to
65bfeaa
Compare
You can find the documentation preview for this PR at this link. Note: This comment is automatically posted by the Documentation Publish GitHub Action. |
Moved the steps for adding a LED node from VSC extension docs to a new page under Configuring devicetree. VSC-2802. Signed-off-by: Grzegorz Ferenc <[email protected]>
65bfeaa
to
ad2f559
Compare
Moved the steps for adding a LED node from VSC extension docs to a new page under Configuring devicetree.
VSC-2802.