Class HD44780Lcd.GpioLcdConnection

  • All Implemented Interfaces:
    HD44780Lcd.LcdConnection, AutoCloseable
    Enclosing class:
    HD44780Lcd

    public static class HD44780Lcd.GpioLcdConnection
    extends Object
    implements HD44780Lcd.LcdConnection
    Connect via individual GPIO pins, uses 4-bit mode (data pins D4-D7). Wiring (from left-to-right):
     Vss: GND
     Vdd: 5v
     V0: Contrast adjustment (connect to Vdd for full brightness)
     RS: Register Select - GPIO
     RW: Data read/write (not required, read mode not used - can connect to GND)
     E: Enable - GPIO
     D0-D3: Don't connect (currently only 4-bit mode is supported)
     D4-D7: Data pins - GPIO
     A: Backlight LED Cathode (+) - GPIO (need to check 3v3/5v) or Vdd (always on)
     K: Backlight LED Anode (-) - GND
     
    • Constructor Detail

      • GpioLcdConnection

        public GpioLcdConnection​(int d4,
                                 int d5,
                                 int d6,
                                 int d7,
                                 int enableGpio,
                                 int registerSelectGpio)
        Use the default device factory and specify GPIO numbers. Assumes the RW pin is pulled low and the backlight pin pulled high.
        Parameters:
        d4 - GPIO number for d4 pin
        d5 - GPIO number for d5 pin
        d6 - GPIO number for d6 pin
        d7 - GPIO number for d7 pin
        enableGpio - enable GPIO number
        registerSelectGpio - register select GPIO number
      • GpioLcdConnection

        public GpioLcdConnection​(int d4,
                                 int d5,
                                 int d6,
                                 int d7,
                                 int backlightGpio,
                                 int enableGpio,
                                 int registerSelectGpio)
        Use the default device factory and specify GPIO numbers. Assumes the RW pin is pulled low.
        Parameters:
        d4 - GPIO number for d4 pin
        d5 - GPIO number for d5 pin
        d6 - GPIO number for d6 pin
        d7 - GPIO number for d7 pin
        backlightGpio - backlight control GPIO number (set to -1 if not connected)
        enableGpio - enable GPIO number
        registerSelectGpio - register select GPIO number
      • GpioLcdConnection

        public GpioLcdConnection​(int d4,
                                 int d5,
                                 int d6,
                                 int d7,
                                 int backlightGpio,
                                 int enableGpio,
                                 int dataRwGpio,
                                 int registerSelectGpio)
        Use the default device factory and specify GPIO numbers.
        Parameters:
        d4 - GPIO number for d4 pin
        d5 - GPIO number for d5 pin
        d6 - GPIO number for d6 pin
        d7 - GPIO number for d7 pin
        backlightGpio - backlight control GPIO number (set to -1 if not connected)
        enableGpio - enable GPIO number
        dataRwGpio - data read/write GPIO number (not used - connect to GND, set to -1 if not connected)
        registerSelectGpio - register select GPIO number
      • GpioLcdConnection

        public GpioLcdConnection​(GpioDeviceFactoryInterface deviceFactory,
                                 int d4,
                                 int d5,
                                 int d6,
                                 int d7,
                                 int backlightGpio,
                                 int enableGpio,
                                 int dataRwGpio,
                                 int registerSelectGpio)
        Use the specified device factory and specify GPIO numbers.
        Parameters:
        deviceFactory - the device factory to use for provisioning the GPIOs
        d4 - GPIO number for d4 pin
        d5 - GPIO number for d5 pin
        d6 - GPIO number for d6 pin
        d7 - GPIO number for d7 pin
        backlightGpio - backlight control GPIO number (set to -1 if not connected)
        enableGpio - enable GPIO number
        dataRwGpio - data read/write GPIO number (not used - connect to GND, set to -1 if not connected)
        registerSelectGpio - register select GPIO number
      • GpioLcdConnection

        public GpioLcdConnection​(DigitalOutputDevice d4,
                                 DigitalOutputDevice d5,
                                 DigitalOutputDevice d6,
                                 DigitalOutputDevice d7,
                                 DigitalOutputDevice backlightPin,
                                 DigitalOutputDevice enablePin,
                                 DigitalOutputDevice dataRwPin,
                                 DigitalOutputDevice registerSelectPin)
        Use the specified digital output devices.
        Parameters:
        d4 - Digital output device for d4 pin
        d5 - Digital output device for d5 pin
        d6 - Digital output device for d6 pin
        d7 - Digital output device for d7 pin
        backlightPin - backlight control digital output device (set to null if not connected)
        enablePin - enable digital output device
        dataRwPin - data read/write digital output device (not used - connect to GND, set to null if not connected)
        registerSelectPin - register select digital output device