Skip to content

Commit

Permalink
boards: waveshare_rp2040: add led matrix display
Browse files Browse the repository at this point in the history
Enable the new LED matrix display driver to use the standard Zephyr
upstream "Display Orientation and Bit Order Test", but now on a LED
strip with 5x5 WS2812 digital RGB LEDs.

Signed-off-by: Stephan Linz <[email protected]>
  • Loading branch information
rexut committed Sep 15, 2024
1 parent 53a7e8b commit 0302982
Show file tree
Hide file tree
Showing 7 changed files with 64 additions and 2 deletions.
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

0 comments on commit 0302982

Please sign in to comment.