Enum Capability

Source
#[repr(u8)]
pub enum Capability {
Show 22 variants NoOp { state: CapabilityState, loop_condition_index: u16, }, Rotate { state: CapabilityState, loop_condition_index: u16, index: u8, increment: i8, }, LayerClear { state: CapabilityState, loop_condition_index: u16, }, LayerState { state: CapabilityState, loop_condition_index: u16, layer: u8, layer_state: State, }, LayerRotate { state: CapabilityState, loop_condition_index: u16, direction: Direction, }, HidProtocol { state: CapabilityState, loop_condition_index: u16, mode: Protocol, }, HidKeyboard { state: CapabilityState, loop_condition_index: u16, id: Keyboard, }, HidKeyboardState { state: CapabilityState, loop_condition_index: u16, id: Keyboard, key_state: State, }, HidConsumerControl { state: CapabilityState, loop_condition_index: u16, id: ConsumerControl, }, HidSystemControl { state: CapabilityState, loop_condition_index: u16, id: SystemControl, }, McuFlashMode { state: CapabilityState, loop_condition_index: u16, }, PixelAnimationControl { state: CapabilityState, loop_condition_index: u16, mode: AnimationControl, }, PixelAnimationIndex { state: CapabilityState, loop_condition_index: u16, index: u16, }, PixelFadeControl { state: CapabilityState, loop_condition_index: u16, profile: u8, command: FadeCommand, arg: u8, }, PixelFadeLayer { state: CapabilityState, loop_condition_index: u16, layer: u8, }, PixelFadeSet { state: CapabilityState, loop_condition_index: u16, profile: u8, config: u8, period: u8, }, PixelGammaControl { state: CapabilityState, loop_condition_index: u16, mode: GammaControl, }, PixelLedControl { state: CapabilityState, loop_condition_index: u16, mode: LedControl, amount: u8, }, PixelTest { state: CapabilityState, loop_condition_index: u16, test: PixelTest, index: u16, }, HidioOpenUrl { state: CapabilityState, loop_condition_index: u16, index: u16, }, HidioUnicodeString { state: CapabilityState, loop_condition_index: u16, index: u16, }, HidioUnicodeState { state: CapabilityState, loop_condition_index: u16, unicode: char, },
}
Expand description

Global capability list for KLL NOTE: Changing parameters and removing entries will require a firmware reflash. At worst, KLL file and compiler definitions may also need to be updated. Please avoid these kinds of changes if possible. Adding new entries is safe.

Variants§

§

NoOp

No-op / None action 4 bytes

Fields

§state: CapabilityState

Capability state

§loop_condition_index: u16

Scanning loop condition (number of scanning loops attached to state condition) Lookup index

§

Rotate

Rotation event trigger 6 bytes

Fields

§state: CapabilityState

Capability state

§loop_condition_index: u16

Scanning loop condition (number of scanning loops attached to state condition) Lookup index

§index: u8
§increment: i8
§

LayerClear

Clears all layer states NOTE: Does not send trigger events 4 bytes

Fields

§state: CapabilityState

Capability state

§loop_condition_index: u16

Scanning loop condition (number of scanning loops attached to state condition) Lookup index

§

LayerState

Updates layer to the specified state 6 bytes

Fields

§state: CapabilityState

Capability state

§loop_condition_index: u16

Scanning loop condition (number of scanning loops attached to state condition) Lookup index

§layer: u8
§layer_state: State
§

LayerRotate

Rotates through possible layers given the direction Uses internal state to keep track of the current layer 5 bytes

Fields

§state: CapabilityState

Capability state

§loop_condition_index: u16

Scanning loop condition (number of scanning loops attached to state condition) Lookup index

§direction: Direction
§

HidProtocol

HID Protocol Mode 5 bytes

Fields

§state: CapabilityState

Capability state

§loop_condition_index: u16

Scanning loop condition (number of scanning loops attached to state condition) Lookup index

§

HidKeyboard

USB HID keyboard event Handles press/released based on incoming state 5 bytes

Fields

§state: CapabilityState

Capability state

§loop_condition_index: u16

Scanning loop condition (number of scanning loops attached to state condition) Lookup index

§

HidKeyboardState

USB HID keyboard event Force state event 6 bytes

Fields

§state: CapabilityState

Capability state

§loop_condition_index: u16

Scanning loop condition (number of scanning loops attached to state condition) Lookup index

§key_state: State
§

HidConsumerControl

USB HID Consumer Control Event Handles press/released based on incoming state 6 bytes

Fields

§state: CapabilityState

Capability state

§loop_condition_index: u16

Scanning loop condition (number of scanning loops attached to state condition) Lookup index

§

HidSystemControl

USB HID System Control Event Handles press/released based on incoming state 5 bytes

Fields

§state: CapabilityState

Capability state

§loop_condition_index: u16

Scanning loop condition (number of scanning loops attached to state condition) Lookup index

§

McuFlashMode

Enter Flash Mode Usually jumps to the bootloader 4 bytes

Fields

§state: CapabilityState

Capability state

§loop_condition_index: u16

Scanning loop condition (number of scanning loops attached to state condition) Lookup index

§

PixelAnimationControl

Overall animation control 5 bytes

Fields

§state: CapabilityState

Capability state

§loop_condition_index: u16

Scanning loop condition (number of scanning loops attached to state condition) Lookup index

§

PixelAnimationIndex

Activates the given indexed Animation 6 bytes

Fields

§state: CapabilityState

Capability state

§loop_condition_index: u16

Scanning loop condition (number of scanning loops attached to state condition) Lookup index

§index: u16
§

PixelFadeControl

Fade control 7 bytes

Fields

§state: CapabilityState

Capability state

§loop_condition_index: u16

Scanning loop condition (number of scanning loops attached to state condition) Lookup index

§profile: u8
§command: FadeCommand
§arg: u8
§

PixelFadeLayer

Layer fade 5 bytes

Fields

§state: CapabilityState

Capability state

§loop_condition_index: u16

Scanning loop condition (number of scanning loops attached to state condition) Lookup index

§layer: u8
§

PixelFadeSet

Fade set profile 7 bytes

Fields

§state: CapabilityState

Capability state

§loop_condition_index: u16

Scanning loop condition (number of scanning loops attached to state condition) Lookup index

§profile: u8
§config: u8
§period: u8
§

PixelGammaControl

Enable/Disable/Toggle gamma correction 5 bytes

Fields

§state: CapabilityState

Capability state

§loop_condition_index: u16

Scanning loop condition (number of scanning loops attached to state condition) Lookup index

§

PixelLedControl

LED Control 6 bytes

Fields

§state: CapabilityState

Capability state

§loop_condition_index: u16

Scanning loop condition (number of scanning loops attached to state condition) Lookup index

§amount: u8
§

PixelTest

Pixel test 7 bytes

Fields

§state: CapabilityState

Capability state

§loop_condition_index: u16

Scanning loop condition (number of scanning loops attached to state condition) Lookup index

§index: u16
§

HidioOpenUrl

Sends URL (using index stored unicode string) to host computer web browser 6 bytes

Fields

§state: CapabilityState

Capability state

§loop_condition_index: u16

Scanning loop condition (number of scanning loops attached to state condition) Lookup index

§index: u16
§

HidioUnicodeString

Sends Unicode string (using index stored unicode string) to host computer 6 bytes

Fields

§state: CapabilityState

Capability state

§loop_condition_index: u16

Scanning loop condition (number of scanning loops attached to state condition) Lookup index

§index: u16
§

HidioUnicodeState

Sends Unicode character with state (Press or Release) 8 bytes

Fields

§state: CapabilityState

Capability state

§loop_condition_index: u16

Scanning loop condition (number of scanning loops attached to state condition) Lookup index

§unicode: char

Implementations§

Source§

impl Capability

Source

pub fn generate( &self, event: TriggerEvent, _loop_condition_lookup: &[u32], ) -> CapabilityRun

Generate a CapabilityRun using a Capability + TriggerEvent The TriggerEvent is only important when CapabilityState::Passthrough is set.

Source

pub fn loop_condition_index(&self) -> u16

Lookup loop_condition_index

Source§

impl Capability

Source

pub const unsafe fn bytes(&self) -> &[u8]

Convert enum to an array of bytes

§Safety
Source

pub const unsafe fn from_byte_array(bytes: [u8; 8]) -> Self

Convert array of bytes to enum

§Safety
Source

pub const unsafe fn from_bytes(bytes: &[u8]) -> Self

Convert slice of bytes to enum Aggressively casts the provide u8 slice to retrieve a Capability

§Safety

Trait Implementations§

Source§

impl Clone for Capability

Source§

fn clone(&self) -> Capability

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Capability

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<Capability> for CapabilityRun

Convert Capability to CapabilityRun Used for mainly for kll validation

Source§

fn from(cap: Capability) -> Self

Converts to this type from the input type.
Source§

impl Hash for Capability

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for Capability

Source§

fn eq(&self, other: &Capability) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

const fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for Capability

Source§

impl Eq for Capability

Source§

impl StructuralPartialEq for Capability

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, 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.