FastLED 3.9.15
Loading...
Searching...
No Matches
fl::third_party::ezWS2812gpio Class Reference

Detailed Description

ezWS2812 GPIO driver for WS2812 LEDs

This driver uses direct GPIO manipulation with precise timing to generate WS2812 signals. Optimized for 39MHz and 78MHz CPUs.

Hardware Requirements:

  • Any GPIO pin can be used
  • Interrupts are disabled during transmission
  • CPU frequency must be 39MHz or 78MHz for accurate timing

Usage:

ezWS2812gpio leds(60, 7); // 60 LEDs on pin 7
leds.begin();
leds.set_all(0, 255, 0); // All green
leds.end_transfer();
fl::CRGB leds[NUM_LEDS]
ezWS2812gpio(uint16_t num_leds, uint8_t pin)
Constructor.
Definition ezWS2812.h:271

Definition at line 173 of file ezWS2812.h.

#include <ezWS2812.h>

Public Member Functions

 ezWS2812gpio (uint16_t num_leds, uint8_t pin)
 Constructor.
 
void begin ()
 Initialize GPIO pin.
 
void end ()
 End communication.
 
void end_transfer ()
 Complete LED data transfer.
 
void set_all (uint8_t red, uint8_t green, uint8_t blue)
 Set all LEDs to the same color.
 
void set_brightness (uint8_t brightness)
 Set brightness (0-100%)
 
void set_pixel (uint8_t red, uint8_t green, uint8_t blue, uint16_t count=1)
 Set color for specific number of LEDs.
 

Private Member Functions

void send_bit (bool bit_value) const
 Send a single bit using precise timing.
 
void send_byte (uint8_t byte_value) const
 Send a byte (8 bits) with MSB first.
 

Private Attributes

uint8_t brightness_
 
uint16_t num_leds_
 
uint8_t pin_
 
uint32_t pin_mask_
 
volatile uint32_tport_clear_
 
volatile uint32_tport_set_
 

The documentation for this class was generated from the following file: