device-envoy-esp 0.1.0

Build ESP32 applications with composable device abstractions
Documentation
// @generated by `cargo check-all`. Do not edit by hand.
//! Module containing [`LedStripGenerated`], the sample struct type generated by
//! the [`led_strip!`](macro@crate::led_strip) macro.
//!
//! Auto-generated.

#[cfg(all(not(doc), not(feature = "host"), target_os = "none"))]
use crate::led_strip;

#[cfg(all(not(doc), not(feature = "host"), target_os = "none"))]
led_strip! {
    LedStripGenerated {
        pin: GPIO2,
        len: 8,
        max_current: crate::led_strip::Current::Milliamps(250),
    }
}

#[cfg(doc)]
/// Sample struct type generated by the [`led_strip!`](macro@crate::led_strip) macro.
///
/// This page exists to show constructor, constants, and trait methods in one
/// place. For narrative examples, see the [`led_strip`](mod@crate::led_strip)
/// module.
///
/// Auto-generated.
pub struct LedStripGenerated;

#[cfg(doc)]
use crate::led_strip::{Frame1d, LedStrip};
#[cfg(doc)]
use crate::Result;

#[cfg(doc)]
impl LedStripGenerated {
    /// Number of pixels in this strip.
    pub const LEN: usize = 8;
    /// Maximum number of animation frames.
    pub const MAX_FRAMES: usize = 16;
    /// Maximum brightness after current limiting.
    pub const MAX_BRIGHTNESS: u8 = crate::led_strip::Current::Milliamps(250).max_brightness(8 * 60);

    /// Create a new LED strip instance of the struct type defined by
    /// [`led_strip!`](macro@crate::led_strip).
    ///
    /// See the [`led_strip`](mod@crate::led_strip) module docs for usage
    /// examples.
    pub fn new(
        pin: impl Sized,
        channel_creator: impl Sized,
        spawner: embassy_executor::Spawner,
    ) -> Result<&'static Self> {
        static INSTANCE: LedStripGenerated = LedStripGenerated;
        let _ = (pin, channel_creator, spawner);
        Ok(&INSTANCE)
    }
}

#[cfg(doc)]
impl LedStrip<8> for LedStripGenerated {
    const LEN: usize = Self::LEN;
    const MAX_FRAMES: usize = Self::MAX_FRAMES;
    const MAX_BRIGHTNESS: u8 = Self::MAX_BRIGHTNESS;

    fn write_frame(&self, frame: Frame1d<8>) {
        let _ = frame;
    }

    fn animate<I>(&self, frames: I)
    where
        I: IntoIterator,
        I::Item: core::borrow::Borrow<(Frame1d<8>, embassy_time::Duration)>,
    {
        let _ = frames;
    }
}