I2cSender

Struct I2cSender 

Source
pub struct I2cSender<'a, I2cLcd: I2c<A>, A: AddressMode + Clone> { /* private fields */ }
Expand description

I2cSender is the I2C interface with an adapter board to drive LCD1602

Implementations§

Source§

impl<'a, I2cLcd: I2c<A>, A: AddressMode + Clone> I2cSender<'a, I2cLcd, A>

Source

pub fn new(i2c: &'a mut I2cLcd, addr: A) -> Self

Create a I2cSender driver

Trait Implementations§

Source§

impl<'a, I2cLcd, A, Delayer> SendCommand<Delayer, true> for I2cSender<'a, I2cLcd, A>
where I2cLcd: I2c<A>, A: AddressMode + Clone, Delayer: DelayNs,

Source§

fn set_actual_backlight(&mut self, state: State)

Set the backlight Read more
Source§

fn get_actual_backlight(&mut self) -> State

Get the current backlight Read more
Source§

fn send(&mut self, lcd_command: Command) -> Option<u8>

Parse a Command and sending data to hardware, and return the result value when Command is a ReadWriteOp::Read command
Source§

fn delay_and_send( &mut self, command_set: CommandSet, delayer: &mut Delayer, delay_us: u32, ) -> Option<u8>

Wait specific duration, and send command
Source§

fn wait_and_send( &mut self, command_set: CommandSet, delayer: &mut Delayer, poll_interval_us: u32, ) -> Option<u8>

Check LCD busy state, when LCD is idle, send the command
Source§

fn wait_for_idle(&mut self, delayer: &mut Delayer, poll_interval_us: u32)

Wait in a busy loop, until LCD is idle Read more
Source§

fn check_busy(&mut self) -> bool

Check LCD busy state Read more

Auto Trait Implementations§

§

impl<'a, I2cLcd, A> Freeze for I2cSender<'a, I2cLcd, A>
where A: Freeze,

§

impl<'a, I2cLcd, A> RefUnwindSafe for I2cSender<'a, I2cLcd, A>
where A: RefUnwindSafe, I2cLcd: RefUnwindSafe,

§

impl<'a, I2cLcd, A> Send for I2cSender<'a, I2cLcd, A>
where A: Send, I2cLcd: Send,

§

impl<'a, I2cLcd, A> Sync for I2cSender<'a, I2cLcd, A>
where A: Sync, I2cLcd: Sync,

§

impl<'a, I2cLcd, A> Unpin for I2cSender<'a, I2cLcd, A>
where A: Unpin,

§

impl<'a, I2cLcd, A> !UnwindSafe for I2cSender<'a, I2cLcd, A>

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.