pub struct Led2dGenerated;Expand description
Sample struct type generated by the led2d! macro, showing all methods and constants.
This page serves as the definitive reference for what a generated LED panel type
provides. For first-time readers, start with the examples in the led2d module
documentation, then return here for a complete list of available methods and
associated constants.
Auto-generated.
Implementations§
Source§impl Led2dGenerated
impl Led2dGenerated
Sourcepub const SIZE: Size = Frame2d<12, 4>::SIZE
pub const SIZE: Size = Frame2d<12, 4>::SIZE
Panel dimensions as a Size.
For embedded-graphics drawing operation.
Sourcepub const TOP_LEFT: Point = Frame2d<12, 4>::TOP_LEFT
pub const TOP_LEFT: Point = Frame2d<12, 4>::TOP_LEFT
Top-left corner coordinate as a Point.
For embedded-graphics drawing operation.
Sourcepub const TOP_RIGHT: Point = Frame2d<12, 4>::TOP_RIGHT
pub const TOP_RIGHT: Point = Frame2d<12, 4>::TOP_RIGHT
Top-right corner coordinate as a Point.
For embedded-graphics drawing operation.
Sourcepub const BOTTOM_LEFT: Point = Frame2d<12, 4>::BOTTOM_LEFT
pub const BOTTOM_LEFT: Point = Frame2d<12, 4>::BOTTOM_LEFT
Bottom-left corner coordinate as a Point.
For embedded-graphics drawing operation.
Sourcepub const BOTTOM_RIGHT: Point = Frame2d<12, 4>::BOTTOM_RIGHT
pub const BOTTOM_RIGHT: Point = Frame2d<12, 4>::BOTTOM_RIGHT
Bottom-right corner coordinate as a Point.
For embedded-graphics drawing operation.
Sourcepub const MAX_BRIGHTNESS: u8
pub const MAX_BRIGHTNESS: u8
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 led2d! or led_strips! macro.
This constant is the result
of calculating how much brightness is safe given that budget and the number of LEDs.
Sourcepub const MAX_FRAMES: usize = 16
pub const MAX_FRAMES: usize = 16
Maximum number of animation frames allowed.
Specified in the led2d! or led_strips! macro.
Sourcepub fn new(
pin: Peri<'static, PIN_3>,
pio: Peri<'static, PIO0>,
dma: Peri<'static, DMA_CH0>,
spawner: Spawner,
) -> Result<Self>
pub fn new( pin: Peri<'static, PIN_3>, pio: Peri<'static, PIO0>, dma: Peri<'static, DMA_CH0>, spawner: Spawner, ) -> Result<Self>
Create a new LED panel instance of the struct type
defined by led2d!.
See the led2d 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 led2d! macro defaults to PIO0 and DMA_CH0 if not specified.
§Parameters
pin: GPIO pin for LED data signalpio: PIO resourcedma: DMA channel for LED data transferspawner: Task spawner for background operations
Sourcepub fn write_frame(
&self,
frame: Frame2d<{ Self::WIDTH }, { Self::HEIGHT }>,
) -> Result<()>
pub fn write_frame( &self, frame: Frame2d<{ Self::WIDTH }, { Self::HEIGHT }>, ) -> Result<()>
Write a frame to the LED panel.
See the led2d module docs for usage.
Sourcepub async fn write_text(&self, text: &str, colors: &[RGB8]) -> Result<()>
pub async fn write_text(&self, text: &str, colors: &[RGB8]) -> Result<()>
Write text to the LED panel.
See the led2d module docs for usage.
Auto Trait Implementations§
impl Freeze for Led2dGenerated
impl RefUnwindSafe for Led2dGenerated
impl Send for Led2dGenerated
impl Sync for Led2dGenerated
impl Unpin for Led2dGenerated
impl UnwindSafe for Led2dGenerated
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more