Struct Lcd

Source
pub struct Lcd<'a, I, D>
where I: Write, D: DelayMs<u8>,
{ /* private fields */ }

Implementations§

Source§

impl<'a, I, D> Lcd<'a, I, D>
where I: Write, D: DelayMs<u8>,

Source

pub fn new( i2c: &'a mut I, address: u8, delay: &'a mut D, ) -> Result<Self, <I as Write>::Error>

Source

pub fn clear(&mut self) -> Result<(), <I as Write>::Error>

Clear the display. The LCD display driver requires a 2ms delay after clearing, which is why this method requires a delay object.

§Errors

Returns a Result that will report I2C errors, if any.

Source

pub fn home(&mut self) -> Result<(), <I as Write>::Error>

Home

§Errors

Returns a Result that will report I2C errors, if any.

Source

pub fn set_cursor_position( &mut self, col: u8, row: u8, ) -> Result<(), <I as Write>::Error>

Set the position of the cursor

§Errors

Returns a Result that will report I2C errors, if any.

Source

pub fn set_display( &mut self, display: Display, ) -> Result<(), <I as Write>::Error>

Control whether the display is on or off

§Errors

Returns a Result that will report I2C errors, if any.

Source

pub fn set_cursor(&mut self, cursor: Cursor) -> Result<(), <I as Write>::Error>

Sets the visiblity of the cursor, which is a non-blinking _

§Errors

Returns a Result that will report I2C errors, if any.

Turns on the blinking block cursor

§Errors

Returns a Result that will report I2C errors, if any.

Source

pub fn set_backlight( &mut self, backlight: Backlight, ) -> Result<(), <I as Write>::Error>

Source

pub fn print(&mut self, s: &str) -> Result<(), <I as Write>::Error>

Adds a string to the current position. The cursor will advance after this call to the next column

§Errors

Returns a Result that will report I2C errors, if any.

Auto Trait Implementations§

§

impl<'a, I, D> Freeze for Lcd<'a, I, D>

§

impl<'a, I, D> RefUnwindSafe for Lcd<'a, I, D>

§

impl<'a, I, D> Send for Lcd<'a, I, D>
where I: Send, D: Send,

§

impl<'a, I, D> Sync for Lcd<'a, I, D>
where I: Sync, D: Sync,

§

impl<'a, I, D> Unpin for Lcd<'a, I, D>

§

impl<'a, I, D> !UnwindSafe for Lcd<'a, I, D>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.