diff --git a/boards/shields/rpi_pico_led/boards/waveshare_pico_rgb_led/led_matrix.dtsi b/boards/shields/rpi_pico_led/boards/waveshare_pico_rgb_led/led_matrix.dtsi index 4b21a11ce6..aa34c5e284 100644 --- a/boards/shields/rpi_pico_led/boards/waveshare_pico_rgb_led/led_matrix.dtsi +++ b/boards/shields/rpi_pico_led/boards/waveshare_pico_rgb_led/led_matrix.dtsi @@ -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; + }; +}; diff --git a/boards/shields/rpi_pico_led/boards/waveshare_pico_rgb_led/rpipico_r3.dtsi b/boards/shields/rpi_pico_led/boards/waveshare_pico_rgb_led/rpipico_r3.dtsi index 969af4eb0c..9d857f8030 100644 --- a/boards/shields/rpi_pico_led/boards/waveshare_pico_rgb_led/rpipico_r3.dtsi +++ b/boards/shields/rpi_pico_led/boards/waveshare_pico_rgb_led/rpipico_r3.dtsi @@ -9,6 +9,10 @@ rgb_led_pio: &rpipico_pio_leds {}; #include +&rgb_led_strip_matrix { + status = "okay"; +}; + &rgb_led_strip { gpios = <&gpio0 6 GPIO_ACTIVE_HIGH>; /* PIO0:OUT @ GP6 */ status = "okay"; diff --git a/boards/shields/rpi_pico_led/doc/index.rst b/boards/shields/rpi_pico_led/doc/index.rst index b2b16b781f..abfd33017c 100644 --- a/boards/shields/rpi_pico_led/doc/index.rst +++ b/boards/shields/rpi_pico_led/doc/index.rst @@ -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 ` 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:` udc_rpi: BUS RESET` + [00:00:00.417,000] :byl:` udc_rpi: BUS RESET` + \*\*\* Booting Zephyr OS build |zephyr_version_em|\ *…* (delayed boot 4000ms) \*\*\* + [00:00:04.002,000] sample: Display sample for rgb-led-strip-matrix + References ********** diff --git a/boards/shields/rpi_pico_led/doc/waveshare_pico_rgb_led/ws2812b-16x10-display_test.gif b/boards/shields/rpi_pico_led/doc/waveshare_pico_rgb_led/ws2812b-16x10-display_test.gif new file mode 100644 index 0000000000..95f3c09b8b Binary files /dev/null and b/boards/shields/rpi_pico_led/doc/waveshare_pico_rgb_led/ws2812b-16x10-display_test.gif differ diff --git a/boards/shields/rpi_pico_led/waveshare_pico_rgb_led.conf b/boards/shields/rpi_pico_led/waveshare_pico_rgb_led.conf new file mode 100644 index 0000000000..a3fd88e552 --- /dev/null +++ b/boards/shields/rpi_pico_led/waveshare_pico_rgb_led.conf @@ -0,0 +1 @@ +CONFIG_LED_STRIP=y diff --git a/boards/shields/rpi_pico_led/waveshare_pico_rgb_led.overlay b/boards/shields/rpi_pico_led/waveshare_pico_rgb_led.overlay index 6f79c57d67..95c99d6385 100644 --- a/boards/shields/rpi_pico_led/waveshare_pico_rgb_led.overlay +++ b/boards/shields/rpi_pico_led/waveshare_pico_rgb_led.overlay @@ -4,6 +4,10 @@ */ / { + chosen { + zephyr,display = &rgb_led_strip_matrix; + }; + aliases { led-strip = &rgb_led_strip; }; diff --git a/boards/waveshare/rp2040/Kconfig.defconfig b/boards/waveshare/rp2040/Kconfig.defconfig index 7d8d10d58a..3af83c1aba 100644 --- a/boards/waveshare/rp2040/Kconfig.defconfig +++ b/boards/waveshare/rp2040/Kconfig.defconfig @@ -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 diff --git a/boards/waveshare/rp2040/doc/index.rst b/boards/waveshare/rp2040/doc/index.rst index 2b6ab973a6..f28108aa1f 100644 --- a/boards/waveshare/rp2040/doc/index.rst +++ b/boards/waveshare/rp2040/doc/index.rst @@ -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 ` 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: diff --git a/boards/waveshare/rp2040/doc/rp2040-matrix/hardware.rsti b/boards/waveshare/rp2040/doc/rp2040-matrix/hardware.rsti index 5f4636520c..60acfa8ca0 100644 --- a/boards/waveshare/rp2040/doc/rp2040-matrix/hardware.rsti +++ b/boards/waveshare/rp2040/doc/rp2040-matrix/hardware.rsti @@ -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` @@ -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 diff --git a/boards/waveshare/rp2040/doc/rp2040-matrix/pinouts.rsti b/boards/waveshare/rp2040/doc/rp2040-matrix/pinouts.rsti index dcd1d03c4c..ffe3b3e903 100644 --- a/boards/waveshare/rp2040/doc/rp2040-matrix/pinouts.rsti +++ b/boards/waveshare/rp2040/doc/rp2040-matrix/pinouts.rsti @@ -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 @@ -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 diff --git a/boards/waveshare/rp2040/doc/rp2040-matrix/ws2812b-5x5-display_test.gif b/boards/waveshare/rp2040/doc/rp2040-matrix/ws2812b-5x5-display_test.gif new file mode 100644 index 0000000000..75bdc11ace Binary files /dev/null and b/boards/waveshare/rp2040/doc/rp2040-matrix/ws2812b-5x5-display_test.gif differ diff --git a/boards/waveshare/rp2040/rp2040mini_led_strip_matrix.dtsi b/boards/waveshare/rp2040/rp2040mini_led_strip_matrix.dtsi new file mode 100644 index 0000000000..177a39cc84 --- /dev/null +++ b/boards/waveshare/rp2040/rp2040mini_led_strip_matrix.dtsi @@ -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; + }; +}; diff --git a/boards/waveshare/rp2040/waveshare_rp2040_matrix.dts b/boards/waveshare/rp2040/waveshare_rp2040_matrix.dts index e6289191a8..827bee5909 100644 --- a/boards/waveshare/rp2040/waveshare_rp2040_matrix.dts +++ b/boards/waveshare/rp2040/waveshare_rp2040_matrix.dts @@ -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 {}; diff --git a/doc/bridle/releases/release-notes-3.7.0.rst b/doc/bridle/releases/release-notes-3.7.0.rst index 686818bb4d..312db30a65 100644 --- a/doc/bridle/releases/release-notes-3.7.0.rst +++ b/doc/bridle/releases/release-notes-3.7.0.rst @@ -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