Struct lcd::Display[][src]

pub struct Display<HW: Hardware + Delay> { /* fields omitted */ }

Object implementing HD44780 protocol. Stateless (could be created as many times as needed).

Implementations

impl<HW: Hardware + Delay> Display<HW>[src]

pub fn new(hw: HW) -> Display<HW>[src]

pub fn init(&mut self, line: FunctionLine, dots: FunctionDots)[src]

Initialize LCD display. Sets an equivalent of the following setup:

lcd.display(DisplayMode::DisplayOff, DisplayCursor::CursorOff, DisplayBlink::BlinkOff);
lcd.clear();
lcd.entry_mode(EntryModeDirection::EntryRight, EntryModeShift::NoShift);

pub fn clear(&mut self) -> &Self[src]

Clears display and returns cursor to the home position (address 0).

pub fn home(&mut self) -> &Self[src]

Returns cursor to home position. Also returns display being shifted to the original position. DDRAM content remains unchanged.

pub fn entry_mode(
    &mut self,
    dir: EntryModeDirection,
    scroll: EntryModeShift
) -> &Self
[src]

Sets cursor move direction (entry); specifies to shift the display (scroll). These operations are performed during data read/write.

pub fn display(
    &mut self,
    display: DisplayMode,
    cursor: DisplayCursor,
    blink: DisplayBlink
) -> &Self
[src]

Sets on/off of all display (display), cursor on/off (cursor), and blink of cursor position character (blink).

pub fn scroll(&mut self, dir: Direction) -> &Self[src]

Sets display-shift, direction (dir). DDRAM content remains unchanged.

pub fn cursor(&mut self, dir: Direction) -> &Self[src]

Sets cursor-shift, direction (dir). DDRAM content remains unchanged.

pub fn position(&mut self, col: u8, row: u8)[src]

Sets the cursor position to the given row (row) and column (col).

pub fn print(&mut self, str: &str) -> &Self[src]

Print given string (str) on the LCD screen.

pub fn write(&mut self, data: u8) -> &Self[src]

Write given character (given as data of type u8) on the LCD screen.

pub fn upload_character(&mut self, location: u8, map: [u8; 8]) -> &Self[src]

Upload character image at given location. Only locations 0-7 are supported (panics otherwise). Each character is represented by an array of 8 bytes, each byte being a row. Only 5 bits are used from each byte (representing columns).

pub fn unwrap(self) -> HW[src]

Unwrap HAL back from the driver.

Trait Implementations

impl<HW: Hardware + Delay> Write for Display<HW>[src]

Auto Trait Implementations

impl<HW> Send for Display<HW> where
    HW: Send
[src]

impl<HW> Sync for Display<HW> where
    HW: Sync
[src]

impl<HW> Unpin for Display<HW> where
    HW: Unpin
[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.