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

samples: led: consolidate LED samples under same directory #77840

Merged
merged 1 commit into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion MAINTAINERS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1739,7 +1739,7 @@ Release Notes:
- drivers/led/
simonguinot marked this conversation as resolved.
Show resolved Hide resolved
- include/zephyr/drivers/led/
- include/zephyr/drivers/led.h
- samples/drivers/led_*/
- samples/drivers/led/
- tests/drivers/led/
- doc/hardware/peripherals/led.rst
- tests/drivers/build_all/led/
Expand Down
4 changes: 2 additions & 2 deletions boards/bcdevices/plt_demo_v2/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,15 @@ an external programmer. The programmer is attached to the SWD header.
Build the Zephyr kernel and the :zephyr:code-sample:`led-strip` sample application.

.. zephyr-app-commands::
:zephyr-app: samples/drivers/led_apa102
:zephyr-app: samples/drivers/led/apa102
:board: blueclover_plt_demo_v2/nrf52832
:goals: build
:compact:

Flash the image.

.. zephyr-app-commands::
:zephyr-app: samples/drivers/led_apa102
:zephyr-app: samples/drivers/led/apa102
:board: blueclover_plt_demo_v2/nrf52832
:goals: flash
:compact:
Expand Down
2 changes: 1 addition & 1 deletion boards/shields/adafruit_neopixel_grid_bff/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ LED Strip Example
Set ``--shield adafruit_neopixel_grid_bff`` when you invoke ``west build``. For example:

.. zephyr-app-commands::
:zephyr-app: samples/drivers/led_strip
:zephyr-app: samples/drivers/led/led_strip
:board: adafruit_qt_py_rp2040
:shield: adafruit_neopixel_grid_bff
:goals: build
Expand Down
2 changes: 1 addition & 1 deletion boards/shields/adafruit_pca9685/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Set ``--shield adafruit_pca9685`` when you invoke ``west build``.
For example:

.. zephyr-app-commands::
:zephyr-app: samples/drivers/led_pwm
:zephyr-app: samples/drivers/led/pwm
:board: nrf52840dk/nrf52840
:shield: adafruit_pca9685
:goals: build
Expand Down
2 changes: 1 addition & 1 deletion boards/vcc-gnd/yd_esp32/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ The board contains an addressable RGB LED (`XL-5050RGBC-WS2812B`_), driven by GP
Here is an example of how to test it using the :zephyr:code-sample:`led-strip` application.

.. zephyr-app-commands::
:zephyr-app: samples/drivers/led_strip
:zephyr-app: samples/drivers/led/led_strip
:board: yd_esp32/esp32/procpu
:goals: flash

Expand Down
12 changes: 12 additions & 0 deletions doc/_scripts/redirects.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,20 @@
('samples/drivers/adc/README', 'samples/drivers/adc/adc_dt/README'),
('samples/drivers/kscan_touch', 'samples/subsys/input/input'),
('samples/drivers/led_apa102/README', 'samples/drivers/led_strip/README'),
('samples/drivers/led_is31fl3194/README', 'samples/drivers/led/is31fl3194/README'),
('samples/drivers/led_is31fl3216a/README', 'samples/drivers/led/is31fl3216a/README'),
('samples/drivers/led_is31fl3733/README', 'samples/drivers/led/is31fl3733/README'),
('samples/drivers/led_lp3943/README', 'samples/drivers/led/lp3943/README'),
('samples/drivers/led_lp50xx/README', 'samples/drivers/led/lp50xx/README'),
('samples/drivers/led_lp5562/README', 'samples/drivers/led/lp5562/README'),
('samples/drivers/led_lp5569/README', 'samples/drivers/led/lp5569/README'),
('samples/drivers/led_lpd8806/README', 'samples/drivers/led_strip/README'),
('samples/drivers/led_pca9633/README', 'samples/drivers/led/pca9633/README'),
('samples/drivers/led_pwm/README', 'samples/drivers/led/pwm/README'),
('samples/drivers/led_strip/README', 'samples/drivers/led/led_strip/README'),
('samples/drivers/led_sx1509b_intensity/README', 'samples/drivers/led/sx1509b_intensity/README'),
('samples/drivers/led_ws2812/README', 'samples/drivers/led_strip/README'),
('samples/drivers/led_xec/README', 'samples/drivers/led/xec/README'),
('samples/net/cloud/google_iot_mqtt/README', 'samples/net/net'),
('samples/sensor/wsen_hids/README', 'samples/sensor/sensor'),
('samples/sensor/wsen_itds/README', 'samples/sensor/sensor'),
Expand Down
2 changes: 2 additions & 0 deletions doc/releases/release-notes-4.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,8 @@ Drivers and Sensors

* lp5569: added ``enable-gpios`` property to describe the EN/PWM GPIO of the lp5569.

* LED code samples have been consolidated under the :zephyr_file:`samples/drivers/led` directory.

* LED Strip

* LoRa
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
:name: LED strip
:relevant-api: led_strip_interface

Control an LED strip example.
Control an LED strip.

Overview
********
Expand Down Expand Up @@ -68,7 +68,7 @@ modified by changing the :kconfig:option:`CONFIG_SAMPLE_LED_UPDATE_DELAY`.
Then build and flash the application:

.. zephyr-app-commands::
:zephyr-app: samples/drivers/led_strip
:zephyr-app: samples/drivers/led/led_strip
Copy link
Collaborator

Choose a reason for hiding this comment

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

Don't you think we should put led_strip at the same level than led ?

samples/drivers/led
samples/drivers/led_strip

After all led_strip is a distinct subsystem, with its own API. Also, this would mirror the drivers tree:

drivers/led
drivers/led_strip

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Maybe, yes. My reasoning was based on how things are presented in: https://docs.zephyrproject.org/latest/hardware/peripherals/led.html , i.e. everything under LED.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Makes sense.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I am happy to do a follow-up PR but hopefully this is good enough for a first pass at cleaning things up.
I just rebased to address a conflict in redirects.py

Copy link
Collaborator

Choose a reason for hiding this comment

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

Would vote for led_strip being at the same level as led not inside of it, they are different drivers

:board: <board>
:goals: flash
:compact:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Build the application for the :ref:`96b_neonkey` board, which has an
LP3943 driver included.

.. zephyr-app-commands::
:zephyr-app: samples/drivers/led_lp3943
:zephyr-app: samples/drivers/led/lp3943
:board: 96b_neonkey
:goals: build
:compact:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Build the application for the :ref:`nrf52840dk_nrf52840` board, and connect
a LP5562 LED driver on the bus I2C0 at the address 0x30.

.. zephyr-app-commands::
:zephyr-app: samples/drivers/led_lp5562
:zephyr-app: samples/drivers/led/lp5562
:board: nrf52840dk/nrf52840
:goals: build
:compact:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Build the application for the :ref:`nrf52840dk_nrf52840` board, and connect
a LP5569 LED controller on the bus I2C0 at the address 0x32.

.. zephyr-app-commands::
:zephyr-app: samples/drivers/led_lp5569
:zephyr-app: samples/drivers/led/lp5569
:board: nrf52840dk/nrf52840
:goals: build
:compact:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Build the application for the :ref:`nucleo_f334r8_board` board, and connect
a PCA9633 LED driver on the bus I2C Arduino.

.. zephyr-app-commands::
:zephyr-app: samples/drivers/led_pca9633
:zephyr-app: samples/drivers/led/pca9633
:board: nucleo_f334r8_board
:goals: build
:compact:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Building and Running
********************

.. zephyr-app-commands::
:zephyr-app: samples/drivers/led_sx1509b_intensity
:zephyr-app: samples/drivers/led/sx1509b_intensity
:board: thingy52/nrf52832
:goals: build flash
:compact:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading