pub struct CydFrameEsp<'a, D: SpiDevice<u8> = ExclusiveDevice<Spi<'static, Blocking>, Output<'static>, NoDelay>> { /* private fields */ }Expand description
The ESP implementation of
CydFrame.
Frames are returned by CydDisplay::frame_mut. See the portable
CydFrame
documentation for normal drawing.
Implementations§
Source§impl<D: SpiDevice<u8>> CydFrameEsp<'_, D>
impl<D: SpiDevice<u8>> CydFrameEsp<'_, D>
Sourcepub fn write_text(&mut self, text: &str) -> &mut Self
pub fn write_text(&mut self, text: &str) -> &mut Self
Draw text at the frame rectangle’s top-left using the device default
font and foreground color.
For any other font, color, alignment, or baseline, draw with embedded-graphics directly against this frame.
See the portable
CydFrame::write_text
documentation.
Source§impl<'a, D: SpiDevice<u8>> CydFrameEsp<'a, D>
impl<'a, D: SpiDevice<u8>> CydFrameEsp<'a, D>
Sourcepub fn fill(&mut self, color: Rgb565) -> &mut Self
pub fn fill(&mut self, color: Rgb565) -> &mut Self
Fill the frame with an explicit color.
See the portable
CydFrame::fill
documentation.
Sourcepub fn raw_pixels_mut(&mut self) -> &mut [u16]
pub fn raw_pixels_mut(&mut self) -> &mut [u16]
Borrow the buffered frame region’s raw RGB565 pixels in row-major order.
Sourcepub fn flush(&mut self) -> Result<(), Error>
pub fn flush(&mut self) -> Result<(), Error>
Present this frame’s pixels at its rectangle’s top-left (set by
CydDisplay::frame_mut).
This inherent method synchronously writes the buffered rectangle over
SPI. In generic
code, call CydFrame::flush
and await its future instead.
Trait Implementations§
Source§impl<D: SpiDevice<u8>> CydFrame for CydFrameEsp<'_, D>
impl<D: SpiDevice<u8>> CydFrame for CydFrameEsp<'_, D>
Source§fn rectangle(&self) -> Rectangle
fn rectangle(&self) -> Rectangle
Source§fn fill(&mut self, color: Rgb565) -> &mut Self
fn fill(&mut self, color: Rgb565) -> &mut Self
self.Source§fn clear(&mut self) -> &mut Self
fn clear(&mut self) -> &mut Self
Source§fn write_text(&mut self, text: &str) -> &mut Self
fn write_text(&mut self, text: &str) -> &mut Self
text at the frame rectangle’s top-left using the device default
font and foreground color. Returns &mut Self for chaining.Source§impl<D: SpiDevice<u8>> Dimensions for CydFrameEsp<'_, D>
impl<D: SpiDevice<u8>> Dimensions for CydFrameEsp<'_, D>
Source§fn bounding_box(&self) -> Rectangle
fn bounding_box(&self) -> Rectangle
Source§impl<D: SpiDevice<u8>> DrawTarget for CydFrameEsp<'_, D>
impl<D: SpiDevice<u8>> DrawTarget for CydFrameEsp<'_, D>
Source§fn clear(&mut self, color: Self::Color) -> Result<(), Self::Error>
fn clear(&mut self, color: Self::Color) -> Result<(), Self::Error>
Source§fn draw_iter<I>(&mut self, pixels: I) -> Result<(), Self::Error>
fn draw_iter<I>(&mut self, pixels: I) -> Result<(), Self::Error>
Source§fn fill_contiguous<I>(
&mut self,
area: &Rectangle,
colors: I,
) -> Result<(), Self::Error>where
I: IntoIterator<Item = Self::Color>,
fn fill_contiguous<I>(
&mut self,
area: &Rectangle,
colors: I,
) -> Result<(), Self::Error>where
I: IntoIterator<Item = Self::Color>,
Source§impl<D: SpiDevice<u8>> PixelTarget for CydFrameEsp<'_, D>
impl<D: SpiDevice<u8>> PixelTarget for CydFrameEsp<'_, D>
Source§fn put_pixel_565(&mut self, x: usize, y: usize, rgb565: u16)
fn put_pixel_565(&mut self, x: usize, y: usize, rgb565: u16)
The frame buffer already stores RGB565, so a decoded image pixel can be written verbatim with no RGB888 round-trip.