Trait lcd::Hardware[][src]

pub trait Hardware {
    fn rs(&mut self, bit: bool);
fn enable(&mut self, bit: bool);
fn data(&mut self, data: u8); fn wait_address(&mut self) { ... }
fn mode(&self) -> FunctionMode { ... }
fn can_read(&self) -> bool { ... }
fn rw(&mut self, _bit: bool) { ... }
fn read_data(&mut self) -> u8 { ... }
fn apply(&mut self) { ... } }

Required methods

Provided methods

Address set up time is 40ns minimum (tAS) This function should be overridden in case processor is too fast for 40ns to pass.

Override to pick 8-bit mode (4-bit mode by default)

If this implementation can read from the data port. Default is false. If true is returned, both rw and read_data need to be implemented.

Set R/W flag.

Implementation should re-configure GPIO for input before setting R/W pin to true and configure GPIO for output after setting R/W to false.

Note that LCD driver typically uses 5V, so input should be tolerant to 5V when using busy flag.

Default implementation will panic.

Read data from the data pins of the LCD (D0-D7 in 8-bit mode and D4-D7 in 4-bit mode)

Default implementation will panic.

Send data to the device.

This is mainly for LCDs attached via I2C / SMBUS where it’s important to make changes to data and control lines at the same time.

If control and data lines are directly attached, there’s no need to implement this method.

Implementors