Trait pwr_hd44780::Hd44780 [] [src]

pub trait Hd44780 {
    fn clear(&mut self) -> UnitResult;
fn home(&mut self) -> UnitResult;
fn move_at(&mut self, y: usize, x: usize) -> UnitResult;
fn print_char(&mut self, ch: u8) -> UnitResult;
fn set_backlight(&mut self, enabled: bool) -> UnitResult;
fn set_cursor_blinking(&mut self, enabled: bool) -> UnitResult;
fn set_cursor_visible(&mut self, enabled: bool) -> UnitResult;
fn set_text_visible(&mut self, enabled: bool) -> UnitResult;
fn create_char(&mut self, idx: u8, lines: [u8; 8]) -> UnitResult;
fn height(&self) -> usize;
fn width(&self) -> usize; fn print<T: Into<String>>(&mut self, str: T) -> UnitResult { ... } }

Required Methods

Clears the screen and moves cursor at (0, 0).

Moves the cursor at (0, 0).

Moves the cursor at given position. When passed an invalid coordinates (eg. beyond the screen), does nothing.

Prints a single ASCII character and moves cursor.

Enables / disables the backlight.

Enables / disables blinking the cursor. Blinking = whole 5x8 / 5x10 character is blinking,

Enables / disables the cursor. Visible = only bottom of the character is blinking.

Shows / hides the text.

Creates a custom character from given bitmap.

Each array item in given bitmap represents a single line, of which only the last 5 bits are important - rest is ignored.

idx must be from range <0, 7> (that is: only 8 custom characters are possible, that's a limit imposed by the designers of the HD44780).

When passed an invalid idx, does nothing.

Example

lcd.create_char(1, [
  0b00000000,
  0b10000000,
  0b01000000,
  0b00100000,
  0b00010000,
  0b00001000,
  0b00000100,
  0b00000010,
]);

lcd.print_char(1);

Returns screen's height (number of lines).

Returns screen's width (number of characters per line).

Provided Methods

Prints a string at current cursor's position.

Implementors