Struct pwr_hd44780::buses::i2c::I2C
[−]
[src]
pub struct I2C { /* fields omitted */ }
Methods
impl I2C
[src]
pub fn new<P: AsRef<Path>>(i2c_device: P, i2c_address: u16) -> Result<I2C>
[src]
Constructs a new HD44780 I2C bus.
Trait Implementations
impl Bus for I2C
[src]
fn initialize(&mut self) -> UnitResult
[src]
Initializes the bus (eg. puts LCD in appropriate 4/8-bit mode).
fn set_backlight(&mut self, enabled: bool) -> UnitResult
[src]
Enables / disables the backlight.
fn write_byte(&mut self, value: u8, as_data: bool) -> UnitResult
[src]
Sends a single byte to the device. When as_data
is true
, the RS
register is pulled up and byte is sent as data
. Read more
fn width(&self) -> usize
[src]
Returns bus width (4 / 8 bit).
fn write_command(&mut self, value: u8) -> UnitResult
[src]
Sends a raw command to the device.
fn write_data(&mut self, value: u8) -> UnitResult
[src]
Sends a raw data to the device.
fn execute(&mut self, command: Command) -> UnitResult
[src]
Executes given command.