pub struct ST7567S<DI, MODE> { /* private fields */ }
Expand description
ST7565S display driver
Works in two modes:
- Direct Write Mode (by default): This mode allows you to write directly to the display memory by calling the
draw
method. - Buffered Mode: This mode allows you to modify an internal buffer by using methods like
set_pixel
,clear
, or by using theembedded-graphics
crate. Once you have made your changes, you can call theflush
method to write the buffer to the display.
Implementations§
source§impl<DI: WriteOnlyDataCommand> ST7567S<DI, DirectWriteMode>
impl<DI: WriteOnlyDataCommand> ST7567S<DI, DirectWriteMode>
sourcepub fn new(display_interface: DI) -> Self
pub fn new(display_interface: DI) -> Self
Create new instance of ST7565S driver in DirectWriteMode
Arguments
display_interface
- The interface abstraction fromdisplay_interface
crate
sourcepub fn into_buffered_graphics_mode(self) -> ST7567S<DI, BufferedMode>
pub fn into_buffered_graphics_mode(self) -> ST7567S<DI, BufferedMode>
Move driver to buffered mode
source§impl<DI: WriteOnlyDataCommand> ST7567S<DI, BufferedMode>
impl<DI: WriteOnlyDataCommand> ST7567S<DI, BufferedMode>
source§impl<DI: WriteOnlyDataCommand, MODE> ST7567S<DI, MODE>
impl<DI: WriteOnlyDataCommand, MODE> ST7567S<DI, MODE>
sourcepub fn init(&mut self) -> Result<(), DisplayError>
pub fn init(&mut self) -> Result<(), DisplayError>
Send init commands to the display and turn it on
sourcepub fn reset(&mut self) -> Result<(), DisplayError>
pub fn reset(&mut self) -> Result<(), DisplayError>
Reset some display parameters to default values: Start Line, Column Address, Page Address and COM Direction. Usually doesn’t need to be called
sourcepub fn draw(&mut self, buffer: &[u8]) -> Result<(), DisplayError>
pub fn draw(&mut self, buffer: &[u8]) -> Result<(), DisplayError>
Send buffer to the display
Buffer represents by 8 pages of 128 columns where 1 byte represents 8 vertical pixels
sourcepub fn bounded_draw(
&mut self,
buffer: &[u8],
top_left: (u8, u8),
bottom_right: (u8, u8)
) -> Result<(), DisplayError>
pub fn bounded_draw( &mut self, buffer: &[u8], top_left: (u8, u8), bottom_right: (u8, u8) ) -> Result<(), DisplayError>
Send part of the buffer to the display. Buffer represents by 8 pages of 128 columns where 1 byte represents 8 vertical pixels
Arguments
buffer
- the entire buffer from which the required part will be senttop_left
andbottom_right
are coordinates of the top left and bottom right corners of the area to be drawn
Trait Implementations§
source§impl<DI: WriteOnlyDataCommand> DrawTarget for ST7567S<DI, BufferedMode>
impl<DI: WriteOnlyDataCommand> DrawTarget for ST7567S<DI, BufferedMode>
§type Color = BinaryColor
type Color = BinaryColor
The pixel color type the targetted display supports.
§type Error = DisplayError
type Error = DisplayError
Error type to return when a drawing operation fails. Read more
source§fn draw_iter<I>(&mut self, pixels: I) -> Result<(), Self::Error>where
I: IntoIterator<Item = Pixel<Self::Color>>,
fn draw_iter<I>(&mut self, pixels: I) -> Result<(), Self::Error>where I: IntoIterator<Item = Pixel<Self::Color>>,
Draw individual pixels to the display without a defined order. Read more
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>,
Fill a given area with an iterator providing a contiguous stream of pixel colors. Read more
source§impl<DI: WriteOnlyDataCommand> OriginDimensions for ST7567S<DI, BufferedMode>
impl<DI: WriteOnlyDataCommand> OriginDimensions for ST7567S<DI, BufferedMode>
Auto Trait Implementations§
impl<DI, MODE> RefUnwindSafe for ST7567S<DI, MODE>where DI: RefUnwindSafe, MODE: RefUnwindSafe,
impl<DI, MODE> Send for ST7567S<DI, MODE>where DI: Send, MODE: Send,
impl<DI, MODE> Sync for ST7567S<DI, MODE>where DI: Sync, MODE: Sync,
impl<DI, MODE> Unpin for ST7567S<DI, MODE>where DI: Unpin, MODE: Unpin,
impl<DI, MODE> UnwindSafe for ST7567S<DI, MODE>where DI: UnwindSafe, MODE: UnwindSafe,
Blanket Implementations§
source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where T: CheckedCast<Dst>,
Casts the value.
source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere Src: CheckedCast<Dst>,
source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Casts the value.
source§impl<T> Dimensions for Twhere
T: OriginDimensions,
impl<T> Dimensions for Twhere T: OriginDimensions,
source§fn bounding_box(&self) -> Rectangle
fn bounding_box(&self) -> Rectangle
Returns the bounding box.
source§impl<T> OverflowingAs for T
impl<T> OverflowingAs for T
source§fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool)where T: OverflowingCast<Dst>,
Casts the value.
source§impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere Src: OverflowingCast<Dst>,
source§fn overflowing_cast_from(src: Src) -> (Dst, bool)
fn overflowing_cast_from(src: Src) -> (Dst, bool)
Casts the value.
source§impl<T> SaturatingAs for T
impl<T> SaturatingAs for T
source§fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
fn saturating_as<Dst>(self) -> Dstwhere T: SaturatingCast<Dst>,
Casts the value.
source§impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere Src: SaturatingCast<Dst>,
source§fn saturating_cast_from(src: Src) -> Dst
fn saturating_cast_from(src: Src) -> Dst
Casts the value.
source§impl<T> UnwrappedAs for T
impl<T> UnwrappedAs for T
source§fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
fn unwrapped_as<Dst>(self) -> Dstwhere T: UnwrappedCast<Dst>,
Casts the value.
source§impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere Src: UnwrappedCast<Dst>,
source§fn unwrapped_cast_from(src: Src) -> Dst
fn unwrapped_cast_from(src: Src) -> Dst
Casts the value.
source§impl<T> WrappingAs for T
impl<T> WrappingAs for T
source§fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
fn wrapping_as<Dst>(self) -> Dstwhere T: WrappingCast<Dst>,
Casts the value.
source§impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere Src: WrappingCast<Dst>,
source§fn wrapping_cast_from(src: Src) -> Dst
fn wrapping_cast_from(src: Src) -> Dst
Casts the value.