boards: shields: Adding Adafruit 5x5 RGB BFF
This is a 5x5 grid of WS2812 RGB LEDs. Signed-off-by: Ian Wakely <raveious.irw@gmail.com>
This commit is contained in:
parent
afc7c20d5a
commit
96d9390f5e
|
@ -0,0 +1,4 @@
|
|||
# Copyright (c) 2024 Ian Wakely
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
# Intentionally left blank.
|
5
boards/shields/adafruit_neopixel_grid_bff/Kconfig.shield
Normal file
5
boards/shields/adafruit_neopixel_grid_bff/Kconfig.shield
Normal file
|
@ -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,2 @@
|
|||
CONFIG_LED_STRIP=y
|
||||
CONFIG_WS2812_STRIP=y
|
|
@ -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;
|
||||
};
|
||||
};
|
|
@ -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";
|
||||
gpios = <&xiao_d 3 GPIO_ACTIVE_HIGH>;
|
||||
chain-length = <25>;
|
||||
color-mapping = <LED_COLOR_ID_GREEN
|
||||
LED_COLOR_ID_RED
|
||||
LED_COLOR_ID_BLUE>;
|
||||
reset-delay = <280>;
|
||||
frequency = <800000>;
|
||||
};
|
||||
};
|
||||
};
|
Binary file not shown.
After Width: | Height: | Size: 42 KiB |
69
boards/shields/adafruit_neopixel_grid_bff/doc/index.rst
Normal file
69
boards/shields/adafruit_neopixel_grid_bff/doc/index.rst
Normal file
|
@ -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/
|
Loading…
Reference in a new issue