Skip to content
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

Merged
merged 1 commit into from
Jan 17, 2025

Conversation

greg-fer
Copy link
Contributor

Moved the steps for adding a LED node from VSC extension docs to a new page under Configuring devicetree.
VSC-2802.

@greg-fer greg-fer added CI-disable Disable CI for this PR doc only labels Jan 15, 2025
@greg-fer greg-fer added this to the 3.0.0 milestone Jan 15, 2025
@greg-fer greg-fer requested a review from FilipZajdel January 15, 2025 13:37
@greg-fer greg-fer requested review from a team as code owners January 15, 2025 13:37
@github-actions github-actions bot added the doc-required PR must not be merged without tech writer approval. label Jan 15, 2025
@NordicBuilder
Copy link
Contributor

NordicBuilder commented Jan 15, 2025

CI Information

To view the history of this post, clich the 'edited' button above
Build number: 3

Inputs:

Sources:

more details

Github labels

Enabled Name Description
ci-disabled Disable the ci execution
ci-all-test Run all of ci, no test spec filtering will be done
ci-force-downstream Force execution of downstream even if twister fails
ci-run-twister Force run twister
ci-run-zephyr-twister Force run zephyr twister
List of changed files detected by CI (0)

Outputs:

Toolchain

Version:
Build docker image:

Test Spec & Results: ✅ Success; ❌ Failure; 🟠 Queued; 🟡 Progress; ◻️ Skipped; ⚠️ Quarantine

  • ◻️ Toolchain
  • ◻️ Build twister
  • ◻️ Integration tests

Note: This message is automatically posted and updated by the CI


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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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).
Copy link
Contributor

@peknis peknis Jan 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
These files can override node property values in multiple ways.
These files can override node the property values in multiple ways.

Copy link
Contributor

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.

Comment on lines 46 to 48
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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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`):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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>`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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>`.

@@ -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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.


.. |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>`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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>`.

@@ -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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
.. |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.

Copy link
Contributor

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?

Suggested change
.. |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:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.

@@ -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.
Copy link
Contributor

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?

Suggested change
.. |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.

@greg-fer greg-fer force-pushed the doc_move_led_example_out_of_vsc branch from fc20246 to 65bfeaa Compare January 16, 2025 09:31
@NordicBuilder
Copy link
Contributor

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]>
@greg-fer greg-fer force-pushed the doc_move_led_example_out_of_vsc branch from 65bfeaa to ad2f559 Compare January 17, 2025 09:03
@nordicjm nordicjm merged commit cb64067 into nrfconnect:main Jan 17, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI-disable Disable CI for this PR doc only doc-required PR must not be merged without tech writer approval.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants