Struct ParallelSender

Source
pub struct ParallelSender<ControlPin, DBPin, BLPin, const PIN_CNT: usize, const READABLE: bool>
where ControlPin: OutputPin, DBPin: OutputPin + IfReadable<READABLE>, BLPin: StatefulOutputPin,
{ /* private fields */ }
Expand description

ParallelSender is the parallel interface to drive LCD1602

Implementations§

Source§

impl<ControlPin, DBPin, BLPin> ParallelSender<ControlPin, DBPin, BLPin, 4, true>
where ControlPin: OutputPin, DBPin: OutputPin + InputPin, BLPin: StatefulOutputPin,

Source

pub fn new_4pin( rs: ControlPin, rw: ControlPin, en: ControlPin, db4: DBPin, db5: DBPin, db6: DBPin, db7: DBPin, bl: Option<BLPin>, ) -> Self

Create 4-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, 4, false>
where ControlPin: OutputPin, DBPin: OutputPin, BLPin: StatefulOutputPin,

Source

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>
where ControlPin: OutputPin, DBPin: OutputPin + InputPin, BLPin: StatefulOutputPin,

Source

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>
where ControlPin: OutputPin, DBPin: OutputPin, BLPin: StatefulOutputPin,

Source

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>
where ControlPin: OutputPin, DBPin: OutputPin, BLPin: StatefulOutputPin, Delayer: DelayNs,

Source§

fn get_actual_backlight(&mut self) -> State

Get the current backlight Read more
Source§

fn set_actual_backlight(&mut self, backlight: State)

Set the backlight Read more
Source§

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 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
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,

Source§

fn get_actual_backlight(&mut self) -> State

Get the current backlight Read more
Source§

fn set_actual_backlight(&mut self, backlight: State)

Set the backlight Read more
Source§

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 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<ControlPin, DBPin, BLPin, const PIN_CNT: usize, const READABLE: bool> Freeze for ParallelSender<ControlPin, DBPin, BLPin, PIN_CNT, READABLE>
where ControlPin: Freeze, DBPin: Freeze, BLPin: Freeze,

§

impl<ControlPin, DBPin, BLPin, const PIN_CNT: usize, const READABLE: bool> RefUnwindSafe for ParallelSender<ControlPin, DBPin, BLPin, PIN_CNT, READABLE>
where ControlPin: RefUnwindSafe, DBPin: RefUnwindSafe, BLPin: RefUnwindSafe,

§

impl<ControlPin, DBPin, BLPin, const PIN_CNT: usize, const READABLE: bool> Send for ParallelSender<ControlPin, DBPin, BLPin, PIN_CNT, READABLE>
where ControlPin: Send, DBPin: Send, BLPin: Send,

§

impl<ControlPin, DBPin, BLPin, const PIN_CNT: usize, const READABLE: bool> Sync for ParallelSender<ControlPin, DBPin, BLPin, PIN_CNT, READABLE>
where ControlPin: Sync, DBPin: Sync, BLPin: Sync,

§

impl<ControlPin, DBPin, BLPin, const PIN_CNT: usize, const READABLE: bool> Unpin for ParallelSender<ControlPin, DBPin, BLPin, PIN_CNT, READABLE>
where ControlPin: Unpin, DBPin: Unpin, BLPin: Unpin,

§

impl<ControlPin, DBPin, BLPin, const PIN_CNT: usize, const READABLE: bool> UnwindSafe for ParallelSender<ControlPin, DBPin, BLPin, PIN_CNT, READABLE>
where ControlPin: UnwindSafe, DBPin: UnwindSafe, BLPin: UnwindSafe,

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.