pub struct DmaFrameBuffer<const NROWS: usize, const COLS: usize, const PLANES: usize> { /* private fields */ }Expand description
Row-major BCM framebuffer for row-by-row Binary Code Modulation.
See the module-level documentation for layout details and DMA descriptor patterns.
§Type Parameters
NROWS: number of multiplexed row pairs (panel height / 2)COLS: number of columns (panel width)PLANES: number of bit-planes (typically 8 for full 8-bit colour)
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 framebuffer, 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 divisible
by 4 (the ESP32’s byte-order rearrangement requires column counts
that are multiples of 4). In const contexts (e.g. static
framebuffers) this is a compile-time error.
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
Number of bit-planes.
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
Byte size of one plane’s payload for a single row (pixel data plus its four address bytes).
Sourcepub const fn bcm_row_count() -> usize
pub const fn bcm_row_count() -> usize
Number of multiplexed scan rows.
Sourcepub const fn bcm_row_bytes() -> usize
pub const fn bcm_row_bytes() -> usize
Byte size of the per-row inter-row blanking gap.
Sourcepub const fn format(&mut self)
pub const fn format(&mut self)
Formats the framebuffer with row addresses and control bits.
Every plane carries the current row address; blanking is applied around the plane0→plane1 address change. See the module-level documentation for the exact distribution.
Sourcepub fn pixel_row_ptr_len(
&self,
row_idx: usize,
plane_idx: usize,
) -> (*const u8, usize)
pub fn pixel_row_ptr_len( &self, row_idx: usize, plane_idx: usize, ) -> (*const u8, usize)
Returns a pointer and byte length for a plane’s payload (pixel data plus its four address bytes) within a single row.
§Panics
Panics if row_idx >= NROWS or plane_idx >= PLANES.
Sourcepub fn gap_ptr_len(&self, row_idx: usize) -> (*const u8, usize)
pub fn gap_ptr_len(&self, row_idx: usize) -> (*const u8, usize)
Returns a pointer and byte length for a row’s inter-row blanking gap.
The gap is streamed between plane 0 (whose address bytes latch the
data and change the row address) and plane 1. Returns length 0 when
no inter-row-blank-* feature is enabled.
§Panics
Panics if row_idx >= NROWS.
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>
Source§fn clone(&self) -> DmaFrameBuffer<NROWS, COLS, PLANES>
fn clone(&self) -> DmaFrameBuffer<NROWS, COLS, PLANES>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl<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
const BCM_SEQUENCE_LEN: usize
BCM_SEQUENCE.Source§const BCM_SEQUENCE_COUNT: usize = NROWS
const BCM_SEQUENCE_COUNT: usize = NROWS
NROWS for row-major framebuffers (one sequence per row), 1
for frame-major and threshold framebuffers (the sequence covers
the whole frame).Source§const BCM_SEGMENTS_PER_GROUP: usize
const BCM_SEGMENTS_PER_GROUP: usize
BCM_SEQUENCE_LEN: groups never straddle
a sequence boundary. Read moreSource§type Word = u8
type Word = u8
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§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