Package com.diozero.devices
Class HD44780Lcd.GpioExpansionLcdConnection
- java.lang.Object
-
- com.diozero.devices.HD44780Lcd.GpioExpansionLcdConnection
-
- All Implemented Interfaces:
HD44780Lcd.LcdConnection
,AutoCloseable
- Direct Known Subclasses:
HD44780Lcd.OutputShiftRegisterLcdConnection
,HD44780Lcd.PCF8574LcdConnection
,HD44780Lcd.PiFaceCadLcdConnection
- Enclosing class:
- HD44780Lcd
public abstract static class HD44780Lcd.GpioExpansionLcdConnection extends Object implements HD44780Lcd.LcdConnection
For connections via a GPIO expansion board.
-
-
Constructor Summary
Constructors Constructor Description GpioExpansionLcdConnection(GpioExpander gpioExpander, int port, boolean dataInHighNibble, int registerSelectBit, int dataReadWriteBit, int enableBit, int backlightBit)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
int
getBacklightBit()
Identify the bit in the byte payload that refers to the backlight control flag 1=on, 0=off.int
getDataReadWriteBit()
Identify the bit in the byte payload that refers to the read/write flag.int
getEnableBit()
Identify the bit in the byte payload that refers to the enable flag to start read/write.int
getRegisterSelectBit()
Identify the bit in the byte payload that refers to the register select flag.boolean
isDataInHighNibble()
Control whether the data bits in the first or last 4-bitsvoid
write(byte values)
-
-
-
Constructor Detail
-
GpioExpansionLcdConnection
public GpioExpansionLcdConnection(GpioExpander gpioExpander, int port, boolean dataInHighNibble, int registerSelectBit, int dataReadWriteBit, int enableBit, int backlightBit)
-
-
Method Detail
-
write
public void write(byte values)
- Specified by:
write
in interfaceHD44780Lcd.LcdConnection
-
isDataInHighNibble
public boolean isDataInHighNibble()
Description copied from interface:HD44780Lcd.LcdConnection
Control whether the data bits in the first or last 4-bits- Specified by:
isDataInHighNibble
in interfaceHD44780Lcd.LcdConnection
- Returns:
- true if the data bits are in the high nibble (bits 4:7)
-
getRegisterSelectBit
public int getRegisterSelectBit()
Description copied from interface:HD44780Lcd.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 interfaceHD44780Lcd.LcdConnection
- Returns:
- the register select flag bit number
-
getDataReadWriteBit
public int getDataReadWriteBit()
Description copied from interface:HD44780Lcd.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 interfaceHD44780Lcd.LcdConnection
- Returns:
- the read/write flag bit number
-
getEnableBit
public int getEnableBit()
Description copied from interface:HD44780Lcd.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 interfaceHD44780Lcd.LcdConnection
- Returns:
- the enable flag bit number
-
getBacklightBit
public int getBacklightBit()
Description copied from interface:HD44780Lcd.LcdConnection
Identify the bit in the byte payload that refers to the backlight control flag 1=on, 0=off.- Specified by:
getBacklightBit
in interfaceHD44780Lcd.LcdConnection
- Returns:
- the backlight control bit number
-
close
public void close() throws RuntimeIOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceHD44780Lcd.LcdConnection
- Throws:
RuntimeIOException
-
-