device_envoy_esp/led2d/
led2d_generated.rs1#[cfg(all(not(doc), not(feature = "host"), target_os = "none"))]
8use crate::led2d;
9#[cfg(all(not(doc), not(feature = "host"), target_os = "none"))]
10const LED_LAYOUT_12X4: crate::led2d::LedLayout<48, 12, 4> =
11 crate::led2d::LedLayout::serpentine_column_major();
12
13#[cfg(all(not(doc), not(feature = "host"), target_os = "none", esp_has_rmt))]
14led2d! {
15 Led2dGenerated {
16 pin: GPIO2,
17 len: 48,
18 led_layout: LED_LAYOUT_12X4,
19 max_current: crate::led_strip::Current::Milliamps(250),
20 font: crate::led2d::Led2dFont::Font3x4Trim,
21 }
22}
23
24#[cfg(all(not(doc), not(feature = "host"), target_os = "none", not(esp_has_rmt)))]
25led2d! {
26 Led2dGenerated {
27 pin: GPIO2,
28 len: 48,
29 led_layout: LED_LAYOUT_12X4,
30 max_current: crate::led_strip::Current::Milliamps(250),
31 font: crate::led2d::Led2dFont::Font3x4Trim,
32 engine: device_envoy_esp::led_strip::Engine::Spi,
33 }
34}
35
36#[cfg(doc)]
37pub struct Led2dGenerated;
44
45#[cfg(doc)]
46use crate::Result;
47#[cfg(doc)]
48use crate::led2d::{Frame2d, Led2d, Led2dFont, Point, Size};
49
50#[cfg(doc)]
51impl Led2dGenerated {
52 pub const MAX_FRAMES: usize = 16;
54 pub const MAX_BRIGHTNESS: u8 = 22;
56 pub const FONT: Led2dFont = Led2dFont::Font3x4Trim;
58 pub const WIDTH: usize = 12;
60 pub const HEIGHT: usize = 4;
62 pub const LEN: usize = 48;
64 pub const SIZE: Size = Frame2d::<12, 4>::SIZE;
66 pub const TOP_LEFT: Point = Frame2d::<12, 4>::TOP_LEFT;
68 pub const TOP_RIGHT: Point = Frame2d::<12, 4>::TOP_RIGHT;
70 pub const BOTTOM_LEFT: Point = Frame2d::<12, 4>::BOTTOM_LEFT;
72 pub const BOTTOM_RIGHT: Point = Frame2d::<12, 4>::BOTTOM_RIGHT;
74
75 pub fn new(
80 pin: impl Sized,
81 channel_creator: impl Sized,
82 spawner: embassy_executor::Spawner,
83 ) -> Result<&'static Self> {
84 static INSTANCE: Led2dGenerated = Led2dGenerated;
85 let _ = (pin, channel_creator, spawner);
86 Ok(&INSTANCE)
87 }
88}
89
90#[cfg(doc)]
91impl Led2d<12, 4> for &'static Led2dGenerated {
92 const WIDTH: usize = Led2dGenerated::WIDTH;
93 const HEIGHT: usize = Led2dGenerated::HEIGHT;
94 const LEN: usize = Led2dGenerated::LEN;
95 const SIZE: Size = Led2dGenerated::SIZE;
96 const TOP_LEFT: Point = Led2dGenerated::TOP_LEFT;
97 const TOP_RIGHT: Point = Led2dGenerated::TOP_RIGHT;
98 const BOTTOM_LEFT: Point = Led2dGenerated::BOTTOM_LEFT;
99 const BOTTOM_RIGHT: Point = Led2dGenerated::BOTTOM_RIGHT;
100 const MAX_FRAMES: usize = Led2dGenerated::MAX_FRAMES;
101 const MAX_BRIGHTNESS: u8 = Led2dGenerated::MAX_BRIGHTNESS;
102 const FONT: Led2dFont = Led2dGenerated::FONT;
103
104 fn write_frame(&self, frame2d: Frame2d<12, 4>) {
105 let _ = frame2d;
106 }
107
108 fn animate<I>(&self, frames: I)
109 where
110 I: IntoIterator,
111 I::Item: core::borrow::Borrow<(Frame2d<12, 4>, embassy_time::Duration)>,
112 {
113 let _ = frames;
114 }
115}