pub struct DmaFrameBuffer<const NROWS: usize, const COLS: usize, const PLANES: usize> { /* private fields */ }Expand description
Plane-major BCM framebuffer (per-plane storage).
Implementations§
Source§impl<const NROWS: usize, const COLS: usize, const PLANES: usize> DmaFrameBuffer<NROWS, COLS, PLANES>
impl<const NROWS: usize, const COLS: usize, const PLANES: usize> DmaFrameBuffer<NROWS, COLS, PLANES>
Sourcepub const fn new() -> Self
pub const fn new() -> Self
Creates a new frame buffer, pre-formatted and ready for use.
§Panics
Panics if NROWS is not within 1..=32 (5-bit row address) or
PLANES is not within 1..=8 (8-bit color depth). With the
esp32-ordering feature, also panics if COLS is not even (the
ESP32’s byte-order swap requires an even column count). In const
contexts (e.g. static framebuffers) this is a compile-time error.
§Memory placement (⚠️ large buffer)
This framebuffer is a large inline array (roughly
PLANES × NROWS × (COLS + gap) × 2 bytes). A 64×64 panel at
PLANES = 8 is tens of kilobytes, which will overflow a task stack if
bound to a local let. The framebuffer is mutable, so give it a
'static home that hands out &'static mut (e.g.
static_cell::StaticCell) — never static mut. See the crate-level
Memory placement section for a worked example.
Sourcepub const fn bcm_chunk_count() -> usize
👎Deprecated since 0.11.0: use BCM_SEQUENCE instead
pub const fn bcm_chunk_count() -> usize
use BCM_SEQUENCE instead
Returns the number of BCM chunks (one per bit-plane).
Sourcepub const fn bcm_chunk_bytes() -> usize
👎Deprecated since 0.11.0: use BCM_SEQUENCE instead
pub const fn bcm_chunk_bytes() -> usize
use BCM_SEQUENCE instead
Returns the byte size of one BCM chunk (a single bit-plane including tail word).
Trait Implementations§
Source§impl<const NROWS: usize, const COLS: usize, const PLANES: usize> Clone for DmaFrameBuffer<NROWS, COLS, PLANES>
impl<const NROWS: usize, const COLS: usize, const PLANES: usize> Clone for DmaFrameBuffer<NROWS, COLS, PLANES>
impl<const NROWS: usize, const COLS: usize, const PLANES: usize> Copy for DmaFrameBuffer<NROWS, COLS, PLANES>
Source§impl<const NROWS: usize, const COLS: usize, const PLANES: usize> Debug for DmaFrameBuffer<NROWS, COLS, PLANES>
impl<const NROWS: usize, const COLS: usize, const PLANES: usize> Debug for DmaFrameBuffer<NROWS, COLS, PLANES>
Source§impl<const NROWS: usize, const COLS: usize, const PLANES: usize> Default for DmaFrameBuffer<NROWS, COLS, PLANES>
impl<const NROWS: usize, const COLS: usize, const PLANES: usize> Default for DmaFrameBuffer<NROWS, COLS, PLANES>
Source§impl<const NROWS: usize, const COLS: usize, const PLANES: usize> DrawTarget for DmaFrameBuffer<NROWS, COLS, PLANES>
impl<const NROWS: usize, const COLS: usize, const PLANES: usize> DrawTarget for DmaFrameBuffer<NROWS, COLS, PLANES>
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<const NROWS: usize, const COLS: usize, const PLANES: usize> FrameBuffer for DmaFrameBuffer<NROWS, COLS, PLANES>
impl<const NROWS: usize, const COLS: usize, const PLANES: usize> FrameBuffer for DmaFrameBuffer<NROWS, COLS, PLANES>
Source§const BCM_SEQUENCE: [BcmLenReps; 10]
const BCM_SEQUENCE: [BcmLenReps; 10]
(len, reps) of the segments in one sequence, in scan
order. Read moreSource§const BCM_SEQUENCE_LEN: usize = PLANES
const BCM_SEQUENCE_LEN: usize = PLANES
BCM_SEQUENCE.Source§const BCM_SEQUENCE_COUNT: usize = 1
const BCM_SEQUENCE_COUNT: usize = 1
NROWS for row-major framebuffers (one sequence per row), 1
for frame-major and threshold framebuffers (the sequence covers
the whole frame).Source§type Word = u16
type Word = u16
u8 for latched, u16
for direct-drive). Driver implementations can use this to enforce that pin
configurations match the framebuffer at compile time.Source§fn bcm_segment_ptr(&self, index: usize) -> *const u8
fn bcm_segment_ptr(&self, index: usize) -> *const u8
index-th BCM segment. Read moreSource§const BCM_SEGMENT_COUNT: usize = _
const BCM_SEGMENT_COUNT: usize = _
Source§const BCM_SEGMENTS_PER_GROUP: usize = 1
const BCM_SEGMENTS_PER_GROUP: usize = 1
BCM_SEQUENCE_LEN: groups never straddle
a sequence boundary. Read moreSource§fn bcm_segment_count(&self) -> usize
fn bcm_segment_count(&self) -> usize
Source§fn bcm_segment(&self, index: usize) -> BcmSegment
fn bcm_segment(&self, index: usize) -> BcmSegment
index-th BCM segment. Read more