Skip to main content

Timing

Struct Timing 

Source
pub struct Timing {
    pub time_0_low: u16,
    pub time_0_high: u16,
    pub time_1_low: u16,
    pub time_1_high: u16,
    pub reset_us: u16,
}
Expand description

Defines the timing for a certain smart LED type.

All common smart LEDs are controlled by sending PWM-like pulses, in two different configurations for high and low. The required timings (and tolerances) can be found in the relevant datasheets.

Provided timings: SK68XX_TIMING, WS2812B_TIMING, WS2811_TIMING, WS2812_TIMING.

Fields§

§time_0_low: u16

Low time for zero pulse, in nanoseconds.

§time_0_high: u16

High time for zero pulse, in nanoseconds.

§time_1_low: u16

Low time for one pulse, in nanoseconds.

§time_1_high: u16

High time for one pulse, in nanoseconds.

§reset_us: u16

Time for the reset that is required in between transmissions, in microseconds. Depending on the rmt’s frequency, it can have a maximum of ~800us at 80mhz, ~2000us at 32mhz, etc.

The calculation is: max_reset_pulse_us = 0xfffe / rmt_freq_mhz. 0xfffe(= 0x7fff * 2) is the max amount of ticks in a single PulseCode.

Implementations§

Source§

impl Timing

Source

pub const fn with_reset_us(self, reset_us: u16) -> Self

Returns this timing configuration with the provided reset time. Different revisions of the same led might have different reset times, this is the reason behind this function.

Trait Implementations§

Source§

impl Clone for Timing

Source§

fn clone(&self) -> Timing

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 Copy for Timing

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> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.