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

Add LED strip matrix display #266

Merged
merged 3 commits into from
Sep 15, 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
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,18 @@
};
};
};

/ {
rgb_led_strip_matrix: rgb-led-strip-matrix {
compatible = "led-strip-matrix";

status = "disabled";

led-strips = <&rgb_led_strip>;

width = <16>;
height = <10>;

circulative;
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ rgb_led_pio: &rpipico_pio_leds {};

#include <zephyr/dt-bindings/gpio/gpio.h>

&rgb_led_strip_matrix {
status = "okay";
};

&rgb_led_strip {
gpios = <&gpio0 6 GPIO_ACTIVE_HIGH>; /* PIO0:OUT @ GP6 */
status = "okay";
Expand Down
99 changes: 99 additions & 0 deletions boards/shields/rpi_pico_led/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,105 @@ LED Blinky and Fade
|Waveshare Pico RGB LED|, because this shield has only digital
RGB LEDs. A simple GPIO or PWM control is not possible!

LED Display Orientation and Bit Order Test
==========================================

Draw some basic rectangles onto the display. The rectangle colors and positions
are chosen so that you can check the orientation of the LED display and correct
RGB bit order. See also Zephyr sample:
:doc:`zephyr:samples/drivers/display/README`.

.. tabs::

.. group-tab:: Waveshare Pico RGB LED

.. image:: /boards/shields/rpi_pico_led/doc/waveshare_pico_rgb_led/ws2812b-16x10-display_test.gif
:align: right
:alt: Waveshare Pico RGB LED Display Test Pattern

Using the :ref:`Display driver API <zephyr:display_api>` with chosen
display. That is:

| :hwftlbl-scr:`LED(16×10)` :
:devicetree:`chosen { zephyr,display = &rgb_led_strip_matrix; };`
| :hwftlbl-led:`16×10 RGB` :
:devicetree:`&rgb_led_strip_matrix { led-strip = <&rgb_led_strip>; };`

.. tabs::

.. group-tab:: Raspberry Pi Pico

.. zephyr-app-commands::
:app: zephyr/samples/drivers/display
:build-dir: waveshare_pico_rgb_led-display_test
:board: rpi_pico
:shield: waveshare_pico_rgb_led
:west-args: -p -S usb-console
:flash-args: -r uf2
:goals: flash
:compact:

.. group-tab:: Raspberry Pi Pico W

.. zephyr-app-commands::
:app: zephyr/samples/drivers/display
:build-dir: waveshare_pico_rgb_led-display_test
:board: rpi_pico_w
:shield: waveshare_pico_rgb_led
:west-args: -p -S usb-console
:flash-args: -r uf2
:goals: flash
:compact:

.. group-tab:: Waveshare RP2040-LCD-0.96

.. zephyr-app-commands::
:app: zephyr/samples/drivers/display
:build-dir: waveshare_pico_rgb_led-display_test
:board: waveshare_rp2040_lcd_0_96
:shield: waveshare_pico_rgb_led
:west-args: -p -S usb-console
:flash-args: -r uf2
:goals: flash
:compact:

.. group-tab:: Waveshare RP2040-Plus

.. rubric:: on standard ``4㎆`` revision

.. zephyr-app-commands::
:app: zephyr/samples/drivers/display
:build-dir: waveshare_pico_rgb_led-display_test
:board: waveshare_rp2040_plus
:shield: waveshare_pico_rgb_led
:west-args: -p -S usb-console
:flash-args: -r uf2
:goals: flash
:compact:

.. rubric:: on extended ``16㎆`` revision

.. zephyr-app-commands::
:app: zephyr/samples/drivers/display
:build-dir: waveshare_pico_rgb_led-display_test
:board: waveshare_rp2040_plus@16mb
:shield: waveshare_pico_rgb_led
:west-args: -p -S usb-console
:flash-args: -r uf2
:goals: flash
:compact:

.. rubric:: Simple logging output on target

.. parsed-literal::
:class: highlight-console notranslate

\*\*\*\*\* delaying boot 4000ms (per build configuration) \*\*\*\*\*
[00:00:00.337,000] :byl:`<wrn> udc_rpi: BUS RESET`
[00:00:00.417,000] :byl:`<wrn> udc_rpi: BUS RESET`
\*\*\* Booting Zephyr OS build |zephyr_version_em|\ *…* (delayed boot 4000ms) \*\*\*
[00:00:04.002,000] <inf> sample: Display sample for rgb-led-strip-matrix

References
**********

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions boards/shields/rpi_pico_led/waveshare_pico_rgb_led.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CONFIG_LED_STRIP=y
4 changes: 4 additions & 0 deletions boards/shields/rpi_pico_led/waveshare_pico_rgb_led.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
*/

/ {
chosen {
zephyr,display = &rgb_led_strip_matrix;
};

aliases {
led-strip = &rgb_led_strip;
};
Expand Down
4 changes: 4 additions & 0 deletions boards/waveshare/rp2040/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ config I2C_DW_CLOCK_SPEED
default 125
depends on I2C_DW && BOARD_WAVESHARE_RP2040

config LED_STRIP
default y
depends on BOARD_WAVESHARE_RP2040_MATRIX && DISPLAY

choice ST7789V_PIXEL_FORMAT
default ST7789V_RGB565 if BOARD_WAVESHARE_RP2040_GEEK
depends on BOARD_WAVESHARE_RP2040_LCD && DISPLAY
Expand Down
39 changes: 37 additions & 2 deletions boards/waveshare/rp2040/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1147,11 +1147,46 @@ Hello Shell with USB-CDC/ACM Console
Display Test and Demonstration
==============================

This samples and test applications are only applicable on the |RP2040-LCD-0.96|
and |RP2040-Geek| board. They will be built with activated USB-CDC/ACM console.
This samples and test applications are only applicable on the |RP2040-Matrix|,
|RP2040-LCD-0.96| and |RP2040-Geek| board. They will be built with activated
USB-CDC/ACM console.

.. tabs::

.. group-tab:: RP2040-Matrix

The following samples work with the chosen display. That is:

| :hwftlbl-scr:`LED(5×5)` : :devicetree:`chosen { zephyr,display = &rgb_led_strip_matrix; };`
| :hwftlbl-led:`5×5 RGB` : :devicetree:`&rgb_led_strip_matrix { led-strip = <&led_strip>; };`

.. rubric:: LCD Orientation and Bit Order Test

Using the :ref:`Display driver API <zephyr:display_api>` with chosen
display. See also Zephyr sample:
:doc:`zephyr:samples/drivers/display/README`.

.. zephyr-app-commands::
:app: zephyr/samples/drivers/display
:board: waveshare_rp2040_matrix
:build-dir: waveshare_rp2040
:west-args: -p -S usb-console
:flash-args: -r uf2
:goals: flash
:compact:

.. list-table::
:align: center
:width: 66%
:header-rows: 1

* - .. image:: rp2040-matrix/ws2812b-5x5-display_test.gif
:align: center
:alt: Waveshare RP2040-Matrix Display Sample Animation
* - .. rst-class:: centered

:brd:`TOP LEFT`, :bgn:`TOP RIGHT`, :bbl:`BOTTOM RIGHT`

.. group-tab:: RP2040-LCD-0.96

The following samples work with the chosen display. That is:
Expand Down
2 changes: 2 additions & 0 deletions boards/waveshare/rp2040/doc/rp2040-matrix/hardware.rsti
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ direct to carrier boards.
:hwftlbl:`264㎅`
:hwftlbl-btn:`RST`
:hwftlbl-led:`RGB(5×5)`
:hwftlbl-scr:`LED(5×5)`
:hwftlbl-con:`USB-C`
:hwftlbl-dbg:`UF2`

Expand All @@ -42,6 +43,7 @@ direct to carrier boards.
- On-board :bbl:`3.3V LDO regulator with 500㎃`
- On-board :bbl:`RESET` button
- On-board :bbk:`BOOT` button
- :bbl:`RGB888`, 24-bit color depth
- :bbl:`20 GPIO` pins via :bbk:`edge pinout`
- :bbk:`2 UART` peripherals
- :bbk:`2 I2C` controllers
Expand Down
2 changes: 2 additions & 0 deletions boards/waveshare/rp2040/doc/rp2040-matrix/pinouts.rsti
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ is no option to change this from outside the board.

:on-board:
:hwftlbl-led:`5×5 RGB`
:hwftlbl-scr:`LED(5×5)`

.. rubric:: Default Zephyr Peripheral Mapping

Expand Down Expand Up @@ -74,6 +75,7 @@ is no option to change this from outside the board.
.. rubric:: Devicetree compatible

- :dtcompatible:`waveshare,rp2040mini-header`
- :dtcompatible:`worldsemi,ws2812-rpi_pico-pio`

- .. image:: rp2040-matrix/pinouts.jpg
:align: center
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions boards/waveshare/rp2040/rp2040mini_led_strip_matrix.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
* Copyright (c) 2023-2024 TiaC Systems
* SPDX-License-Identifier: Apache-2.0
*/

/ {
chosen {
zephyr,display = &rgb_led_strip_matrix;
};

rgb_led_strip_matrix: rgb_led_strip_matrix {
compatible = "led-strip-matrix";
led-strips = <&led_strip>;
width = <5>;
height = <5>;
circulative;
};
};
1 change: 1 addition & 0 deletions boards/waveshare/rp2040/waveshare_rp2040_matrix.dts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "waveshare_rp2040-2mb.dtsi"

#include "rp2040mini_led_ws2812.dtsi"
#include "rp2040mini_led_strip_matrix.dtsi"
#include "rp2040mini_connector.dtsi"

rp2040mini_serial: &uart0 {};
Expand Down
6 changes: 6 additions & 0 deletions doc/bridle/releases/release-notes-3.7.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,12 @@ Change log

* *TCS-604-ARD* **SPI-to-I2C for Arduino - SC18IS604** shield by TiaC

* Provide **WS2812** digital RGB LED **matrix** as standard **Zephyr display**
on following boards or shields:

* *Waveshare RP2040-Matrix*
* *Waveshare Pico RGB LED Shield*

The following sections provide detailed lists of changes by component.

* PROJECT UPDATE to `Zephyr Project`_ v3.7
Expand Down