pub struct ParallelSender<ControlPin, DBPin, BLPin, const PIN_CNT: usize, const READABLE: bool>{ /* private fields */ }
Expand description
ParallelSender
is the parallel interface to drive LCD1602
Implementations§
Source§impl<ControlPin, DBPin, BLPin> ParallelSender<ControlPin, DBPin, BLPin, 4, true>
impl<ControlPin, DBPin, BLPin> ParallelSender<ControlPin, DBPin, BLPin, 4, true>
Source§impl<ControlPin, DBPin, BLPin> ParallelSender<ControlPin, DBPin, BLPin, 4, false>
impl<ControlPin, DBPin, BLPin> ParallelSender<ControlPin, DBPin, BLPin, 4, false>
Sourcepub fn new_4pin_write_only(
rs: ControlPin,
en: ControlPin,
db4: DBPin,
db5: DBPin,
db6: DBPin,
db7: DBPin,
bl: Option<BLPin>,
) -> Self
pub fn new_4pin_write_only( rs: ControlPin, en: ControlPin, db4: DBPin, db5: DBPin, db6: DBPin, db7: DBPin, bl: Option<BLPin>, ) -> Self
Create 4-pin parallel driver, will need other 2 pins to control LCD, and a optional pin to control backlight (better connect the pin to a transistor)
Source§impl<ControlPin, DBPin, BLPin> ParallelSender<ControlPin, DBPin, BLPin, 8, true>
impl<ControlPin, DBPin, BLPin> ParallelSender<ControlPin, DBPin, BLPin, 8, true>
Sourcepub fn new_8pin(
rs: ControlPin,
rw: ControlPin,
en: ControlPin,
db0: DBPin,
db1: DBPin,
db2: DBPin,
db3: DBPin,
db4: DBPin,
db5: DBPin,
db6: DBPin,
db7: DBPin,
bl: Option<BLPin>,
) -> Self
pub fn new_8pin( rs: ControlPin, rw: ControlPin, en: ControlPin, db0: DBPin, db1: DBPin, db2: DBPin, db3: DBPin, db4: DBPin, db5: DBPin, db6: DBPin, db7: DBPin, bl: Option<BLPin>, ) -> Self
Create 8-pin parallel driver, will need other 3 pins to control LCD, and a optional pin to control backlight (better connect the pin to a transistor)
Source§impl<ControlPin, DBPin, BLPin> ParallelSender<ControlPin, DBPin, BLPin, 8, false>
impl<ControlPin, DBPin, BLPin> ParallelSender<ControlPin, DBPin, BLPin, 8, false>
Sourcepub fn new_8pin_write_only(
rs: ControlPin,
en: ControlPin,
db0: DBPin,
db1: DBPin,
db2: DBPin,
db3: DBPin,
db4: DBPin,
db5: DBPin,
db6: DBPin,
db7: DBPin,
bl: Option<BLPin>,
) -> Self
pub fn new_8pin_write_only( rs: ControlPin, en: ControlPin, db0: DBPin, db1: DBPin, db2: DBPin, db3: DBPin, db4: DBPin, db5: DBPin, db6: DBPin, db7: DBPin, bl: Option<BLPin>, ) -> Self
Create 8-pin parallel driver, will need other 2 pins to control LCD, and a optional pin to control backlight (better connect the pin to a transistor)
Trait Implementations§
Source§impl<ControlPin, DBPin, BLPin, const PIN_CNT: usize, Delayer> SendCommand<Delayer, false> for ParallelSender<ControlPin, DBPin, BLPin, PIN_CNT, false>
impl<ControlPin, DBPin, BLPin, const PIN_CNT: usize, Delayer> SendCommand<Delayer, false> for ParallelSender<ControlPin, DBPin, BLPin, PIN_CNT, false>
Source§fn get_actual_backlight(&mut self) -> State
fn get_actual_backlight(&mut self) -> State
Get the current backlight Read more
Source§fn set_actual_backlight(&mut self, backlight: State)
fn set_actual_backlight(&mut self, backlight: State)
Set the backlight Read more
Source§fn send(&mut self, command: Command) -> Option<u8>
fn send(&mut self, 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
Source§impl<ControlPin, DBPin, BLPin, const PIN_CNT: usize, Delayer> SendCommand<Delayer, true> for ParallelSender<ControlPin, DBPin, BLPin, PIN_CNT, true>where
ControlPin: OutputPin,
DBPin: OutputPin + InputPin,
BLPin: StatefulOutputPin,
Delayer: DelayNs,
impl<ControlPin, DBPin, BLPin, const PIN_CNT: usize, Delayer> SendCommand<Delayer, true> for ParallelSender<ControlPin, DBPin, BLPin, PIN_CNT, true>where
ControlPin: OutputPin,
DBPin: OutputPin + InputPin,
BLPin: StatefulOutputPin,
Delayer: DelayNs,
Source§fn get_actual_backlight(&mut self) -> State
fn get_actual_backlight(&mut self) -> State
Get the current backlight Read more
Source§fn set_actual_backlight(&mut self, backlight: State)
fn set_actual_backlight(&mut self, backlight: State)
Set the backlight Read more
Source§fn send(&mut self, command: Command) -> Option<u8>
fn send(&mut self, 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<ControlPin, DBPin, BLPin, const PIN_CNT: usize, const READABLE: bool> Freeze for ParallelSender<ControlPin, DBPin, BLPin, PIN_CNT, READABLE>
impl<ControlPin, DBPin, BLPin, const PIN_CNT: usize, const READABLE: bool> RefUnwindSafe for ParallelSender<ControlPin, DBPin, BLPin, PIN_CNT, READABLE>
impl<ControlPin, DBPin, BLPin, const PIN_CNT: usize, const READABLE: bool> Send for ParallelSender<ControlPin, DBPin, BLPin, PIN_CNT, READABLE>
impl<ControlPin, DBPin, BLPin, const PIN_CNT: usize, const READABLE: bool> Sync for ParallelSender<ControlPin, DBPin, BLPin, PIN_CNT, READABLE>
impl<ControlPin, DBPin, BLPin, const PIN_CNT: usize, const READABLE: bool> Unpin for ParallelSender<ControlPin, DBPin, BLPin, PIN_CNT, READABLE>
impl<ControlPin, DBPin, BLPin, const PIN_CNT: usize, const READABLE: bool> UnwindSafe for ParallelSender<ControlPin, DBPin, BLPin, PIN_CNT, READABLE>
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