pub struct Epd2In9<HW, STATE> { /* private fields */ }Expand description
Implementations§
Source§impl<HW> Epd2In9<HW, StateUninitialized>
impl<HW> Epd2In9<HW, StateUninitialized>
Source§impl<HW, STATE> Epd2In9<HW, STATE>
impl<HW, STATE> Epd2In9<HW, STATE>
Sourcepub async fn init(
self,
spi: &mut HW::Spi,
mode: RefreshMode,
) -> Result<Epd2In9<HW, StateReady>, HW::Error>
pub async fn init( self, spi: &mut HW::Spi, mode: RefreshMode, ) -> Result<Epd2In9<HW, StateReady>, HW::Error>
Initialise the display. This should be called before any other operations.
Source§impl<HW, STATE> Epd2In9<HW, STATE>
impl<HW, STATE> Epd2In9<HW, STATE>
Sourcepub async fn set_border(
&mut self,
spi: &mut HW::Spi,
color: BinaryColor,
) -> Result<(), HW::Error>
pub async fn set_border( &mut self, spi: &mut HW::Spi, color: BinaryColor, ) -> Result<(), HW::Error>
Sets the border to the specified colour. You need to call Displayable::update_display using RefreshMode::Full afterwards to apply this change.
Note: on my board, the white setting fades to grey fairly quickly. I have not found a way to avoid this.
Source§impl<HW> Epd2In9<HW, StateReady>
impl<HW> Epd2In9<HW, StateReady>
Sourcepub async fn set_refresh_mode(
&mut self,
spi: &mut HW::Spi,
mode: RefreshMode,
) -> Result<(), HW::Error>
pub async fn set_refresh_mode( &mut self, spi: &mut HW::Spi, mode: RefreshMode, ) -> Result<(), HW::Error>
Sets the refresh mode.
Sourcepub async fn set_window(
&mut self,
spi: &mut HW::Spi,
shape: Rectangle,
) -> Result<(), HW::Error>
pub async fn set_window( &mut self, spi: &mut HW::Spi, shape: Rectangle, ) -> Result<(), HW::Error>
Sets the window to which the next image data will be written.
The x-axis only supports multiples of 8; values outside this result in a debug-mode panic, or potentially misaligned content when debug assertions are disabled.
Sourcepub async fn set_cursor(
&mut self,
spi: &mut HW::Spi,
position: Point,
) -> Result<(), HW::Error>
pub async fn set_cursor( &mut self, spi: &mut HW::Spi, position: Point, ) -> Result<(), HW::Error>
Sets the cursor position to write the next data to.
The x-axis only supports multiples of 8; values outside this will result in a panic in debug mode, or potentially misaligned content if debug assertions are disabled.
Trait Implementations§
Source§impl<HW> DisplayPartial<1, 1, <HW as SpiHw>::Spi, <HW as ErrorHw>::Error> for Epd2In9<HW, StateReady>
impl<HW> DisplayPartial<1, 1, <HW as SpiHw>::Spi, <HW as ErrorHw>::Error> for Epd2In9<HW, StateReady>
Source§async fn write_base_framebuffer(
&mut self,
spi: &mut HW::Spi,
buf: &dyn BufferView<1, 1>,
) -> Result<(), HW::Error>
async fn write_base_framebuffer( &mut self, spi: &mut HW::Spi, buf: &dyn BufferView<1, 1>, ) -> Result<(), HW::Error>
Writes buffer data into the old internal framebuffer. This can be useful either:
- to prep the next frame before the current one has been displayed (since the old buffer becomes the current buffer after the next call to Self::update_display()).
- to modify the “diff base” if in RefreshMode::Partial. Also see Command::DisplayUpdateControl1.