pub struct PerKeyLightingFeature { /* private fields */ }Expand description
Implements the PerKeyLighting / 0x8081 feature.
Implementations§
Source§impl PerKeyLightingFeature
impl PerKeyLightingFeature
Sourcepub async fn get_rgb_zone_presence(
&self,
page: ZonePresencePage,
) -> Result<[u8; 14], Hidpp20Error>
pub async fn get_rgb_zone_presence( &self, page: ZonePresencePage, ) -> Result<[u8; 14], Hidpp20Error>
Retrieves a page of the RGB zone-presence bitfield.
The returned 14 bytes form a 112-bit field; bit i (LSB-first within each
byte) reports whether the zone at page base + i is present.
Sourcepub async fn set_individual_rgb_zones(
&self,
zones: &[RgbZone],
) -> Result<(), Hidpp20Error>
pub async fn set_individual_rgb_zones( &self, zones: &[RgbZone], ) -> Result<(), Hidpp20Error>
Sets up to four individually addressed zones.
At most four zones are sent; extra entries are ignored.
Sourcepub async fn set_consecutive_rgb_zones(
&self,
first_zone_id: u8,
colors: [Rgb; 5],
) -> Result<(), Hidpp20Error>
pub async fn set_consecutive_rgb_zones( &self, first_zone_id: u8, colors: [Rgb; 5], ) -> Result<(), Hidpp20Error>
Sets five consecutive zones starting at first_zone_id.
Sourcepub async fn set_consecutive_rgb_zones_delta_5bit(
&self,
first_zone_id: u8,
packed: [u8; 15],
) -> Result<(), Hidpp20Error>
pub async fn set_consecutive_rgb_zones_delta_5bit( &self, first_zone_id: u8, packed: [u8; 15], ) -> Result<(), Hidpp20Error>
Sets eight consecutive zones from first_zone_id using 5-bit signed
per-channel deltas.
packed carries the 8×3 5-bit deltas packed MSB-first, zone-by-zone then
channel-by-channel, exactly as defined by the feature spec; this wrapper
transmits it verbatim.
Sourcepub async fn set_consecutive_rgb_zones_delta_4bit(
&self,
first_zone_id: u8,
packed: [u8; 15],
) -> Result<(), Hidpp20Error>
pub async fn set_consecutive_rgb_zones_delta_4bit( &self, first_zone_id: u8, packed: [u8; 15], ) -> Result<(), Hidpp20Error>
Sets ten consecutive zones from first_zone_id using 4-bit signed
per-channel deltas.
packed carries the 10×3 4-bit signed deltas, two per byte (high nibble
first), as defined by the feature spec; this wrapper transmits it verbatim.
Sourcepub async fn set_range_rgb_zones(
&self,
ranges: &[RgbZoneRange],
) -> Result<(), Hidpp20Error>
pub async fn set_range_rgb_zones( &self, ranges: &[RgbZoneRange], ) -> Result<(), Hidpp20Error>
Sets up to three independent ranges, each filled with one color.
At most three ranges are sent; extra entries are ignored.
Sourcepub async fn set_rgb_zones_single_value(
&self,
color: Rgb,
zone_ids: &[u8],
) -> Result<(), Hidpp20Error>
pub async fn set_rgb_zones_single_value( &self, color: Rgb, zone_ids: &[u8], ) -> Result<(), Hidpp20Error>
Applies one color to up to thirteen individually addressed zones.
At most thirteen zone IDs are sent; extra entries are ignored.
Sourcepub async fn frame_end(
&self,
persistence: FramePersistence,
current_frame: u16,
frames_till_next_change: u16,
) -> Result<(), Hidpp20Error>
pub async fn frame_end( &self, persistence: FramePersistence, current_frame: u16, frames_till_next_change: u16, ) -> Result<(), Hidpp20Error>
Commits all pending zone changes and updates the display.
current_frame and frames_till_next_change drive frame animations; pass
0 for both for a one-shot update.
Trait Implementations§
Source§impl Clone for PerKeyLightingFeature
impl Clone for PerKeyLightingFeature
Source§fn clone(&self) -> PerKeyLightingFeature
fn clone(&self) -> PerKeyLightingFeature
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more