Adafruit NeoPXL8 Arduino Library
8-way concurrent DMA NeoPixel library for SAMD21, SAMD51,

RP2040 and ESP32S3 microcontrollers.

Introduction

Adafruit_NeoPXL8 is an Arduino library that leverages hardware features unique to some Atmel SAMD21 and SAMD51 microcontrollers, plus the Raspberry Pi RP2040 and Espressif ESP32S3 (not S2, etc.) chips, to communicate with large numbers of NeoPixels with very low CPU utilization and without losing track of time. It was originally designed for the Adafruit Feather M0 board with NeoPXL8 FeatherWing interface/adapter, but may be applicable to other situations (e.g. Arduino Zero, Adafruit Metro M0, etc., using logic level-shifting as necessary). A different FeatherWing with pinout specific to the Feather M4 is also available.

NeoPXL8 FeatherWing M0: https://www.adafruit.com/product/3249 NeoPXL8 FeatherWing M4: https://www.adafruit.com/product/4537

Because the SAMD21 does not provide GPIO DMA, the code instead makes use of the "pattern generator" peripheral for its 8 concurrent outputs. Due to pin/peripheral multiplexing constraints, most outputs are limited to SPECIFIC PINS or provide at most ONE ALTERNATE pin selection. See the example code for details. The payoff is that this peripheral handles the NeoPixel data transfer while the CPU is entirely free to render the next frame (and interrupts can remain enabled – millis()/micros() don't lose time, and soft PWM (for servos, etc.) still operate normally).

Additionally, NeoPXL8 has nondestructive brightness scaling...unlike classic NeoPixel, getPixelColor() here always returns the original value as was passed to setPixelColor().

Adafruit_NeoPXL8HDR is a subclass of Adafruit_NeoPXL8 adding 16-bits- per-channel color support, temporal dithering, frame blending and gamma correction. This requires inordinate RAM, and the frequent need for refreshing makes it best suited for multi-core chips (e.g. RP2040).

RP2040 support requires Philhower core (not Arduino mbed core). Also on RP2040, pin numbers passed to constructor are GP## indices, not necessarily the digital pin numbers silkscreened on the board.

0/1 bit timing does not precisely match NeoPixel/WS2812/SK6812 datasheet specs, but it seems to work well enough. Use at your own peril.

Some of the more esoteric NeoPixel functions are not implemented here, so THIS IS NOT A 100% DROP-IN REPLACEMENT for all NeoPixel code right now.

Adafruit invests time and resources providing this open source code, please support Adafruit and open-source hardware by purchasing products from Adafruit!

Dependencies

This library depends on Adafruit_NeoPixel and (for SAMD chips) Adafruit_ZeroDMA being present on your system. Please make sure you have installed the latest versions before using this library.

Author

Written by Phil "Paint Your Dragon" Burgess for Adafruit Industries.

License

MIT license, all text here must be included in any redistribution.