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>
impl<'a, I2cLcd: I2c<A>, A: AddressMode + Clone> I2cSender<'a, I2cLcd, A>
Sourcepub fn new(i2c: &'a mut I2cLcd, addr: A) -> Self
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>
impl<'a, I2cLcd, A, Delayer> SendCommand<Delayer, true> for I2cSender<'a, I2cLcd, A>
Source§fn set_actual_backlight(&mut self, state: State)
fn set_actual_backlight(&mut self, state: State)
Set the backlight Read more
Source§fn get_actual_backlight(&mut self) -> State
fn get_actual_backlight(&mut self) -> State
Get the current backlight Read more
Source§fn send(&mut self, lcd_command: Command) -> Option<u8>
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
commandSource§fn delay_and_send(
&mut self,
command_set: CommandSet,
delayer: &mut Delayer,
delay_us: u32,
) -> Option<u8>
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>
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)
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
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>
impl<'a, I2cLcd, A> Sync for I2cSender<'a, I2cLcd, A>
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> 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