pub struct ST7565<DI, SPECS, MODE, const WIDTH: usize, const HEIGHT: usize, const PAGES: usize> { /* private fields */ }Expand description
The actual driver
Implementations§
source§impl<DI, SPECS, MODE, const WIDTH: usize, const HEIGHT: usize, const PAGES: usize> ST7565<DI, SPECS, MODE, WIDTH, HEIGHT, PAGES>where
DI: WriteOnlyDataCommand,
SPECS: DisplaySpecs<WIDTH, HEIGHT, PAGES>,
impl<DI, SPECS, MODE, const WIDTH: usize, const HEIGHT: usize, const PAGES: usize> ST7565<DI, SPECS, MODE, WIDTH, HEIGHT, PAGES>where DI: WriteOnlyDataCommand, SPECS: DisplaySpecs<WIDTH, HEIGHT, PAGES>,
sourcepub fn set_static_indicator(
&mut self,
mode: Option<StaticIndicatorMode>
) -> Result<(), DisplayError>
pub fn set_static_indicator( &mut self, mode: Option<StaticIndicatorMode> ) -> Result<(), DisplayError>
Set the static indicator
sourcepub fn set_display_on(&mut self, on: bool) -> Result<(), DisplayError>
pub fn set_display_on(&mut self, on: bool) -> Result<(), DisplayError>
Enable/Disable the display output
source§impl<'a, DI: WriteOnlyDataCommand, SPECS, const WIDTH: usize, const HEIGHT: usize, const PAGES: usize> ST7565<DI, SPECS, GraphicsMode<'a, WIDTH, PAGES>, WIDTH, HEIGHT, PAGES>
impl<'a, DI: WriteOnlyDataCommand, SPECS, const WIDTH: usize, const HEIGHT: usize, const PAGES: usize> ST7565<DI, SPECS, GraphicsMode<'a, WIDTH, PAGES>, WIDTH, HEIGHT, PAGES>
–– Functionality of the graphics mode ––
In this mode, the driver can be used as a DrawTarget for the embedded_graphics crate.
sourcepub fn flush(&mut self) -> Result<(), DisplayError>
pub fn flush(&mut self) -> Result<(), DisplayError>
Flushes the internal buffer to the screen.
Needs to be called after drawing to actually display the data on screen.
sourcepub fn release_display_interface(
self
) -> (ST7565<(), SPECS, GraphicsMode<'a, WIDTH, PAGES>, WIDTH, HEIGHT, PAGES>, DI)
pub fn release_display_interface( self ) -> (ST7565<(), SPECS, GraphicsMode<'a, WIDTH, PAGES>, WIDTH, HEIGHT, PAGES>, DI)
Release the display interface object
This is meant for situations where the display interface is shared between several devices.
All functions that perform communication with the display are unavailable until the display interface is attached again.
Note that the bus attached later does not need to be the same bus as returned by this function, so the returned SPI bus object may be ignored (for example if the display interface object is based on references instead of ownership).
source§impl<'a, SPECS, const WIDTH: usize, const HEIGHT: usize, const PAGES: usize> ST7565<(), SPECS, GraphicsMode<'a, WIDTH, PAGES>, WIDTH, HEIGHT, PAGES>
impl<'a, SPECS, const WIDTH: usize, const HEIGHT: usize, const PAGES: usize> ST7565<(), SPECS, GraphicsMode<'a, WIDTH, PAGES>, WIDTH, HEIGHT, PAGES>
–– Functionality of the detached graphics mode ––
In this mode, the driver can be still used as a DrawTarget for the embedded_graphics crate, but no display communication can happen until the display interface is attached again.
This makes it possible to share the SPI bus with multiple devices.
sourcepub fn attach_display_interface<DI: WriteOnlyDataCommand>(
self,
interface: DI
) -> ST7565<DI, SPECS, GraphicsMode<'a, WIDTH, PAGES>, WIDTH, HEIGHT, PAGES>
pub fn attach_display_interface<DI: WriteOnlyDataCommand>( self, interface: DI ) -> ST7565<DI, SPECS, GraphicsMode<'a, WIDTH, PAGES>, WIDTH, HEIGHT, PAGES>
Attach the display interface back to the driver
source§impl<DI, SPECS, const WIDTH: usize, const HEIGHT: usize, const PAGES: usize> ST7565<DI, SPECS, InitialMode, WIDTH, HEIGHT, PAGES>where
DI: WriteOnlyDataCommand,
SPECS: DisplaySpecs<WIDTH, HEIGHT, PAGES>,
impl<DI, SPECS, const WIDTH: usize, const HEIGHT: usize, const PAGES: usize> ST7565<DI, SPECS, InitialMode, WIDTH, HEIGHT, PAGES>where DI: WriteOnlyDataCommand, SPECS: DisplaySpecs<WIDTH, HEIGHT, PAGES>,
–– Functionality of the initial mode ––
This mode is purely to transition into other modes.
sourcepub fn into_raw_mode(self) -> ST7565<DI, SPECS, RawMode, WIDTH, HEIGHT, PAGES>
pub fn into_raw_mode(self) -> ST7565<DI, SPECS, RawMode, WIDTH, HEIGHT, PAGES>
Transitions the driver into raw mode.
Raw mode provides functionality to control the ST7565 chip directly through low-level commands.
sourcepub fn into_graphics_mode(
self,
buffer: &mut GraphicsPageBuffer<WIDTH, PAGES>
) -> ST7565<DI, SPECS, GraphicsMode<'_, WIDTH, PAGES>, WIDTH, HEIGHT, PAGES>
pub fn into_graphics_mode( self, buffer: &mut GraphicsPageBuffer<WIDTH, PAGES> ) -> ST7565<DI, SPECS, GraphicsMode<'_, WIDTH, PAGES>, WIDTH, HEIGHT, PAGES>
Transitions the driver into graphics mode.
Graphics mode enables the driver to be used as a DrawTarget for the embedded_graphics crate.
source§impl<DI, SPECS, const WIDTH: usize, const HEIGHT: usize, const PAGES: usize> ST7565<DI, SPECS, RawMode, WIDTH, HEIGHT, PAGES>where
DI: WriteOnlyDataCommand,
impl<DI, SPECS, const WIDTH: usize, const HEIGHT: usize, const PAGES: usize> ST7565<DI, SPECS, RawMode, WIDTH, HEIGHT, PAGES>where DI: WriteOnlyDataCommand,
–– Functionality of the raw mode ––
This mode exists for interacting with the ST7565 chip via direct low level commands.
sourcepub fn set_column(&mut self, address: u8) -> Result<(), DisplayError>
pub fn set_column(&mut self, address: u8) -> Result<(), DisplayError>
Sets the column to write into
sourcepub fn set_line_offset(&mut self, offset: u8) -> Result<(), DisplayError>
pub fn set_line_offset(&mut self, offset: u8) -> Result<(), DisplayError>
Sets the line offset, effectively scrolling the display through memory.
sourcepub fn set_inverted(&mut self, inverted: bool) -> Result<(), DisplayError>
pub fn set_inverted(&mut self, inverted: bool) -> Result<(), DisplayError>
Sets whether the pixels should be inverted.
sourcepub fn write_pixel_data(&mut self, data: &[u8]) -> Result<(), DisplayError>
pub fn write_pixel_data(&mut self, data: &[u8]) -> Result<(), DisplayError>
Writes raw pixel data.
For more information how data is processed by the display, read the ST7565 reference manual.
sourcepub fn adc_select(&mut self, reverse: bool) -> Result<(), DisplayError>
pub fn adc_select(&mut self, reverse: bool) -> Result<(), DisplayError>
Sets the adc direction.
Effectively flips the display horizontally.
sourcepub fn common_output_mode_select(
&mut self,
reverse: bool
) -> Result<(), DisplayError>
pub fn common_output_mode_select( &mut self, reverse: bool ) -> Result<(), DisplayError>
Sets the common mode direction.
Effectively flips the display vertically.
sourcepub fn display_all_points(&mut self, enable: bool) -> Result<(), DisplayError>
pub fn display_all_points(&mut self, enable: bool) -> Result<(), DisplayError>
Displays all points of the display