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§
Provided Methods§
Sourcefn 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
Sourcefn 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
Sourcefn 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
If LCD driver is Write-Only, this method will wait one poll_interval_us
and return.
Sourcefn check_busy(&mut self) -> bool
fn check_busy(&mut self) -> bool
Check LCD busy state
If LCD driver is Write-Only, this method will return false instantly.
Sourcefn get_actual_backlight(&mut self) -> State
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
Sourcefn set_actual_backlight(&mut self, backlight: State)
fn set_actual_backlight(&mut self, backlight: State)
Set the backlight
Note: If a driver doesn’t support change backlight, just silently bypass it