OpenLogi

0x8070 · colorLedEffects

Per-zone RGB effect engine — enumerate LED zones and their supported effects, apply effects with configurable persistence, and synchronize timing with the host.

The per-zone RGB effect engine used by Logitech keyboards and mice. A device exposes one or more LED zones (primary, logo, left/right side, …); each zone independently supports a set of effects such as fixed color, breathing, color wave, starlight, or ripple. get_info reports the zone count and capability bitmasks; get_zone_info and get_zone_effect_info enumerate each zone's physical location and the effects it supports. An effect is applied with set_zone_effect, which accepts ten effect-specific parameter bytes (e.g. R, G, B for FixedColor) and a Persistence value choosing between RAM-only or EEPROM storage. get_sw_control / set_sw_control hand the LED engine to software or back to firmware; when sync events are enabled the device emits a SyncEffect event each period, allowing timing drift to be corrected via synchronize_effect.

  • EffectIdDisabled, FixedColor, PulsingBreathingLegacy, Cycling, ColorWave, Starlight, LightOnPress, PulsingBreathingWaveform, Ripple, and more.
  • LocationEffectPrimary, Logo, LeftSide, RightSide, Combined, or per-numbered primary zones (Primary1Primary6).
  • PersistenceVolatile (RAM only, lost on power cycle), VolatileAndNonVolatile (RAM + EEPROM), NonVolatileOnly (EEPROM only).
  • ExtCapabilities — feature flags read from get_info: GET_ZONE_EFFECT, NO_GET_EFFECT_SETTINGS, SET_LED_BIN_INFO, MONOCHROME_ONLY, NO_SYNCHRONIZE_EFFECT.

Spec: Logitech HID++ 2.0 — colorLedEffects. Used by: Typed wrapper in openlogi-hidpp.

Function reference

The ColorLedEffectsFeature wrapper (0x8070) exposes:

Methods

FunctionHID++ fnSignatureReturns
get_info0()ColorLedInfo
get_zone_info1(zone_index: u8)ZoneInfo
get_zone_effect_info2(zone_index: u8, zone_effect_index: u8)ZoneEffectInfo
set_zone_effect3(zone_index: u8, zone_effect_index: u8, params: [u8; 10], persistence: Persistence)()
get_nv_config4(capability: NvCapabilities)NvConfig
set_nv_config5(capability: NvCapabilities, state: NvCapabilityState, param1: u8, param2: u8)()
get_led_bin_info6(zone_index: u8, led_bin_index: LedBinIndex)LedBinInfo
get_sw_control7()SwControlState
set_sw_control8(control: SwControl, sync_events: bool)()
get_effect_settings9(zone_index: u8, source: PersistenceSource)EffectSettings
clear_effect_settings10(zone_index: u8)()
set_cycling_direction11(direction: CyclingDirection)()
get_current_color12(zone_index: u8)Rgb
synchronize_effect13(zone_index: u8, drift_value: i16)()
get_zone_effect14(zone_index: u8, source: PersistenceSource)ZoneEffect
set_led_bin_info15(info: &LedBinInfo)LedBinInfo
listen()async_channel::Receiver<ColorLedEffectsEvent>

All async fn methods return Result<_, Hidpp20Error>. listen is synchronous and returns a channel receiver for unsolicited events.

Types

ColorLedInfo

General feature information returned by get_info.

FieldTypeDescription
zone_countu8Number of LED zones.
nv_capabilitiesNvCapabilitiesSupported non-volatile capabilities.
ext_capabilitiesExtCapabilitiesExtended capabilities.

ZoneInfo

Information about one zone, returned by get_zone_info.

FieldTypeDescription
zone_indexu8Index of the zone.
locationLocationEffectPhysical location the zone covers.
effects_numberu8Number of effects the zone supports.
persistencyPersistencyCapabilitiesPersistency capabilities of the zone.

ZoneEffectInfo

Information about one effect of a zone, returned by get_zone_effect_info.

FieldTypeDescription
zone_indexu8Index of the zone.
zone_effect_indexu8Index of the effect within the zone.
effect_idEffectIdThe effect type.
effect_capabilitiesu16Effect capability bitmask (meaning depends on effect_id).
effect_periodu16Effect period in milliseconds, or 0 when not available.

ZoneEffect

The configured effect of a zone, returned by get_zone_effect.

FieldTypeDescription
zone_indexu8Index of the zone.
zone_effect_indexu8Index of the configured effect within the zone.
params[u8; 10]The effect parameters (meaning depends on the effect's EffectId).

EffectSettings

Effect settings of a zone, returned by get_effect_settings.

FieldTypeDescription
zone_indexu8Index of the zone.
colorRgbEffect color.
periodu16Effect period in milliseconds.
brightnessu8Effect brightness.
paramu8Effect-specific parameter.

SwControlState

Software-control state, returned by get_sw_control.

FieldTypeDescription
controlSwControlWhether firmware or software owns the LEDs.
sync_eventsboolWhether the device emits sync-effect events.

NvConfig

A non-volatile configuration entry, returned by get_nv_config.

FieldTypeDescription
capabilityNvCapabilitiesThe single capability bit this entry addresses.
stateNvCapabilityStateThe capability's state.
param1u8First capability-specific parameter.
param2u8Second capability-specific parameter.

LedBinInfo

Manufacturing LED bin information, returned by get_led_bin_info / set_led_bin_info.

FieldTypeDescription
zone_indexu8Index of the zone.
led_bin_indexLedBinIndexWhich bin parameter this is.
redu16Red bin value.
greenu16Green bin value.
blueu16Blue bin value.
whiteu16White bin value.

Rgb

An 8-bit-per-channel RGB color.

FieldTypeDescription
redu8Red channel.
greenu8Green channel.
blueu8Blue channel.

EffectId

Identifies the type of a zone effect.

VariantValueDescription
Disabled0No effect / LEDs off.
FixedColor1A fixed single color.
PulsingBreathingLegacy2Legacy pulsing/breathing effect.
Cycling3Color cycling through the color wheel.
ColorWave4A traveling color wave.
Starlight5Twinkling "starlight" effect.
LightOnPress6Light up keys on press.
AudioVisualizer7Audio visualizer (reserved).
BootUp8Boot-up effect.
DemoMode9Demo mode.
PulsingBreathingWaveform10Pulsing/breathing with a selectable waveform.
Ripple11Ripple effect.

LocationEffect

The physical location a zone covers.

VariantValueDescription
Primary1The primary zone.
Logo2The logo.
LeftSide3The left side.
RightSide4The right side.
Combined5A combined zone.
Primary16Primary zone 1.
Primary27Primary zone 2.
Primary38Primary zone 3.
Primary49Primary zone 4.
Primary510Primary zone 5.
Primary611Primary zone 6.

Persistence

Storage persistence for set_zone_effect.

VariantValueDescription
Volatile0Volatile: applied to RAM only, lost on power cycle.
VolatileAndNonVolatile1Applied to RAM and stored in EEPROM.
NonVolatileOnly2Stored in EEPROM only.

PersistenceSource

Which storage a read function should read from.

VariantValueDescription
Ram0The actively playing configuration in RAM.
Eeprom1The saved configuration in EEPROM.

SwControl

Whether the firmware or software owns the LEDs.

VariantValueDescription
Firmware0The firmware owns all LEDs.
Software1Software owns all LEDs.

CyclingDirection

Direction of color cycling.

VariantValueDescription
Clockwise0Clockwise through the color wheel.
Anticlockwise1Anticlockwise through the color wheel.

LedBinIndex

Selects which LED bin parameter a get_led_bin_info / set_led_bin_info call addresses.

VariantValueDescription
BinValueBrightness0Bin value: brightness.
BinValueColor1Bin value: color.
CalibrationFactors2Calibration factors.
Brightness3Brightness.
ColorimetricX4Colorimetric X.
ColorimetricY5Colorimetric Y.

NvCapabilityState

State of a non-volatile configuration capability.

VariantValueDescription
NoChange0The stored value has never been explicitly set (read-only sentinel, enabled assumed).
Enabled1The capability is enabled.
Disabled2The capability is disabled.

NvCapabilities

Supported non-volatile configuration capabilities, from get_info.

FlagBit/ValueDescription
BOOT_UP_EFFECT1 << 0A boot-up effect can be configured.
DEMO1 << 1Demo mode is supported.
USER_DEMO_MODE1 << 2User demo mode is supported.

ExtCapabilities

Extended capabilities from get_info. Several flags are "NOT supported" flags whose set state removes a function.

FlagBit/ValueDescription
GET_ZONE_EFFECT1 << 0getZoneEffect is supported.
NO_GET_EFFECT_SETTINGS1 << 1getEffectSettings is not supported.
SET_LED_BIN_INFO1 << 2setLedBinInfo is supported.
MONOCHROME_ONLY1 << 3Only monochrome effects are supported.
NO_SYNCHRONIZE_EFFECT1 << 4synchronizeEffect and the sync-effect event are not supported.

PersistencyCapabilities

Persistency capabilities of a zone, from get_zone_info. A value of zero means persistency is not supported.

FlagBit/ValueDescription
ALWAYS_ON1 << 0The zone can persist an "always on" state.
ALWAYS_OFF1 << 1The zone can persist an "always off" state.
ON_THEN_OFF1 << 2The zone can persist an "on then off" state.

Events

ColorLedEffectsFeature implements EmittingFeature<ColorLedEffectsEvent>. Call listen() to receive an async_channel::Receiver<ColorLedEffectsEvent>.

ColorLedEffectsEvent

VariantFieldsDescription
SyncEffectzone_index: u8, effect_counter: u16A period effect reached a synchronization point. Emitted once per period while sync events are enabled. zone_index of 0xff means all zones; effect_counter is the current timing position within the period in milliseconds.

Wire format

Most getters use a 3-byte short request and read a 16-byte long response payload. The four write-heavy functions (set_zone_effect, set_nv_config, synchronize_effect, set_led_bin_info) send a 16-byte long request. All multi-byte fields are big-endian.

get_info (fn 0)

Request: [0x00, 0x00, 0x00]

Response (byte → field):

ByteFieldNotes
0zone_countNumber of LED zones
1–2nv_capabilitiesNvCapabilities bitmask (BE u16)
3–4ext_capabilitiesExtCapabilities bitmask (BE u16)

get_zone_info (fn 1)

Request: [zone_index, 0x00, 0x00]

Response (byte → field):

ByteFieldNotes
0zone_indexEcho
1–2locationLocationEffect as BE u16
3effects_numberNumber of effects this zone supports
4persistencyPersistencyCapabilities bitmask

get_zone_effect_info (fn 2)

Request: [zone_index, zone_effect_index, 0x00]

Response (byte → field):

ByteFieldNotes
0zone_indexEcho
1zone_effect_indexEcho
2–3effect_idEffectId as BE u16
4–5effect_capabilitiesEffect capability bitmask (BE u16)
6–7effect_periodPeriod in ms, 0 if unavailable (BE u16)

set_zone_effect (fn 3)

16-byte long request:

ByteFieldNotes
0zone_index
1zone_effect_index
2–11params10 effect-specific bytes (e.g. R, G, B for FixedColor)
12persistencePersistence as u8
13–15Padding (0x00)

No response body (acknowledges with an empty reply).

get_nv_config (fn 4)

Request: [cap_hi, cap_lo, 0x00]cap_hi:cap_lo is the single-bit NvCapabilities value as BE u16.

Response (byte → field):

ByteFieldNotes
0–1capabilityNvCapabilities bitmask echoed (BE u16)
2stateNvCapabilityState as u8
3param1Capability-specific parameter
4param2Capability-specific parameter

set_nv_config (fn 5)

16-byte long request:

ByteFieldNotes
0–1capabilitySingle-bit NvCapabilities as BE u16
2stateNvCapabilityState as u8
3param1
4param2
5–15Padding (0x00)

No response body.

get_led_bin_info (fn 6)

Request: [zone_index, led_bin_index, 0x00]led_bin_index is LedBinIndex as u8.

Response (byte → field):

ByteFieldNotes
0zone_indexEcho
1led_bin_indexLedBinIndex as u8
2–3redBE u16
4–5greenBE u16
6–7blueBE u16
8–9whiteBE u16

get_sw_control (fn 7)

Request: [0x00, 0x00, 0x00]

Response (byte → field):

ByteFieldNotes
0controlSwControl as u8 (0=Firmware, 1=Software)
1sync_events0x00=false, any other=true

set_sw_control (fn 8)

Request: [control, sync_events_u8, 0x00]control is SwControl as u8; sync_events_u8 is 0 or 1.

No response body.

get_effect_settings (fn 9)

Request: [zone_index, source, 0x00]source is PersistenceSource as u8.

Response (byte → field):

ByteFieldNotes
0zone_indexEcho
1color.red
2color.green
3color.blue
4–5periodEffect period in ms (BE u16)
6brightness
7paramEffect-specific parameter

clear_effect_settings (fn 10)

Request: [zone_index, 0x00, 0x00]

No response body.

set_cycling_direction (fn 11)

Request: [direction, 0x00, 0x00]direction is CyclingDirection as u8 (0=Clockwise, 1=Anticlockwise).

No response body.

get_current_color (fn 12)

Request: [zone_index, 0x00, 0x00]

Response (byte → field):

ByteFieldNotes
0Not used for color
1red
2green
3blue

synchronize_effect (fn 13)

16-byte long request:

ByteFieldNotes
0zone_index0xff = all zones
1Padding (0x00)
2drift_value high bytedrift_value: i16 as BE
3drift_value low byte
4–15Padding (0x00)

No response body. Valid only while sync events are enabled.

get_zone_effect (fn 14)

Request: [zone_index, source, 0x00]source is PersistenceSource as u8.

Response (byte → field):

ByteFieldNotes
0zone_indexEcho
1zone_effect_index
2–11params10 effect-specific bytes

set_led_bin_info (fn 15)

16-byte long request:

ByteFieldNotes
0zone_index
1led_bin_indexLedBinIndex as u8
2–3redBE u16
4–5greenBE u16
6–7blueBE u16
8–9whiteBE u16
10–15Padding (0x00)

Response has the same byte layout as get_led_bin_info (device echoes the written values).

SyncEffect event (event fn 0)

Unsolicited message emitted once per effect period while sync events are enabled.

ByteFieldNotes
0zone_index0xff = all zones
1–2effect_counterTiming position within the period, in ms (BE u16)

Usage (Rust)

use hidpp::{
    device::Device,
    feature::color_led_effects::{
        ColorLedEffectsFeature, Persistence, SwControl,
    },
};

// mut device: Device, already created via Device::new(channel, index).await?
device.enumerate_features().await?;
if let Some(feat) = device.get_feature::<ColorLedEffectsFeature>() {
    // Read overall feature info (zone count, capability flags).
    let info = feat.get_info().await?;
    println!("zones: {}, ext_caps: {:?}", info.zone_count, info.ext_capabilities);

    // Take software control so we can drive the LEDs directly.
    feat.set_sw_control(SwControl::Software, true).await?;

    // Apply a fixed red color to zone 0, stored in RAM only.
    let mut params = [0u8; 10];
    params[0] = 0xff; // R
    params[1] = 0x00; // G
    params[2] = 0x00; // B
    feat.set_zone_effect(0, 0, params, Persistence::Volatile).await?;

    // Listen for sync-effect events to correct timing drift.
    let rx = feat.listen();
    if let Ok(event) = rx.recv().await {
        println!("sync event: {:?}", event);
    }

    // Return LED control to the firmware.
    feat.set_sw_control(SwControl::Firmware, false).await?;
}

On this page