Expand description
Backends for a framebuffer.
One could use a simple array of PixelColor
, or some more elaborate proxy
backends.
Example:
use embedded_graphics::{pixelcolor::Rgb565, prelude::RgbColor};
use embedded_graphics_framebuf::{
backends::{EndianCorrectedBuffer, EndianCorrection},
FrameBuf,
};
// A potential backend
let mut data = [Rgb565::BLACK; 12 * 11];
let mut fbuf = FrameBuf::new(&mut data, 12, 11);
// Another potential backend that is owned by the framebuffer
let mut fbuf = FrameBuf::new([Rgb565::BLACK; 12 * 11], 12, 11);
let mut fbuf = FrameBuf::new(
EndianCorrectedBuffer::new(&mut data, EndianCorrection::ToBigEndian),
12,
11,
);
Structs§
- Endian
Corrected Buffer - A backend for
FrameBuf
which changes the underlying byte order. This can be useful when using the buffer for DMA with peripherals that have a different endianness than the host.
Enums§
- Endian
Correction - Enum indicating how the bytes should be converted in the host’s memory.
Traits§
- DMACapable
Frame Buffer Backend - Backends implementing this Trait can be used for DMA.
- Frame
Buffer Backend - This trait marks the requirements for backends for a
FrameBuf
.