FastLED 3.9.15
Loading...
Searching...
No Matches
ezws2812 Directory Reference
+ Directory dependency graph for ezws2812:

Files

 ezWS2812.h
 

Detailed Description

This directory contains the ezWS2812 driver from Silicon Labs, adapted for use with FastLED.

Origin

Based on the Silicon Labs ezWS2812 library version 2.2.0 by Tamas Jozsi.

Purpose

Provides optimized WS2812 LED control for Silicon Labs EFR32MG24 series microcontrollers, including:

Available Controllers

1. EZWS2812_GPIO (Always Available)

2. EZWS2812_SPI (Optional)

Usage

GPIO Controller (Default)

#include <FastLED.h>
void setup() {
// GPIO-based controller on pin 7
FastLED.addLeds<EZWS2812_GPIO, 7, GRB>(leds, NUM_LEDS);
}
void setup()
#define NUM_LEDS
fl::CRGB leds[NUM_LEDS]
FL_DISABLE_WARNING_PUSH FL_DISABLE_WARNING_GLOBAL_CONSTRUCTORS CFastLED FastLED
Global LED strip management instance.
constexpr EOrder GRB
Definition eorder.h:19
fl::CRGB CRGB
Definition crgb.h:25

SPI Controller (Optional)

// IMPORTANT: Define this BEFORE including FastLED.h
#define FASTLED_USES_EZWS2812_SPI
#include <FastLED.h>
void setup() {
// SPI-based controller (uses hardware SPI)
FastLED.addLeds<EZWS2812_SPI, GRB>(leds, NUM_LEDS);
}

Why SPI Requires Opt-In

The SPI controller consumes a hardware SPI peripheral, which may be needed for other purposes in your project (SD cards, displays, sensors, etc.). Following the same pattern as ObjectFLED for Teensy, the SPI controller must be explicitly enabled to prevent accidentally consuming the SPI peripheral.

Define Summary

Technical Details

GPIO Controller

SPI Controller

License

MIT License (see ezWS2812.h for full text) Copyright (c) 2024 Silicon Laboratories Inc.