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 [`Led2dGenerated`], the sample struct type generated by
//! the [`led2d!`](macro@crate::led2d) macro.
//!
//! Auto-generated.

#[cfg(all(not(doc), not(feature = "host"), target_os = "none"))]
use crate::led2d;
#[cfg(all(not(doc), not(feature = "host"), target_os = "none"))]
const LED_LAYOUT_12X4: crate::led2d::LedLayout<48, 12, 4> =
    crate::led2d::LedLayout::serpentine_column_major();

#[cfg(all(not(doc), not(feature = "host"), target_os = "none", esp_has_rmt))]
led2d! {
    Led2dGenerated {
        pin: GPIO2,
        len: 48,
        led_layout: LED_LAYOUT_12X4,
        max_current: crate::led_strip::Current::Milliamps(250),
        font: crate::led2d::Led2dFont::Font3x4Trim,
    }
}

#[cfg(all(not(doc), not(feature = "host"), target_os = "none", not(esp_has_rmt)))]
led2d! {
    Led2dGenerated {
        pin: GPIO2,
        len: 48,
        led_layout: LED_LAYOUT_12X4,
        max_current: crate::led_strip::Current::Milliamps(250),
        font: crate::led2d::Led2dFont::Font3x4Trim,
        engine: device_envoy_esp::led_strip::Engine::Spi,
    }
}

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

#[cfg(doc)]
use crate::led2d::{Frame2d, Led2d, Led2dFont, Point, Size};
#[cfg(doc)]
use crate::Result;

#[cfg(doc)]
impl Led2dGenerated {
    /// Maximum number of animation frames.
    pub const MAX_FRAMES: usize = 16;
    /// Maximum brightness level after current limiting.
    pub const MAX_BRIGHTNESS: u8 = 22;
    /// Default font used by text helpers.
    pub const FONT: Led2dFont = Led2dFont::Font3x4Trim;
    /// Panel width in pixels.
    pub const WIDTH: usize = 12;
    /// Panel height in pixels.
    pub const HEIGHT: usize = 4;
    /// Total LED count (`WIDTH * HEIGHT`).
    pub const LEN: usize = 48;
    /// Panel dimensions.
    pub const SIZE: Size = Frame2d::<12, 4>::SIZE;
    /// Top-left corner coordinate.
    pub const TOP_LEFT: Point = Frame2d::<12, 4>::TOP_LEFT;
    /// Top-right corner coordinate.
    pub const TOP_RIGHT: Point = Frame2d::<12, 4>::TOP_RIGHT;
    /// Bottom-left corner coordinate.
    pub const BOTTOM_LEFT: Point = Frame2d::<12, 4>::BOTTOM_LEFT;
    /// Bottom-right corner coordinate.
    pub const BOTTOM_RIGHT: Point = Frame2d::<12, 4>::BOTTOM_RIGHT;

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

#[cfg(doc)]
impl Led2d<12, 4> for &'static Led2dGenerated {
    const WIDTH: usize = Led2dGenerated::WIDTH;
    const HEIGHT: usize = Led2dGenerated::HEIGHT;
    const LEN: usize = Led2dGenerated::LEN;
    const SIZE: Size = Led2dGenerated::SIZE;
    const TOP_LEFT: Point = Led2dGenerated::TOP_LEFT;
    const TOP_RIGHT: Point = Led2dGenerated::TOP_RIGHT;
    const BOTTOM_LEFT: Point = Led2dGenerated::BOTTOM_LEFT;
    const BOTTOM_RIGHT: Point = Led2dGenerated::BOTTOM_RIGHT;
    const MAX_FRAMES: usize = Led2dGenerated::MAX_FRAMES;
    const MAX_BRIGHTNESS: u8 = Led2dGenerated::MAX_BRIGHTNESS;
    const FONT: Led2dFont = Led2dGenerated::FONT;

    fn write_frame(&self, frame2d: Frame2d<12, 4>) {
        let _ = frame2d;
    }

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