// @generated by `cargo xtask led-strip-generated` or `cargo check-all`. Do not edit by hand.
//! Module containing [`LedStripGenerated`], the sample struct type generated by the
//! [`led_strip!`](crate::led_strip!) macro.
//!
//! Auto-generated.

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

#[cfg(all(not(doc), not(feature = "host")))]
led_strip! {
    LedStripGenerated {
        pin: PIN_3,
        len: 48,
    }
}

#[cfg(doc)]
/// Sample struct type generated by the [`led_strip!`](crate::led_strip!) macro, showing all methods and constants.
///
/// This page serves as the definitive reference for what a generated LED strip type
/// provides. For first-time readers, start with the examples in the [`led_strip`](mod@crate::led_strip) module
/// documentation, then return here for a complete list of available methods and
/// associated constants.
///
/// Auto-generated.
pub struct LedStripGenerated;

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

#[cfg(doc)]
// Must be public for macro expansion in downstream crates, but not user-facing API.
#[doc(hidden)]
/// Static resources for `LedStripGenerated`.
///
/// See the [`led_strip`](mod@crate::led_strip) module docs for usage.
pub struct LedStripGeneratedStatic {
    led_strip_static: LedStripStatic<48, 16>,
}

#[cfg(doc)]
impl LedStripGenerated {
    /// Number of LEDs in this strip.
    pub const LEN: usize = 48;
    /// Maximum brightness level, automatically limited by the power budget specified in `max_current`.
    ///
    /// We assume each LED draws 60 mA at full brightness. The actual limit depends on
    /// the power budget you specified in the [`led_strip!`](macro@crate::led_strip)
    /// or [`led_strips!`](crate::led_strips!) macro.
    /// This constant is the result
    /// of calculating how much brightness is safe given that budget and the number of LEDs.
    pub const MAX_BRIGHTNESS: u8 =
        Current::Unlimited.max_brightness(Self::LEN as u32 * 60);
    /// Maximum number of animation frames allowed.
    ///
    /// Specified in the [`led_strip!`](macro@crate::led_strip)
    /// or [`led_strips!`](crate::led_strips!) macro.
    pub const MAX_FRAMES: usize = 16;

    /// Create static resources.
    ///
    /// See the [`led_strip`](mod@crate::led_strip) module docs for usage.
    #[must_use]
    #[doc(hidden)]
    pub const fn new_static() -> LedStripGeneratedStatic {
        LedStripGeneratedStatic {
            led_strip_static: LedStripStatic::new_static(),
        }
    }

    /// 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.
    ///
    /// The `pin`, `pio`, and `dma` parameters must correspond to the
    /// GPIO pin, PIO resource, and DMA channel specified in the macro.
    ///
    /// The [`led_strip!`](macro@crate::led_strip) macro defaults to `PIO0` and `DMA_CH0` if not specified.
    ///
    /// # Parameters
    ///
    /// - `pin`: GPIO pin for LED data signal
    /// - `pio`: PIO resource
    /// - `dma`: DMA channel for LED data transfer
    /// - `spawner`: Task spawner for background operations
    pub fn new(
        pin: embassy_rp::Peri<'static, embassy_rp::peripherals::PIN_3>,
        pio: embassy_rp::Peri<'static, embassy_rp::peripherals::PIO0>,
        dma: embassy_rp::Peri<'static, embassy_rp::peripherals::DMA_CH0>,
        spawner: embassy_executor::Spawner,
    ) -> Result<&'static Self> {
        static INSTANCE: LedStripGenerated = LedStripGenerated;
        let _ = (pin, pio, dma, spawner);
        Ok(&INSTANCE)
    }

    /// Write a frame to the LED strip.
    ///
    /// See the [`led_strip`](mod@crate::led_strip) module docs for usage.
    pub fn write_frame(
        &self,
        frame: Frame1d<{ Self::LEN }>,
    ) -> Result<()> {
        let _ = frame;
        Ok(())
    }

    /// Animate frames on the LED strip.
    ///
    /// See the [`led_strip`](mod@crate::led_strip) module docs for usage.
    pub fn animate<const N: usize>(
        &self,
        frames: [(Frame1d<{ Self::LEN }>, embassy_time::Duration); N],
    ) -> Result<()> {
        let _ = frames;
        Ok(())
    }
}
