Skip to main content

PerKeyLightingFeature

Struct PerKeyLightingFeature 

Source
pub struct PerKeyLightingFeature { /* private fields */ }
Expand description

Implements the PerKeyLighting / 0x8081 feature.

Implementations§

Source§

impl PerKeyLightingFeature

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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

Source§

fn clone(&self) -> PerKeyLightingFeature

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl CreatableFeature for PerKeyLightingFeature

Source§

const ID: u16 = 0x8081

The protocol ID of the implemented feature.
Source§

const STARTING_VERSION: u8 = 0

The version of the feature the implementation starts to support.
Source§

fn new(chan: Arc<HidppChannel>, device_index: u8, feature_index: u8) -> Self

Creates a new instance of the feature implementation.
Source§

impl Feature for PerKeyLightingFeature

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more