Trait pwr_hd44780::buses::Bus
[−]
[src]
pub trait Bus { fn initialize(&mut self) -> UnitResult; fn set_backlight(&mut self, enabled: bool) -> UnitResult; fn write_byte(&mut self, value: u8, as_data: bool) -> UnitResult; fn width(&self) -> usize; fn write_command(&mut self, value: u8) -> UnitResult { ... } fn write_data(&mut self, value: u8) -> UnitResult { ... } fn execute(&mut self, command: Command) -> UnitResult { ... } }
Required Methods
fn initialize(&mut self) -> UnitResult
Initializes the bus (eg. puts LCD in appropriate 4/8-bit mode).
fn set_backlight(&mut self, enabled: bool) -> UnitResult
Enables / disables the backlight.
fn write_byte(&mut self, value: u8, as_data: bool) -> UnitResult
Sends a single byte to the device.
When as_data
is true
, the RS
register is pulled up and byte is sent as data
.
fn width(&self) -> usize
Returns bus width (4 / 8 bit).
Provided Methods
fn write_command(&mut self, value: u8) -> UnitResult
Sends a raw command to the device.
fn write_data(&mut self, value: u8) -> UnitResult
Sends a raw data to the device.
fn execute(&mut self, command: Command) -> UnitResult
Executes given command.