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

#[cfg(doc)]
use crate::Result;
#[cfg(doc)]
use crate::led::{Led, LedLevel, OnLevel};

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

#[cfg(doc)]
impl LedGenerated {
    /// Maximum number of animation steps for this generated LED type.
    pub const MAX_STEPS: usize = 32;

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

#[cfg(doc)]
impl Led for LedGenerated {
    fn set_level(&self, led_level: LedLevel) {
        let _ = led_level;
    }

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