diff --git a/boards/shields/adafruit_neopixel_grid_bff/Kconfig.defconfig b/boards/shields/adafruit_neopixel_grid_bff/Kconfig.defconfig new file mode 100644 index 0000000000..9557263064 --- /dev/null +++ b/boards/shields/adafruit_neopixel_grid_bff/Kconfig.defconfig @@ -0,0 +1,4 @@ +# Copyright (c) 2024 Ian Wakely +# SPDX-License-Identifier: Apache-2.0 + +# Intentionally left blank. diff --git a/boards/shields/adafruit_neopixel_grid_bff/Kconfig.shield b/boards/shields/adafruit_neopixel_grid_bff/Kconfig.shield new file mode 100644 index 0000000000..9197376275 --- /dev/null +++ b/boards/shields/adafruit_neopixel_grid_bff/Kconfig.shield @@ -0,0 +1,5 @@ +# Copyright (c) 2024 Ian Wakely +# SPDX-License-Identifier: Apache-2.0 + +config SHIELD_ADAFRUIT_NEOPIXEL_GRID_BFF + def_bool $(shields_list_contains,adafruit_neopixel_grid_bff) diff --git a/boards/shields/adafruit_neopixel_grid_bff/adafruit_neopixel_grid_bff.overlay b/boards/shields/adafruit_neopixel_grid_bff/adafruit_neopixel_grid_bff.overlay new file mode 100644 index 0000000000..9a0cbfb31a --- /dev/null +++ b/boards/shields/adafruit_neopixel_grid_bff/adafruit_neopixel_grid_bff.overlay @@ -0,0 +1,12 @@ +/* + * Copyright (c) 2024, Ian Wakely + * SPDX-License-Identifier: Apache-2.0 + */ + +#include + +/ { + aliases { + led-strip = &bff_led_strip; + }; +}; diff --git a/boards/shields/adafruit_neopixel_grid_bff/adafruit_neopixel_grid_bff_display.conf b/boards/shields/adafruit_neopixel_grid_bff/adafruit_neopixel_grid_bff_display.conf new file mode 100644 index 0000000000..889bdb8188 --- /dev/null +++ b/boards/shields/adafruit_neopixel_grid_bff/adafruit_neopixel_grid_bff_display.conf @@ -0,0 +1,2 @@ +CONFIG_LED_STRIP=y +CONFIG_WS2812_STRIP=y diff --git a/boards/shields/adafruit_neopixel_grid_bff/adafruit_neopixel_grid_bff_display.overlay b/boards/shields/adafruit_neopixel_grid_bff/adafruit_neopixel_grid_bff_display.overlay new file mode 100644 index 0000000000..fbb7b9bcec --- /dev/null +++ b/boards/shields/adafruit_neopixel_grid_bff/adafruit_neopixel_grid_bff_display.overlay @@ -0,0 +1,17 @@ +#include "adafruit_neopixel_grid_bff.overlay" + +/ { + chosen { + zephyr,display = &bff_led_matrix; + }; + + bff_led_matrix: bff-led-matrix { + compatible = "led-strip-matrix"; + status = "okay"; + led-strips = <&bff_led_strip>; + width = <5>; + height = <5>; + start-from-right; + circulative; + }; +}; diff --git a/boards/shields/adafruit_neopixel_grid_bff/boards/adafruit_qt_py_rp2040.conf b/boards/shields/adafruit_neopixel_grid_bff/boards/adafruit_qt_py_rp2040.conf new file mode 100644 index 0000000000..9ccb06fb7b --- /dev/null +++ b/boards/shields/adafruit_neopixel_grid_bff/boards/adafruit_qt_py_rp2040.conf @@ -0,0 +1 @@ +CONFIG_WS2812_STRIP_RPI_PICO_PIO=y diff --git a/boards/shields/adafruit_neopixel_grid_bff/boards/adafruit_qt_py_rp2040.overlay b/boards/shields/adafruit_neopixel_grid_bff/boards/adafruit_qt_py_rp2040.overlay new file mode 100644 index 0000000000..2b2aad5b74 --- /dev/null +++ b/boards/shields/adafruit_neopixel_grid_bff/boards/adafruit_qt_py_rp2040.overlay @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2024, Ian Wakely + * SPDX-License-Identifier: Apache-2.0 + */ + +#include + +&pinctrl { + pinctrl_bff_ws2812: pinctrl_bff_ws2812 { + ws2812 { + pinmux = ; + }; + }; +}; + +&pio0 { + status = "okay"; + + bff-ws2812 { + compatible = "worldsemi,ws2812-rpi_pico-pio"; + status = "okay"; + pinctrl-0 = <&pinctrl_bff_ws2812>; + pinctrl-names = "default"; + bit-waveform = <3>, <3>, <4>; + + bff_led_strip: bff_led_strip { + status = "okay"; + gpios = <&xiao_d 3 GPIO_ACTIVE_HIGH>; + chain-length = <25>; + color-mapping = ; + reset-delay = <280>; + frequency = <800000>; + }; + }; +}; diff --git a/boards/shields/adafruit_neopixel_grid_bff/doc/adafruit_neopixel_grid_bff.jpg b/boards/shields/adafruit_neopixel_grid_bff/doc/adafruit_neopixel_grid_bff.jpg new file mode 100644 index 0000000000..babd176c8c Binary files /dev/null and b/boards/shields/adafruit_neopixel_grid_bff/doc/adafruit_neopixel_grid_bff.jpg differ diff --git a/boards/shields/adafruit_neopixel_grid_bff/doc/index.rst b/boards/shields/adafruit_neopixel_grid_bff/doc/index.rst new file mode 100644 index 0000000000..f4648e9b02 --- /dev/null +++ b/boards/shields/adafruit_neopixel_grid_bff/doc/index.rst @@ -0,0 +1,69 @@ +.. _adafruit_neopixel_grid_bff: + +Adafruit 5x5 NeoPixel Grid BFF +############################## + +Overview +******** + +The `Adafruit 5x5 NeoPixel Grid BFF`_ is a 5x5 grid of WS2812B RGB LEDs, +which Adafruit refers to as "neopixels". The BFF series of shields are +designed to be compatible with any Adafruit Qt Py or Seeed Studio Xiao +board. + +.. figure:: adafruit_neopixel_grid_bff.jpg + :align: center + :alt: Adafruit 5x5 NeoPixel Grid BFF + + Adafruit 5x5 NeoPixel Grid BFF (Credit: Adafruit) + +Pin Assignments +=============== + ++-----------------------+---------------------------------------------+ +| Shield Connector Pin | Function | ++=======================+=============================================+ +| A3 | WS2812B driver pin [1]_ | ++-----------------------+---------------------------------------------+ + +.. [1] This is the default pin when the board is delivered as is by Adafruit. + It can be changed away from the default using the onboard solder jumpers, + but this shield will no longer work without a matching device tree update. + +Programming +*********** + +LED Strip Example +================= + +Set ``-DSHIELD=adafruit_neopixel_grid_bff`` when you invoke ``west build``. For example: + +.. zephyr-app-commands:: + :zephyr-app: samples/drivers/led_ws2812 + :board: adafruit_qt_py_rp2040 + :shield: adafruit_neopixel_grid_bff + :goals: build + +LED Display Matrix Example +========================== + +.. warning:: + + When using this example, all of the LEDs will be set to their maximum + brightness. Having all of the LEDs on at once can cause the PCB to overheat + or draw too much current from any on-board voltage regulators. + Adafruit does provide solder pads for your own power supply on the + underside of the BFF for this reason. It is not required, but is strongly + recommended if all of the LEDs are fully on for any significant amount of + time. + +Set ``-DSHIELD=adafruit_neopixel_grid_bff_display`` when you invoke ``west build``. For example: + +.. zephyr-app-commands:: + :zephyr-app: samples/drivers/display + :board: adafruit_qt_py_rp2040 + :shield: adafruit_neopixel_grid_bff_display + :goals: build + +.. _Adafruit 5x5 NeoPixel Grid BFF: + https://learn.adafruit.com/adafruit-5x5-neopixel-grid-bff/