[−][src]Struct hd44780_ntb::GpioDriver
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]
RS: OutputPin,
EN: OutputPin,
DP: OutputPin,
D: DelayUs<u16>,
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]
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>,
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]
RS: OutputPin,
EN: OutputPin,
DP: OutputPin,
D: DelayUs<u16>,
impl<RS, EN, DP, D> HD44780 for GpioDriver<RS, EN, DP, D> where
RS: OutputPin,
EN: OutputPin,
DP: OutputPin,
D: DelayUs<u16>,
[src]
RS: OutputPin,
EN: OutputPin,
DP: OutputPin,
D: DelayUs<u16>,
const COMMAND_DELAY: u16
[src]
fn command(&mut self, byte: u8, delay: u16) -> Result
[src]
fn init<FSM, DCM, EMSM>(
&mut self,
fs_mode: FSM,
dc_mode: DCM,
ems_mode: EMSM
) -> Result where
FSM: Into<Option<FunctionMode>>,
DCM: Into<Option<DisplayMode>>,
EMSM: Into<Option<EntryMode>>,
[src]
&mut self,
fs_mode: FSM,
dc_mode: DCM,
ems_mode: EMSM
) -> Result where
FSM: Into<Option<FunctionMode>>,
DCM: Into<Option<DisplayMode>>,
EMSM: Into<Option<EntryMode>>,
fn clear_display(&mut self) -> Result
[src]
fn cursor_shift(&mut self, mode: ShiftMode) -> Result
[src]
fn display_control(&mut self, mode: DisplayMode) -> Result
[src]
fn entry_mode_set(&mut self, mode: EntryMode) -> Result
[src]
fn function_set(&mut self, mode: FunctionMode) -> Result
[src]
fn return_home(&mut self) -> Result
[src]
fn set_cg_ram_addr(&mut self, address: u8) -> Result
[src]
fn set_dd_ram_addr(&mut self, address: u8) -> Result
[src]
const CLEAR_DISPLAY: u8
[src]
const CURSOR_SHIFT: u8
[src]
const DISPLAY_CONTROL: u8
[src]
const ENTRY_MODE_SET: u8
[src]
const FUNCTION_SET: u8
[src]
const RETURN_HOME: u8
[src]
const SET_CG_RAM_ADDR: u8
[src]
const SET_DD_RAM_ADDR: u8
[src]
impl<RS, EN, DP, D> Write for GpioDriver<RS, EN, DP, D> where
RS: OutputPin,
EN: OutputPin,
DP: OutputPin,
D: DelayUs<u16>,
[src]
RS: OutputPin,
EN: OutputPin,
DP: OutputPin,
D: DelayUs<u16>,
fn write(&mut self, buf: &[u8]) -> Result<usize>
[src]
fn flush(&mut self) -> Result<()>
[src]
fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> Result<usize, Error>
1.36.0[src]
fn is_write_vectored(&self) -> bool
[src]
fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
1.0.0[src]
fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
[src]
fn write_fmt(&mut self, fmt: Arguments<'_>) -> Result<(), Error>
1.0.0[src]
fn by_ref(&mut self) -> &mut Self
1.0.0[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,
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,
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,
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,
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,
D: UnwindSafe,
DP: UnwindSafe,
EN: UnwindSafe,
RS: UnwindSafe,
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,
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.
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>,