pub struct Uc8151<SPI, CS, DC, BUSY, RESET> {
pub spi: SPI,
pub cs: CS,
pub dc: DC,
pub busy: BUSY,
pub reset: RESET,
pub lut: LUT,
/* private fields */
}
Expand description
Uc8151 driver
Fields§
§spi: SPI
§cs: CS
§dc: DC
§busy: BUSY
§reset: RESET
§lut: LUT
Implementations§
source§impl<SPI, CS, DC, BUSY, RESET> Uc8151<SPI, CS, DC, BUSY, RESET>where
SPI: Write<u8>,
CS: OutputPin,
DC: OutputPin,
BUSY: InputPin,
RESET: OutputPin,
impl<SPI, CS, DC, BUSY, RESET> Uc8151<SPI, CS, DC, BUSY, RESET>where SPI: Write<u8>, CS: OutputPin, DC: OutputPin, BUSY: InputPin, RESET: OutputPin,
sourcepub fn new(spi: SPI, cs: CS, dc: DC, busy: BUSY, reset: RESET) -> Self
pub fn new(spi: SPI, cs: CS, dc: DC, busy: BUSY, reset: RESET) -> Self
Create new UC8151 instance from the given SPI and GPIO pins
sourcepub fn get_update_speed(&self) -> &Lut
pub fn get_update_speed(&self) -> &Lut
Return the currently update speed
sourcepub fn get_update_time(&self) -> u16
pub fn get_update_time(&self) -> u16
Return the update interval for the current LUT
sourcepub fn command(
&mut self,
reg: Instruction,
data: &[u8]
) -> Result<(), SpiDataError>
pub fn command( &mut self, reg: Instruction, data: &[u8] ) -> Result<(), SpiDataError>
Send command via SPI to the display
sourcepub fn data(&mut self, data: &[u8]) -> Result<(), SpiDataError>
pub fn data(&mut self, data: &[u8]) -> Result<(), SpiDataError>
Send data via SPI to the display
sourcepub fn transmit_framebuffer(&mut self) -> Result<(), SpiDataError>
pub fn transmit_framebuffer(&mut self) -> Result<(), SpiDataError>
Send framebuffer to display via SPI. This is a low-level function, call update() if you just want to update the display
sourcepub fn transmit_framebuffer_range(
&mut self,
range: Range<usize>
) -> Result<(), SpiDataError>
pub fn transmit_framebuffer_range( &mut self, range: Range<usize> ) -> Result<(), SpiDataError>
Transmits a subset of the framebuffer via SPI. Call partial_update if you are looking to update a partial area of the display.
sourcepub fn setup(
&mut self,
delay_source: &mut impl DelayUs<u32>,
speed: LUT
) -> Result<(), SpiDataError>
pub fn setup( &mut self, delay_source: &mut impl DelayUs<u32>, speed: LUT ) -> Result<(), SpiDataError>
Configure the display
sourcepub fn invert_colors(&mut self, inverted: bool) -> Result<(), SpiDataError>
pub fn invert_colors(&mut self, inverted: bool) -> Result<(), SpiDataError>
Invert the colors of the screen - normal = black on white, inverted = white on black
sourcepub fn off(&mut self) -> Result<(), SpiDataError>
pub fn off(&mut self) -> Result<(), SpiDataError>
Ask the display to power itself off
sourcepub fn update(&mut self) -> Result<(), SpiDataError>
pub fn update(&mut self) -> Result<(), SpiDataError>
Refresh the display with what is in the framebuffer
sourcepub fn partial_update(
&mut self,
region: UpdateRegion
) -> Result<(), SpiDataError>
pub fn partial_update( &mut self, region: UpdateRegion ) -> Result<(), SpiDataError>
Peform a partial refresh of the display over the area defined by the DisplayRegion
.
Trait Implementations§
source§impl<SPI, CS, DC, BUSY, RESET> DrawTarget for Uc8151<SPI, CS, DC, BUSY, RESET>where
SPI: Write<u8>,
CS: OutputPin,
DC: OutputPin,
BUSY: InputPin,
RESET: OutputPin,
impl<SPI, CS, DC, BUSY, RESET> DrawTarget for Uc8151<SPI, CS, DC, BUSY, RESET>where SPI: Write<u8>, CS: OutputPin, DC: OutputPin, BUSY: InputPin, RESET: OutputPin,
§type Color = BinaryColor
type Color = BinaryColor
The pixel color type the targetted display supports.
§type Error = Infallible
type Error = Infallible
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
Auto Trait Implementations§
impl<SPI, CS, DC, BUSY, RESET> RefUnwindSafe for Uc8151<SPI, CS, DC, BUSY, RESET>where BUSY: RefUnwindSafe, CS: RefUnwindSafe, DC: RefUnwindSafe, RESET: RefUnwindSafe, SPI: RefUnwindSafe,
impl<SPI, CS, DC, BUSY, RESET> Send for Uc8151<SPI, CS, DC, BUSY, RESET>where BUSY: Send, CS: Send, DC: Send, RESET: Send, SPI: Send,
impl<SPI, CS, DC, BUSY, RESET> Sync for Uc8151<SPI, CS, DC, BUSY, RESET>where BUSY: Sync, CS: Sync, DC: Sync, RESET: Sync, SPI: Sync,
impl<SPI, CS, DC, BUSY, RESET> Unpin for Uc8151<SPI, CS, DC, BUSY, RESET>where BUSY: Unpin, CS: Unpin, DC: Unpin, RESET: Unpin, SPI: Unpin,
impl<SPI, CS, DC, BUSY, RESET> UnwindSafe for Uc8151<SPI, CS, DC, BUSY, RESET>where BUSY: UnwindSafe, CS: UnwindSafe, DC: UnwindSafe, RESET: UnwindSafe, SPI: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
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.