[−][src]Struct epd_gde021a1::GDE021A1
The ePaper GDE021A1 Driver data structure
It is composed of
- GPIO pins to set/read
- SPI interfacae to write data to
- a RAM buffer of 3096 byte (172x72 pixel, two bit per pixel)
Draw something to the display as well as clearing the display happens in MCU RAM only. The physical display will only updated by the refresh method, since writing to the chip is resource consuming (communication, energy, etc.)
Drawing must be on the RAM cache of the MCU and not on the RAM cache of the chip because the manipulation of single pixels without affecting neighbor pixels must be supported by the embedded graphics trait and communicating with the chip only allows updates of a set of four pixels.
This driver supports four gray level pixel color
- embedded_graphics::pixelcolor::Gray2::new(0) maps to black
- embedded_graphics::pixelcolor::Gray2::new(1) maps to dark gray
- embedded_graphics::pixelcolor::Gray2::new(2) maps to light gray
- embedded_graphics::pixelcolor::Gray2::new(3) maps to white
This driver supports binary pixel color:
- embedded_graphics::pixelcolor::BinaryColor::On maps to black
- embedded_graphics::pixelcolor::BinaryColor::Off maps to white.
Implementations
impl<SPI, RST, CS, DC, BSY, PinError, SPIError> GDE021A1<SPI, RST, CS, DC, BSY> where
SPI: Write<u8, Error = SPIError>,
RST: OutputPin<Error = PinError>,
CS: OutputPin<Error = PinError>,
DC: OutputPin<Error = PinError>,
BSY: InputPin<Error = PinError>,
[src]
SPI: Write<u8, Error = SPIError>,
RST: OutputPin<Error = PinError>,
CS: OutputPin<Error = PinError>,
DC: OutputPin<Error = PinError>,
BSY: InputPin<Error = PinError>,
pub fn new(spi: SPI, rst: RST, cs: Option<CS>, dc: DC, bsy: BSY) -> Self
[src]
Create a new driver instance that uses SPI connection.
pub fn init(
&mut self,
delay: &mut dyn DelayUs<u32>
) -> Result<(), Error<SPIError, PinError>>
[src]
&mut self,
delay: &mut dyn DelayUs<u32>
) -> Result<(), Error<SPIError, PinError>>
Initialize the display controller according to STM demo app
pub fn clear(&mut self)
[src]
Clear just resets the buffer to white
pub fn refresh(
&mut self,
delay: &mut dyn DelayUs<u32>
) -> Result<(), Error<SPIError, PinError>>
[src]
&mut self,
delay: &mut dyn DelayUs<u32>
) -> Result<(), Error<SPIError, PinError>>
Flush buffer to update entire display
The RAM buffer of the display on the MCU is transferred to the ePaper chip and the update command sequence instructs the chip to physically present the new content. The call is blocked until the busy pin signals completion of the operation of the physical display
pub fn busy_wait(&self)
[src]
Wait until busy flag is cleared by the chip
pub fn alt_init(
&mut self,
delay: &mut dyn DelayUs<u32>
) -> Result<(), Error<SPIError, PinError>>
[src]
&mut self,
delay: &mut dyn DelayUs<u32>
) -> Result<(), Error<SPIError, PinError>>
Initialize the display controller according to manual suggestion
Trait Implementations
impl<SPI, CS, RST, DC, BSY, PinError, SPIError> DrawTarget<BinaryColor> for GDE021A1<SPI, CS, RST, DC, BSY> where
SPI: Write<u8, Error = SPIError>,
RST: OutputPin<Error = PinError>,
CS: OutputPin<Error = PinError>,
DC: OutputPin<Error = PinError>,
BSY: InputPin<Error = PinError>,
[src]
SPI: Write<u8, Error = SPIError>,
RST: OutputPin<Error = PinError>,
CS: OutputPin<Error = PinError>,
DC: OutputPin<Error = PinError>,
BSY: InputPin<Error = PinError>,
type Error = Error<SPIError, PinError>
Error type to return when a drawing operation fails. Read more
fn size(&self) -> Size
[src]
fn draw_pixel(
&mut self,
pixel: Pixel<BinaryColor>
) -> Result<(), Error<SPIError, PinError>>
[src]
&mut self,
pixel: Pixel<BinaryColor>
) -> Result<(), Error<SPIError, PinError>>
fn draw_iter<T>(&mut self, item: T) -> Result<(), Self::Error> where
T: IntoIterator<Item = Pixel<C>>,
[src]
T: IntoIterator<Item = Pixel<C>>,
fn clear(&mut self, color: C) -> Result<(), Self::Error>
[src]
fn draw_line(
&mut self,
item: &Styled<Line, PrimitiveStyle<C>>
) -> Result<(), Self::Error>
[src]
&mut self,
item: &Styled<Line, PrimitiveStyle<C>>
) -> Result<(), Self::Error>
fn draw_triangle(
&mut self,
item: &Styled<Triangle, PrimitiveStyle<C>>
) -> Result<(), Self::Error>
[src]
&mut self,
item: &Styled<Triangle, PrimitiveStyle<C>>
) -> Result<(), Self::Error>
fn draw_rectangle(
&mut self,
item: &Styled<Rectangle, PrimitiveStyle<C>>
) -> Result<(), Self::Error>
[src]
&mut self,
item: &Styled<Rectangle, PrimitiveStyle<C>>
) -> Result<(), Self::Error>
fn draw_circle(
&mut self,
item: &Styled<Circle, PrimitiveStyle<C>>
) -> Result<(), Self::Error>
[src]
&mut self,
item: &Styled<Circle, PrimitiveStyle<C>>
) -> Result<(), Self::Error>
fn draw_image<'b, I>(
&mut self,
item: &'a Image<'b, I, C>
) -> Result<(), Self::Error> where
C: PixelColor + From<<C as PixelColor>::Raw>,
I: ImageDimensions,
&'b I: IntoPixelIter<C>,
[src]
&mut self,
item: &'a Image<'b, I, C>
) -> Result<(), Self::Error> where
C: PixelColor + From<<C as PixelColor>::Raw>,
I: ImageDimensions,
&'b I: IntoPixelIter<C>,
impl<SPI, CS, RST, DC, BSY, PinError, SPIError> DrawTarget<Gray2> for GDE021A1<SPI, CS, RST, DC, BSY> where
SPI: Write<u8, Error = SPIError>,
RST: OutputPin<Error = PinError>,
CS: OutputPin<Error = PinError>,
DC: OutputPin<Error = PinError>,
BSY: InputPin<Error = PinError>,
[src]
SPI: Write<u8, Error = SPIError>,
RST: OutputPin<Error = PinError>,
CS: OutputPin<Error = PinError>,
DC: OutputPin<Error = PinError>,
BSY: InputPin<Error = PinError>,
type Error = Error<SPIError, PinError>
Error type to return when a drawing operation fails. Read more
fn size(&self) -> Size
[src]
fn draw_pixel(
&mut self,
pixel: Pixel<Gray2>
) -> Result<(), Error<SPIError, PinError>>
[src]
&mut self,
pixel: Pixel<Gray2>
) -> Result<(), Error<SPIError, PinError>>
fn draw_iter<T>(&mut self, item: T) -> Result<(), Self::Error> where
T: IntoIterator<Item = Pixel<C>>,
[src]
T: IntoIterator<Item = Pixel<C>>,
fn clear(&mut self, color: C) -> Result<(), Self::Error>
[src]
fn draw_line(
&mut self,
item: &Styled<Line, PrimitiveStyle<C>>
) -> Result<(), Self::Error>
[src]
&mut self,
item: &Styled<Line, PrimitiveStyle<C>>
) -> Result<(), Self::Error>
fn draw_triangle(
&mut self,
item: &Styled<Triangle, PrimitiveStyle<C>>
) -> Result<(), Self::Error>
[src]
&mut self,
item: &Styled<Triangle, PrimitiveStyle<C>>
) -> Result<(), Self::Error>
fn draw_rectangle(
&mut self,
item: &Styled<Rectangle, PrimitiveStyle<C>>
) -> Result<(), Self::Error>
[src]
&mut self,
item: &Styled<Rectangle, PrimitiveStyle<C>>
) -> Result<(), Self::Error>
fn draw_circle(
&mut self,
item: &Styled<Circle, PrimitiveStyle<C>>
) -> Result<(), Self::Error>
[src]
&mut self,
item: &Styled<Circle, PrimitiveStyle<C>>
) -> Result<(), Self::Error>
fn draw_image<'b, I>(
&mut self,
item: &'a Image<'b, I, C>
) -> Result<(), Self::Error> where
C: PixelColor + From<<C as PixelColor>::Raw>,
I: ImageDimensions,
&'b I: IntoPixelIter<C>,
[src]
&mut self,
item: &'a Image<'b, I, C>
) -> Result<(), Self::Error> where
C: PixelColor + From<<C as PixelColor>::Raw>,
I: ImageDimensions,
&'b I: IntoPixelIter<C>,
Auto Trait Implementations
impl<SPI, RST, CS, DC, BSY> Send for GDE021A1<SPI, RST, CS, DC, BSY> where
BSY: Send,
CS: Send,
DC: Send,
RST: Send,
SPI: Send,
BSY: Send,
CS: Send,
DC: Send,
RST: Send,
SPI: Send,
impl<SPI, RST, CS, DC, BSY> Sync for GDE021A1<SPI, RST, CS, DC, BSY> where
BSY: Sync,
CS: Sync,
DC: Sync,
RST: Sync,
SPI: Sync,
BSY: Sync,
CS: Sync,
DC: Sync,
RST: Sync,
SPI: Sync,
impl<SPI, RST, CS, DC, BSY> Unpin for GDE021A1<SPI, RST, CS, DC, BSY> where
BSY: Unpin,
CS: Unpin,
DC: Unpin,
RST: Unpin,
SPI: Unpin,
BSY: Unpin,
CS: Unpin,
DC: Unpin,
RST: Unpin,
SPI: Unpin,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,