Trait SendCommand

Source
pub trait SendCommand<Delayer: DelayNs, const READABLE: bool> {
    // Required method
    fn send(&mut self, command: Command) -> Option<u8>;

    // Provided methods
    fn delay_and_send(
        &mut self,
        command_set: CommandSet,
        delayer: &mut Delayer,
        delay_us: u32,
    ) -> Option<u8> { ... }
    fn wait_and_send(
        &mut self,
        command_set: CommandSet,
        delayer: &mut Delayer,
        poll_interval_us: u32,
    ) -> Option<u8> { ... }
    fn wait_for_idle(&mut self, delayer: &mut Delayer, poll_interval_us: u32) { ... }
    fn check_busy(&mut self) -> bool { ... }
    fn get_actual_backlight(&mut self) -> State { ... }
    fn set_actual_backlight(&mut self, backlight: State) { ... }
}
Expand description

SendCommand is the trait a sender should implement to communicate with the hardware

Required Methods§

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

Provided Methods§

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

If LCD driver is Write-Only, this method will wait one poll_interval_us and return.

Source

fn check_busy(&mut self) -> bool

Check LCD busy state

If LCD driver is Write-Only, this method will return false instantly.

Source

fn get_actual_backlight(&mut self) -> State

Get the current backlight

Note: If a driver doesn’t support read backlight state, just silently bypass it

Source

fn set_actual_backlight(&mut self, backlight: State)

Set the backlight

Note: If a driver doesn’t support change backlight, just silently bypass it

Implementors§

Source§

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

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§

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,