FastLED 3.9.15
Loading...
Searching...
No Matches
ucs7604.h File Reference

Detailed Description

UCS7604 LED chipset controller implementation for FastLED.

The UCS7604 uses a unique preamble-based protocol. This implementation extends ClocklessBlockingGeneric for universal platform support.

Key Implementation Detail: Preamble Encoding

The 15-byte preamble divides perfectly into 5 CRGB pixels: 15 ÷ 3 = 5

  • Chunk 1 (8 bytes) + Chunk 2 (7 bytes) = 15 bytes total
  • 15 bytes ÷ 3 bytes/pixel = 5 pixels exactly (no padding needed!)
  • Transmitted as 5 fake CRGB values reinterpreted from preamble bytes
  • GitHub #2088 confirmed continuous transmission works (no 260µs delays needed)

Current Control

The UCS7604 has 4-bit current control (0x00-0x0F) for each RGBW channel. Define FL_UCS7604_BRIGHTNESS to set the default current control value:

  • 0x0F = Maximum brightness/current (default)
  • 0x00 = Minimum brightness/current This affects all channels (RGBW) unless overridden via setCurrentControl()

Runtime Brightness Control (EXPERIMENTAL)

Use fl::ucs7604::set_brightness(uint8_t) to adjust current control at runtime. This is a hardware-level brightness control (4-bit, 16 levels) and is SECONDARY to FastLED::setBrightness() which should be your primary brightness control.

Note: This uses the current control feature which may affect color accuracy. For best results, use FastLED::setBrightness() for brightness control.

Definition in file ucs7604.h.

+ Include dependency graph for ucs7604.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  fl::UCS7604ControllerT< DATA_PIN, RGB_ORDER, MODE, CHIPSET_TIMING, CLOCKLESS_CONTROLLER >
 UCS7604 controller extending CPixelLEDController. More...
 
class  fl::UCS7604ControllerT< DATA_PIN, RGB_ORDER, MODE, CHIPSET_TIMING, CLOCKLESS_CONTROLLER >::DelegateController
 

Namespaces

namespace  fl
 Base definition for an LED controller.
 
namespace  fl::ucs7604
 UCS7604 runtime brightness control namespace.
 

Macros

#define __INC_UCS7604_H
 
#define FL_UCS7604_BRIGHTNESS   0x0F
 

Typedefs

using fl::ucs7604::CurrentControl = UCS7604CurrentControl
 Type alias for current control (defined in ucs7604_encoder.h)
 
template<int DATA_PIN, EOrder RGB_ORDER, template< int, typename, EOrder > class CLOCKLESS_CONTROLLER>
using fl::UCS7604Controller16bit1600T = UCS7604ControllerT<DATA_PIN, RGB_ORDER, fl::UCS7604Mode::UCS7604_MODE_16BIT_1600KHZ, fl::TIMING_UCS7604_1600KHZ, CLOCKLESS_CONTROLLER>
 
template<int DATA_PIN, EOrder RGB_ORDER, template< int, typename, EOrder > class CLOCKLESS_CONTROLLER>
using fl::UCS7604Controller16bitT = UCS7604ControllerT<DATA_PIN, RGB_ORDER, fl::UCS7604Mode::UCS7604_MODE_16BIT_800KHZ, fl::TIMING_UCS7604_800KHZ, CLOCKLESS_CONTROLLER>
 
template<int DATA_PIN, EOrder RGB_ORDER, template< int, typename, EOrder > class CLOCKLESS_CONTROLLER>
using fl::UCS7604Controller8bitT = UCS7604ControllerT<DATA_PIN, RGB_ORDER, fl::UCS7604Mode::UCS7604_MODE_8BIT_800KHZ, fl::TIMING_UCS7604_800KHZ, CLOCKLESS_CONTROLLER>
 

Functions

CurrentControl fl::ucs7604::brightness ()
 Get current global UCS7604 brightness value.
 
void fl::ucs7604::set_brightness (CurrentControl current)
 Set global UCS7604 brightness via current control (EXPERIMENTAL)
 
void fl::ucs7604::set_brightness (u8 r, u8 g, u8 b, u8 w)
 Set global UCS7604 brightness with individual channel values (EXPERIMENTAL)