device_envoy_esp/led2d/
led2d_generated.rs1#[cfg(all(not(doc), not(feature = "host"), target_os = "none"))]
8use crate::led2d;
9
10#[cfg(all(not(doc), not(feature = "host"), target_os = "none"))]
11const LED_LAYOUT_12X4: crate::led2d::LedLayout<48, 12, 4> =
12 crate::led2d::LedLayout::serpentine_column_major();
13
14#[cfg(all(not(doc), not(feature = "host"), target_os = "none"))]
15led2d! {
16 Led2dGenerated {
17 pin: GPIO2,
18 len: 48,
19 led_layout: LED_LAYOUT_12X4,
20 max_current: crate::led_strip::Current::Milliamps(250),
21 font: crate::led2d::Led2dFont::Font3x4Trim,
22 }
23}
24
25#[cfg(doc)]
26pub struct Led2dGenerated;
33
34#[cfg(doc)]
35use crate::led2d::{Frame2d, Led2d, Led2dFont, Point, Size};
36#[cfg(doc)]
37use crate::Result;
38
39#[cfg(doc)]
40impl Led2dGenerated {
41 pub const MAX_FRAMES: usize = 16;
43 pub const MAX_BRIGHTNESS: u8 = 22;
45 pub const FONT: Led2dFont = Led2dFont::Font3x4Trim;
47 pub const WIDTH: usize = 12;
49 pub const HEIGHT: usize = 4;
51 pub const LEN: usize = 48;
53 pub const SIZE: Size = Frame2d::<12, 4>::SIZE;
55 pub const TOP_LEFT: Point = Frame2d::<12, 4>::TOP_LEFT;
57 pub const TOP_RIGHT: Point = Frame2d::<12, 4>::TOP_RIGHT;
59 pub const BOTTOM_LEFT: Point = Frame2d::<12, 4>::BOTTOM_LEFT;
61 pub const BOTTOM_RIGHT: Point = Frame2d::<12, 4>::BOTTOM_RIGHT;
63
64 pub fn new(
69 pin: impl Sized,
70 channel_creator: impl Sized,
71 spawner: embassy_executor::Spawner,
72 ) -> Result<&'static Self> {
73 static INSTANCE: Led2dGenerated = Led2dGenerated;
74 let _ = (pin, channel_creator, spawner);
75 Ok(&INSTANCE)
76 }
77}
78
79#[cfg(doc)]
80impl Led2d<12, 4> for &'static Led2dGenerated {
81 const WIDTH: usize = Led2dGenerated::WIDTH;
82 const HEIGHT: usize = Led2dGenerated::HEIGHT;
83 const LEN: usize = Led2dGenerated::LEN;
84 const SIZE: Size = Led2dGenerated::SIZE;
85 const TOP_LEFT: Point = Led2dGenerated::TOP_LEFT;
86 const TOP_RIGHT: Point = Led2dGenerated::TOP_RIGHT;
87 const BOTTOM_LEFT: Point = Led2dGenerated::BOTTOM_LEFT;
88 const BOTTOM_RIGHT: Point = Led2dGenerated::BOTTOM_RIGHT;
89 const MAX_FRAMES: usize = Led2dGenerated::MAX_FRAMES;
90 const MAX_BRIGHTNESS: u8 = Led2dGenerated::MAX_BRIGHTNESS;
91 const FONT: Led2dFont = Led2dGenerated::FONT;
92
93 fn write_frame(&self, frame2d: Frame2d<12, 4>) {
94 let _ = frame2d;
95 }
96
97 fn animate<I>(&self, frames: I)
98 where
99 I: IntoIterator,
100 I::Item: core::borrow::Borrow<(Frame2d<12, 4>, embassy_time::Duration)>,
101 {
102 let _ = frames;
103 }
104}