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.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.diozero.devices.LcdConnection
LcdConnection.GpioExpansionLcdConnection, LcdConnection.GpioLcdConnection, LcdConnection.OutputShiftRegisterLcdConnection, LcdConnection.PCF8574LcdConnection, LcdConnection.PiFaceCadLcdConnection
-
Constructor Summary
ConstructorDescriptionGpioExpansionLcdConnection
(GpioExpander gpioExpander, int port, boolean dataInHighNibble, int registerSelectBit, int dataReadWriteBit, int enableBit, int backlightBit) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
int
Identify the bit in the byte payload that refers to the backlight control flag 1=on, 0=off.int
Identify the bit in the byte payload that refers to the read/write flag.int
Identify the bit in the byte payload that refers to the enable flag to start read/write.int
Identify the bit in the byte payload that refers to the register select flag.boolean
Control whether the data bits are in the first or last 4-bitsvoid
write
(byte values)
-
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 interfaceLcdConnection
-
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 interfaceLcdConnection
- 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 interfaceLcdConnection
- 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 interfaceLcdConnection
- 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 interfaceLcdConnection
- 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 interfaceLcdConnection
- Returns:
- the backlight control bit number
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceLcdConnection
- Throws:
RuntimeIOException
-