Skip to main content

device_envoy_esp/led/
led_generated.rs

1// @generated by `cargo check-all`. Do not edit by hand.
2//! Module containing a sample struct type generated by the [`led!`](macro@crate::led) macro:
3//! [`LedGenerated`].
4//!
5//! Auto-generated.
6
7#[cfg(doc)]
8use crate::Result;
9#[cfg(doc)]
10use crate::led::{Led, LedLevel, OnLevel};
11
12#[cfg(doc)]
13/// Sample struct type generated by the [`led!`](macro@crate::led) macro.
14///
15/// This page exists to show constructor and trait methods in one place. For
16/// narrative examples, see the [`led`](mod@crate::led) module.
17///
18/// Auto-generated.
19pub struct LedGenerated;
20
21#[cfg(doc)]
22impl LedGenerated {
23    /// Maximum number of animation steps for this generated LED type.
24    pub const MAX_STEPS: usize = 32;
25
26    /// Create a new LED instance of the struct type defined by
27    /// [`led!`](macro@crate::led).
28    ///
29    /// See the [`led`](mod@crate::led) module docs for usage examples.
30    pub fn new(
31        pin: impl Sized,
32        on_level: OnLevel,
33        spawner: embassy_executor::Spawner,
34    ) -> Result<Self> {
35        let _ = (pin, on_level, spawner);
36        Ok(Self)
37    }
38}
39
40#[cfg(doc)]
41impl Led for LedGenerated {
42    fn set_level(&self, led_level: LedLevel) {
43        let _ = led_level;
44    }
45
46    fn animate<I>(&self, frames: I)
47    where
48        I: IntoIterator,
49        I::Item: core::borrow::Borrow<(LedLevel, embassy_time::Duration)>,
50    {
51        let _ = frames;
52    }
53}