[−][src]Struct hd44780_driver::HD44780
Methods
impl<D: DelayUs<u16> + DelayMs<u8>, RS: OutputPin, EN: OutputPin, D0: OutputPin, D1: OutputPin, D2: OutputPin, D3: OutputPin, D4: OutputPin, D5: OutputPin, D6: OutputPin, D7: OutputPin> HD44780<D, EightBitBus<RS, EN, D0, D1, D2, D3, D4, D5, D6, D7>>
[src]
pub fn new_8bit(
rs: RS,
en: EN,
d0: D0,
d1: D1,
d2: D2,
d3: D3,
d4: D4,
d5: D5,
d6: D6,
d7: D7,
delay: D
) -> HD44780<D, EightBitBus<RS, EN, D0, D1, D2, D3, D4, D5, D6, D7>>
[src]
rs: RS,
en: EN,
d0: D0,
d1: D1,
d2: D2,
d3: D3,
d4: D4,
d5: D5,
d6: D6,
d7: D7,
delay: D
) -> HD44780<D, EightBitBus<RS, EN, D0, D1, D2, D3, D4, D5, D6, D7>>
Create an instance of a HD44780
from 8 data pins, a register select
pin, an enable pin and a struct implementing the delay trait.
- The delay instance is used to sleep between commands to
ensure the
HD44780
has enough time to process commands. - The eight db0..db7 pins are used to send and recieve with
the
HD44780
. - The register select pin is used to tell the
HD44780
if incoming data is a command or data. - The enable pin is used to tell the
HD44780
that there is data on the 8 data pins and that it should read them in.
impl<D: DelayUs<u16> + DelayMs<u8>, RS: OutputPin, EN: OutputPin, D4: OutputPin, D5: OutputPin, D6: OutputPin, D7: OutputPin> HD44780<D, FourBitBus<RS, EN, D4, D5, D6, D7>>
[src]
pub fn new_4bit(
rs: RS,
en: EN,
d4: D4,
d5: D5,
d6: D6,
d7: D7,
delay: D
) -> HD44780<D, FourBitBus<RS, EN, D4, D5, D6, D7>>
[src]
rs: RS,
en: EN,
d4: D4,
d5: D5,
d6: D6,
d7: D7,
delay: D
) -> HD44780<D, FourBitBus<RS, EN, D4, D5, D6, D7>>
Create an instance of a HD44780
from 4 data pins, a register select
pin, an enable pin and a struct implementing the delay trait.
- The delay instance is used to sleep between commands to
ensure the
HD44780
has enough time to process commands. - The four db0..db3 pins are used to send and recieve with
the
HD44780
. - The register select pin is used to tell the
HD44780
if incoming data is a command or data. - The enable pin is used to tell the
HD44780
that there is data on the 4 data pins and that it should read them in.
This mode operates differently than 8 bit mode by using 4 less pins for data, which is nice on devices with less I/O although the I/O takes a 'bit' longer
Instead of commands being sent byte by byte each command is broken up into it's upper and lower nibbles (4 bits) before being sent over the data bus
impl<D, B> HD44780<D, B> where
D: DelayUs<u16> + DelayMs<u8>,
B: DataBus,
[src]
D: DelayUs<u16> + DelayMs<u8>,
B: DataBus,
pub fn reset(&mut self)
[src]
Unshifts the display and sets the cursor position to 0
lcd.reset();
pub fn set_display_mode(&mut self, display_mode: DisplayMode)
[src]
Set if the display should be on, if the cursor should be visible, and if the cursor should blink
Note: This is equivilent to calling all of the other relavent
methods however this operation does it all in one go to the HD44780
pub fn clear(&mut self)
[src]
Clear the entire display
lcd.clear();
pub fn set_autoscroll(&mut self, enabled: bool)
[src]
If enabled, automatically scroll the display when a new character is written to the display
lcd.set_autoscroll(true);
pub fn set_cursor_visibility(&mut self, visibility: Cursor)
[src]
Set if the cursor should be visible
pub fn set_display(&mut self, display: Display)
[src]
Set if the characters on the display should be visible
pub fn set_cursor_blink(&mut self, blink: CursorBlink)
[src]
Set if the cursor should blink
pub fn set_cursor_mode(&mut self, mode: CursorMode)
[src]
Set which way the cursor will move when a new character is written
// Move right (Default) when a new character is written lcd.set_cursor_mode(CursorMode::Right) // Move left when a new character is written lcd.set_cursor_mode(CursorMode::Left)
pub fn set_cursor_pos(&mut self, position: u8)
[src]
Set the cursor position
// Move to line 2 lcd.set_cursor_pos(40)
pub fn shift_cursor(&mut self, dir: Direction)
[src]
Shift just the cursor to the left or the right
lcd.shift_cursor(Direction::Left); lcd.shift_cursor(Direction::Right);
pub fn shift_display(&mut self, dir: Direction)
[src]
Shift the entire display to the left or the right
lcd.shift_display(Direction::Left); lcd.shift_display(Direction::Right);
pub fn write_char(&mut self, data: char)
[src]
Write a single character to the HD44780
lcd.write_char('A');
Trait Implementations
impl<D, B> Write for HD44780<D, B> where
D: DelayUs<u16> + DelayMs<u8>,
B: DataBus,
[src]
D: DelayUs<u16> + DelayMs<u8>,
B: DataBus,
fn write_str(&mut self, string: &str) -> Result
[src]
fn write_char(&mut self, c: char) -> Result<(), Error>
1.1.0[src]
Writes a [char
] into this writer, returning whether the write succeeded. Read more
fn write_fmt(&mut self, args: Arguments) -> Result<(), Error>
1.0.0[src]
Glue for usage of the [write!
] macro with implementors of this trait. Read more
Auto Trait Implementations
impl<D, B> Send for HD44780<D, B> where
B: Send,
D: Send,
B: Send,
D: Send,
impl<D, B> Sync for HD44780<D, B> where
B: Sync,
D: Sync,
B: Sync,
D: Sync,
Blanket Implementations
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> From for T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,