Module diozero.core

Class LcdConnection.GpioExpansionLcdConnection

java.lang.Object
com.diozero.devices.LcdConnection.GpioExpansionLcdConnection
All Implemented Interfaces:
LcdConnection, AutoCloseable
Direct Known Subclasses:
LcdConnection.OutputShiftRegisterLcdConnection, LcdConnection.PCF8574LcdConnection, LcdConnection.PiFaceCadLcdConnection
Enclosing interface:
LcdConnection

public abstract static class LcdConnection.GpioExpansionLcdConnection extends Object implements LcdConnection
For connections via a GPIO expansion board.
  • Constructor Details

    • GpioExpansionLcdConnection

      public GpioExpansionLcdConnection(GpioExpander gpioExpander, int port, boolean dataInHighNibble, int registerSelectBit, int dataReadWriteBit, int enableBit, int backlightBit)
  • Method Details

    • write

      public void write(byte values)
      Specified by:
      write in interface LcdConnection
    • isDataInHighNibble

      public boolean isDataInHighNibble()
      Description copied from interface: LcdConnection
      Control whether the data bits are in the first or last 4-bits
      Specified by:
      isDataInHighNibble in interface LcdConnection
      Returns:
      true if the data bits are in the high nibble (bits 4:7)
    • getRegisterSelectBit

      public int getRegisterSelectBit()
      Description copied from interface: LcdConnection
      Identify the bit in the byte payload that refers to the register select flag.

      RS=0: Command, RS=1: Data

      Specified by:
      getRegisterSelectBit in interface LcdConnection
      Returns:
      the register select flag bit number
    • getDataReadWriteBit

      public int getDataReadWriteBit()
      Description copied from interface: LcdConnection
      Identify the bit in the byte payload that refers to the read/write flag. Not implemented.

      R/W=0: Write, R/W=1: Read

      Specified by:
      getDataReadWriteBit in interface LcdConnection
      Returns:
      the read/write flag bit number
    • getEnableBit

      public int getEnableBit()
      Description copied from interface: LcdConnection
      Identify the bit in the byte payload that refers to the enable flag to start read/write.

      Falling edge triggered

      Specified by:
      getEnableBit in interface LcdConnection
      Returns:
      the enable flag bit number
    • getBacklightBit

      public int getBacklightBit()
      Description copied from interface: LcdConnection
      Identify the bit in the byte payload that refers to the backlight control flag 1=on, 0=off.
      Specified by:
      getBacklightBit in interface LcdConnection
      Returns:
      the backlight control bit number
    • close

      public void close() throws RuntimeIOException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface LcdConnection
      Throws:
      RuntimeIOException