pub trait DisplayControllerLayer {
// Required methods
unsafe fn enable<T: PixelWord>(
&mut self,
start_ptr: *const T,
pixel_format: PixelFormat
);
unsafe fn swap_framebuffer<T: PixelWord>(&mut self, start_ptr: *const T);
fn is_swap_pending(&self) -> bool;
unsafe fn resize_buffer_pitch(&mut self, width: u32);
}
Expand description
A layer of a microcontroller peripheral that drives a LCD-TFT display.
May be implemented alongside DisplayController
if the LCD-TFT display
peripheral only supports one layer.
Required Methods§
sourceunsafe fn enable<T: PixelWord>(
&mut self,
start_ptr: *const T,
pixel_format: PixelFormat
)
unsafe fn enable<T: PixelWord>( &mut self, start_ptr: *const T, pixel_format: PixelFormat )
sourceunsafe fn swap_framebuffer<T: PixelWord>(&mut self, start_ptr: *const T)
unsafe fn swap_framebuffer<T: PixelWord>(&mut self, start_ptr: *const T)
Swap the framebuffer to a new one.
Safety
start_ptr
must point to a location that can be accessed by the LTDC
peripheral, with sufficient length for the framebuffer.
sourcefn is_swap_pending(&self) -> bool
fn is_swap_pending(&self) -> bool
Indicates that a framebuffer swap is pending. In this situation, memory
we previously supplied to
swap_framebuffer
, before the most recent
call, is still owned by the display.
sourceunsafe fn resize_buffer_pitch(&mut self, width: u32)
unsafe fn resize_buffer_pitch(&mut self, width: u32)
Resizes the framebuffer pitch. This does not change the output window size. The shadow registers are reloaded immediately.
The framebuffer pitch is the increment from the start of one line of pixels to the start of the next line.
Safety
The caller must ensure that enough memory is allocated for the resulting framebuffer size