Skip to content

Commit

Permalink
boards: shields: Adding Adafruit 5x5 RGB BFF
Browse files Browse the repository at this point in the history
This is a 5x5 grid of WS2812 RGB LEDs.

Signed-off-by: Ian Wakely <raveious.irw@gmail.com>
  • Loading branch information
raveious committed Jan 18, 2024
1 parent 3b99fb1 commit 1ba9845
Show file tree
Hide file tree
Showing 7 changed files with 104 additions and 0 deletions.
4 changes: 4 additions & 0 deletions 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.
5 changes: 5 additions & 0 deletions 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)
@@ -0,0 +1,12 @@
/*
* Copyright (c) 2024, Ian Wakely
* SPDX-License-Identifier: Apache-2.0
*/

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

/ {
aliases {
led-strip = &bff_led_strip;
};
};
@@ -0,0 +1 @@
CONFIG_WS2812_STRIP_RPI_PICO_PIO=y
@@ -0,0 +1,37 @@
/*
* Copyright (c) 2024, Ian Wakely
* SPDX-License-Identifier: Apache-2.0
*/

#include <dt-bindings/pinctrl/rpi-pico-rp2040-pinctrl.h>

&pinctrl {
pinctrl_bff_ws2812: pinctrl_bff_ws2812 {
ws2812 {
pinmux = <PIO0_P26>;
};
};
};

&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";
output-pin = <26>;
chain-length = <25>;
color-mapping = <LED_COLOR_ID_GREEN
LED_COLOR_ID_RED
LED_COLOR_ID_BLUE>;
reset-delay = <280>;
frequency = <800000>;
};
};
};
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
45 changes: 45 additions & 0 deletions boards/shields/adafruit_neopixel_grid_bff/doc/index.rst
@@ -0,0 +1,45 @@
.. _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 Seed 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
***********

Set ``-DSHIELD=adafruit_neopixel_grid_bff`` when you invoke ``west build``. For example:

.. zephyr-app-commands::
:zephyr-app: samples/drivers/les_ws2812
:board: adafruit_qt_py_rp2040
:shield: adafruit_neopixel_grid_bff
:goals: build

.. _Adafruit 5x5 NeoPixel Grid BFF:
https://learn.adafruit.com/adafruit-5x5-neopixel-grid-bff/

0 comments on commit 1ba9845

Please sign in to comment.