pub struct FrameBuffer { /* private fields */ }Expand description
An owned physical framebuffer region.
Created once per SDRAM allocation at boot. Owns geometry metadata plus
the PhysAddr — no raw pointer, no u32 escape hatch in the public
API.
Implementations§
Source§impl FrameBuffer
impl FrameBuffer
Sourcepub unsafe fn from_phys(
addr: PhysAddr,
width: u32,
height: u32,
stride_bytes: u32,
format: PixelFmt,
) -> Self
pub unsafe fn from_phys( addr: PhysAddr, width: u32, height: u32, stride_bytes: u32, format: PixelFmt, ) -> Self
Construct a FrameBuffer at a physical address.
§Safety
The caller must ensure that:
[addr, addr + stride_bytes * height)is a mapped, writable RAM region for the'staticlifetime of the returned value,- no other
FrameBuffer,&mut [u8], or DMA master references overlapping bytes, addris appropriately aligned forformat(4 bytes forArgb8888, 2 bytes forRgb565, 1 byte forL8/A8/A4),stride_bytes >= width * pixel_size(format).
Sourcepub fn dma_addr(&self) -> DmaAddr
pub fn dma_addr(&self) -> DmaAddr
DMA bus address for handoff to a DMA master (DMA2D OMAR, LTDC CFBAR, etc.).
The conversion re-asserts pixel-format alignment; a misaligned
framebuffer address is a construction-time bug but dma_addr
falls back to byte alignment so callers receive a usable value
rather than a panic. Wire errors are surfaced via the pixel
validator in the DMA engine itself.
Sourcepub fn stride_bytes(&self) -> u32
pub fn stride_bytes(&self) -> u32
Row stride in bytes.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FrameBuffer
impl RefUnwindSafe for FrameBuffer
impl Send for FrameBuffer
impl Sync for FrameBuffer
impl Unpin for FrameBuffer
impl UnsafeUnpin for FrameBuffer
impl UnwindSafe for FrameBuffer
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
Mutably borrows from an owned value. Read more