Class Pcf8574LcdAdapter
java.lang.Object
com.ibasco.ucgdisplay.drivers.clcd.BaseLcdGpioAdapter
com.ibasco.ucgdisplay.drivers.clcd.adapters.Pcf8574LcdAdapter
- All Implemented Interfaces:
LcdGpioAdapter
PCF8574 Adapter
- Author:
- Rafael Ibasco
-
Constructor Summary
ConstructorDescriptionPcf8574LcdAdapter(com.pi4j.gpio.extension.pcf.PCF8574GpioProvider provider, LcdPinMapConfig pinMapConfig)
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Perform any necessary initialization.void
setEnableState(com.pi4j.io.gpio.PinState state)
Sets the LCD's Enable Pin statevoid
setReadWriteState(LcdReadWriteState state)
Sets the LCD's Read/Write Pin state.void
Sets the LCD's Register Select Pin stateprotected void
validate(LcdPinMapConfig pinMapConfig)
Verify that we have the required lcd pins mappedvoid
write4Bits(byte value)
Sends a 4-bit value to the interface.void
write8Bits(byte value)
Sends an 8-bit value to the interface.Methods inherited from class com.ibasco.ucgdisplay.drivers.clcd.BaseLcdGpioAdapter
getMappedPin, isMapped
-
Constructor Details
-
Pcf8574LcdAdapter
public Pcf8574LcdAdapter(com.pi4j.gpio.extension.pcf.PCF8574GpioProvider provider, LcdPinMapConfig pinMapConfig)
-
-
Method Details
-
validate
Description copied from class:BaseLcdGpioAdapter
Verify that we have the required lcd pins mapped- Specified by:
validate
in classBaseLcdGpioAdapter
- Throws:
InvalidPinMappingException
-
initialize
public void initialize()Description copied from interface:LcdGpioAdapter
Perform any necessary initialization. (e.g. Setting pinmodes of digital output pins) -
write4Bits
public void write4Bits(byte value)Description copied from interface:LcdGpioAdapter
Sends a 4-bit value to the interface.- Parameters:
value
- The 4-bit value to be transmitted over the LCD Interface
-
write8Bits
public void write8Bits(byte value)Description copied from interface:LcdGpioAdapter
Sends an 8-bit value to the interface.- Parameters:
value
- The 8-bit value to be transmitted over the LCD Interface
-
setRegSelectState
Description copied from interface:LcdGpioAdapter
Sets the LCD's Register Select Pin state- Parameters:
state
- The state of the Register Select Pin. Set to eitherLcdRegisterSelectState.COMMAND
orLcdRegisterSelectState.DATA
-
setReadWriteState
Description copied from interface:LcdGpioAdapter
Sets the LCD's Read/Write Pin state. Setting the state to WRITE will set the LCD RW pin to LOW while READ will set the LCD RW pin to HIGH.- Parameters:
state
- The state to set (READ/WRITE) for the LCD RW Pin
-
setEnableState
public void setEnableState(com.pi4j.io.gpio.PinState state)Description copied from interface:LcdGpioAdapter
Sets the LCD's Enable Pin state- Parameters:
state
- ThePinState
to set for the LCD Enable pin.
-