[][src]Struct hd44780_ntb::GpioDriver

pub struct GpioDriver<RS, EN, DP, D> where
    RS: OutputPin,
    EN: OutputPin,
    DP: OutputPin,
    D: DelayUs<u16>, 
{ /* fields omitted */ }

This is the driver used for direct GPIO pin connected HD44780 displays.

The HD44780 display normally has a 16 inline connector. The only pins of concern in this driver are the RS, E, and the data bus pins D0 through D7. When the display is going to be used with a 4 bit (pin) data bus make sure the data output pins are connected to D4 through D7 and NOT to the lower data pins D0 through D4.

Remarks

This driver assumes that the RW input on the display is pulled to GND forcing the display into Write mode at all times.

The driver can be switched between 4 and 8 bit (pin) interface by just changing the number of pins given in data parameter to the new() function when creating a new instance.

Implementations

impl<RS, EN, DP, D> GpioDriver<RS, EN, DP, D> where
    RS: OutputPin,
    EN: OutputPin,
    DP: OutputPin,
    D: DelayUs<u16>, 
[src]

pub fn new(rs: RS, e: EN, data: Vec<DP>, delay: D) -> GpioDriver<RS, EN, DP, D>

Notable traits for GpioDriver<RS, EN, DP, D>

impl<RS, EN, DP, D> Write for GpioDriver<RS, EN, DP, D> where
    RS: OutputPin,
    EN: OutputPin,
    DP: OutputPin,
    D: DelayUs<u16>, 
[src]

Create a new instance of driver.

The HD44780 display normally has a 16 inline connector.

Arguments

  • rs - An already setup output GPIO pin that is connected to the register select input on display.
  • e - An already setup output GPIO pin that is connected to the enable input on display.
  • data - An already setup array or Vec of GPIO output pins that are connected to the data inputs of the display. Only 4 or 8 pins should be used.

Examples

For examples of using the driver in both 4 and 8 bit modes have look at the Raspberry Pi 4 bit and Raspberry Pi 8 bit examples.

Trait Implementations

impl<RS: Debug, EN: Debug, DP: Debug, D: Debug> Debug for GpioDriver<RS, EN, DP, D> where
    RS: OutputPin,
    EN: OutputPin,
    DP: OutputPin,
    D: DelayUs<u16>, 
[src]

impl<RS, EN, DP, D> HD44780 for GpioDriver<RS, EN, DP, D> where
    RS: OutputPin,
    EN: OutputPin,
    DP: OutputPin,
    D: DelayUs<u16>, 
[src]

impl<RS, EN, DP, D> Write for GpioDriver<RS, EN, DP, D> where
    RS: OutputPin,
    EN: OutputPin,
    DP: OutputPin,
    D: DelayUs<u16>, 
[src]

Auto Trait Implementations

impl<RS, EN, DP, D> RefUnwindSafe for GpioDriver<RS, EN, DP, D> where
    D: RefUnwindSafe,
    DP: RefUnwindSafe,
    EN: RefUnwindSafe,
    RS: RefUnwindSafe

impl<RS, EN, DP, D> Send for GpioDriver<RS, EN, DP, D> where
    D: Send,
    DP: Send,
    EN: Send,
    RS: Send

impl<RS, EN, DP, D> Sync for GpioDriver<RS, EN, DP, D> where
    D: Sync,
    DP: Sync,
    EN: Sync,
    RS: Sync

impl<RS, EN, DP, D> Unpin for GpioDriver<RS, EN, DP, D> where
    D: Unpin,
    DP: Unpin,
    EN: Unpin,
    RS: Unpin

impl<RS, EN, DP, D> UnwindSafe for GpioDriver<RS, EN, DP, D> where
    D: UnwindSafe,
    DP: UnwindSafe,
    EN: UnwindSafe,
    RS: UnwindSafe

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.