Adafruit_NeoPXL8 is a subclass of Adafruit_NeoPixel containing buffers for DMA-formatted 8-way concurrent output. Once a transfer is initiated, the original NeoPixel data can then be modified for the next frame while the transfer operates in the background.
More...
#include <Adafruit_NeoPXL8.h>
|
| Adafruit_NeoPXL8 (uint16_t n, int8_t *p=NULL, neoPixelType t=NEO_GRB) |
| NeoPXL8 constructor. Instantiates a new NeoPXL8 object (must follow with a begin() call to alloc buffers and init hardware). More...
|
|
bool | begin (bool dbuf=false) |
| Allocate buffers and initialize hardware for NeoPXL8 output. More...
|
|
void | show (void) |
| Process and issue new data to the NeoPixel strands.
|
|
void | stage (void) |
| Preprocess NeoPixel data into DMA-ready format, but do not issue to strands yet. Esoteric but potentially useful if aiming to have pixels refresh at precise intervals (since preprocessing is not deterministic) – e.g. 60 Hz – follow with a call to show() when the actual data transfer is to occur.
|
|
bool | canShow (void) const |
| Poll whether last show() transfer has completed and library is idle. Of questionable utility, but provided for compatibility with similarly questionable function in the NeoPixel library. More...
|
|
bool | canStage (void) const |
| Poll whether last show() data transfer has completed, but not necessarily the end-of-data latch. This is the earliest moment at which one can stage() the next frame of data. More...
|
|
void | setBrightness (uint8_t b) |
| Set strip brightness for subsequent show() calls. Unlike the Adafruit_NeoPixel library, this function is non-destructive – original color values passed to setPixelColor() will always be accurately returned by getPixelColor(), even if brightness is adjusted. More...
|
|
uint8_t | getBrightness (void) const |
| Query brightness value last assigned with setBrightness(). More...
|
|
void | setLatchTime (uint16_t us=300) |
| Change the NeoPixel end-of-data latch period. Here be dragons. More...
|
|
|
Adafruit_ZeroDMA | dma |
| DMA object.
|
|
DmacDescriptor * | desc |
| DMA descriptor pointer.
|
|
uint8_t * | allocAddr |
| Allocated buffer into which dmaBuf points.
|
|
uint32_t * | alignedAddr [2] |
| long-aligned ptrs into dmaBuf
|
|
int8_t | pins [8] |
| Pin list for 8 NeoPixel strips.
|
|
uint8_t | bitmask [8] |
| Pattern generator bitmask for each pin.
|
|
uint8_t * | dmaBuf [2] = {NULL, NULL} |
| Buffer for pixel data + any extra.
|
|
uint16_t | brightness = 255 |
| Brightness (stored 1-256, not 0-255)
|
|
bool | staged |
| If set, data is ready for DMA trigger.
|
|
uint16_t | latchtime = 300 |
| Pixel data latch time, microseconds.
|
|
uint8_t | dbuf_index = 0 |
| 0/1 DMA buffer index
|
|
Adafruit_NeoPXL8 is a subclass of Adafruit_NeoPixel containing buffers for DMA-formatted 8-way concurrent output. Once a transfer is initiated, the original NeoPixel data can then be modified for the next frame while the transfer operates in the background.
◆ Adafruit_NeoPXL8()
Adafruit_NeoPXL8::Adafruit_NeoPXL8 |
( |
uint16_t |
n, |
|
|
int8_t * |
p = NULL , |
|
|
neoPixelType |
t = NEO_GRB |
|
) |
| |
NeoPXL8 constructor. Instantiates a new NeoPXL8 object (must follow with a begin() call to alloc buffers and init hardware).
- Parameters
-
n | Length of each NeoPixel strand (total number of pixels will be 8X this). |
p | Optional int8_t array of eight pin numbers for NeoPixel strands 0-7. There are specific hardware limitations as to which pins can be used, see the example sketch. If fewer than 8 outputs are needed, assign a value of -1 to the unused outputs, keeping in mind that this will always still use the same amount of memory as 8-way output. If unspecified (or if NULL is passed), a default 8-pin setup will be used (see example sketch). On RP2040 and RP235x, these are GP## numbers, not necessarily the digital pin numbers silkscreened on the board. |
t | NeoPixel color data order, same as in Adafruit_NeoPixel library (optional, default is GRB). |
◆ begin()
bool Adafruit_NeoPXL8::begin |
( |
bool |
dbuf = false | ) |
|
Allocate buffers and initialize hardware for NeoPXL8 output.
- Parameters
-
dbuf | If true, 2X DMA buffers are allocated so that a frame can be staged while the prior is in mid-transfer. Might yield slightly improved frame rates in some cases, others just waste RAM. Super esoteric and mostly for NeoPXL8HDR's use. Currently ignored on SAMD. |
- Returns
- true on successful alloc/init, false otherwise.
◆ canShow()
bool Adafruit_NeoPXL8::canShow |
( |
void |
| ) |
const |
Poll whether last show() transfer has completed and library is idle. Of questionable utility, but provided for compatibility with similarly questionable function in the NeoPixel library.
- Returns
- true if show() can be called without blocking, false otherwise.
◆ canStage()
bool Adafruit_NeoPXL8::canStage |
( |
void |
| ) |
const |
Poll whether last show() data transfer has completed, but not necessarily the end-of-data latch. This is the earliest moment at which one can stage() the next frame of data.
- Returns
- true if stage() can safely be called, false otherwise.
◆ setBrightness()
void Adafruit_NeoPXL8::setBrightness |
( |
uint8_t |
b | ) |
|
|
inline |
Set strip brightness for subsequent show() calls. Unlike the Adafruit_NeoPixel library, this function is non-destructive – original color values passed to setPixelColor() will always be accurately returned by getPixelColor(), even if brightness is adjusted.
- Parameters
-
b | Brightness, from 0 (off) to 255 (maximum). |
◆ getBrightness()
uint8_t Adafruit_NeoPXL8::getBrightness |
( |
void |
| ) |
const |
|
inline |
Query brightness value last assigned with setBrightness().
- Returns
- Brightness, from 0 (off) to 255 (maximum).
◆ setLatchTime()
void Adafruit_NeoPXL8::setLatchTime |
( |
uint16_t |
us = 300 | ) |
|
|
inline |
Change the NeoPixel end-of-data latch period. Here be dragons.
- Parameters
-
us | Latch time in microseconds. Different manufacturers and generations of pixels may have different end-of-data latch periods. For example, early WS2812 pixels recommend a 50 uS latch, late-model WS2812Bs suggest 300 (the default value). A shorter latch may allow very slightly faster refresh rates (a few percent at best – strand length is a much bigger influence). Check datasheet for your specific pixels to get a recommended figure, then you can try empirically dialing down from there, with the understanding that this change may not work with other pixels. What you ABSOLUTELY MUST NOT DO is rely on the bare minimum value that works on your bench, because addressable LEDs are affected by environmental factors like temperature; an installation relying on a bare- minimum figure WILL fail when relocated, e.g. Burning Man. ALWAYS allow a generous overhead. Better yet, don't mess with it. |
The documentation for this class was generated from the following files: