Struct hd44780_hal::HD44780[][src]

pub struct HD44780<D: DelayUs<u16> + DelayMs<u8>, B: DataBus> { /* fields omitted */ }

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]

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]

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]

Unshifts the display and sets the cursor position to 0

lcd.reset();

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);

Clear the entire display

lcd.clear();

Set the cursor position

// Move to line 2
lcd.set_cursor_pos(40)

Shift just the cursor to the left or the right

lcd.shift_cursor(Direction::Left);
lcd.shift_cursor(Direction::Right);

Shift the entire display to the left or the right

lcd.shift_display(Direction::Left);
lcd.shift_display(Direction::Right);

Writes an entire string to the HD44780

lcd.write_str("Hello, world!");

Write a single character to the HD44780

lcd.write_char('A');

Auto Trait Implementations

impl<D, B> Send for HD44780<D, B> where
    B: Send,
    D: Send

impl<D, B> Sync for HD44780<D, B> where
    B: Sync,
    D: Sync