Struct hd44780_hal::HD44780 [−][src]
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]
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>>
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]
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>>
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]
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>>
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]
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>>
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
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]
impl<D, B> HD44780<D, B> where
D: DelayUs<u16> + DelayMs<u8>,
B: DataBus,
pub fn reset(&mut self)
[src]
pub fn reset(&mut self)
Unshifts the display and sets the cursor position to 0
lcd.reset();
pub fn set_display_mode(
&mut self,
display_on: bool,
cursor_visible: bool,
cursor_blink: bool
)
[src]
pub fn set_display_mode(
&mut self,
display_on: bool,
cursor_visible: bool,
cursor_blink: bool
)
Set if the display should be on, if the cursor should be visible, and if the cursor should blink
// Set the display to be on, the cursor to be visible, and the cursor to be blinking. lcd.set_display_mode(true, true, true);
pub fn clear(&mut self)
[src]
pub fn clear(&mut self)
Clear the entire display
lcd.clear();
pub fn set_cursor_pos(&mut self, position: u8)
[src]
pub fn set_cursor_pos(&mut self, position: u8)
Set the cursor position
// Move to line 2 lcd.set_cursor_pos(40)
pub fn shift_cursor(&mut self, dir: Direction)
[src]
pub fn shift_cursor(&mut self, dir: Direction)
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]
pub fn shift_display(&mut self, dir: Direction)
Shift the entire display to the left or the right
lcd.shift_display(Direction::Left); lcd.shift_display(Direction::Right);
pub fn write_str(&mut self, string: &str)
[src]
pub fn write_str(&mut self, string: &str)
Writes an entire string to the HD44780
lcd.write_str("Hello, world!");
pub fn write_char(&mut self, data: char)
[src]
pub fn write_char(&mut self, data: char)
Write a single character to the HD44780
lcd.write_char('A');