Struct lcd::Display [−][src]
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]
&mut self,
dir: EntryModeDirection,
scroll: EntryModeShift
) -> &Self
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]
&mut self,
display: DisplayMode,
cursor: DisplayCursor,
blink: DisplayBlink
) -> &Self
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
Auto Trait Implementations
impl<HW> Send for Display<HW> where
HW: Send,
[src]
HW: Send,
impl<HW> Sync for Display<HW> where
HW: Sync,
[src]
HW: Sync,
impl<HW> Unpin for Display<HW> where
HW: Unpin,
[src]
HW: Unpin,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,