Class ShiftRegisterLcdAdapter

java.lang.Object
com.ibasco.ucgdisplay.drivers.clcd.BaseLcdGpioAdapter
com.ibasco.ucgdisplay.drivers.clcd.adapters.ShiftRegisterLcdAdapter
All Implemented Interfaces:
LcdGpioAdapter

public class ShiftRegisterLcdAdapter extends BaseLcdGpioAdapter
Shift Register LCD Adapter. Applicable only for Shift Out registers (e.g. 74HC595). Please note that daisy chained shift-out registers are not yet supported at this time.
Author:
Rafael Ibasco
  • Constructor Details

    • ShiftRegisterLcdAdapter

      public ShiftRegisterLcdAdapter(com.pi4j.io.gpio.GpioProvider provider, com.pi4j.io.gpio.Pin dataPin, com.pi4j.io.gpio.Pin latchPin, com.pi4j.io.gpio.Pin clockPin, LcdPinMapConfig lcdPinMap) throws IllegalArgumentException
      Default Constructor.
      Parameters:
      provider - The GpioProvider that will be driving the Data, Latch and Clock pins of the shift register
      dataPin - The data pin of the Shift Register
      latchPin - The latch pin of the Shift Register
      clockPin - The clock pin of the Shift Register
      lcdPinMap - The LcdPinMapConfig instance containing the pin mapping configuration
      Throws:
      IllegalArgumentException - Thrown when pin mapping validation fails
  • Method Details

    • initialize

      public void initialize()
      Description copied from interface: LcdGpioAdapter
      Perform any necessary initialization. (e.g. Setting pinmodes of digital output pins)
    • validate

      protected void validate(LcdPinMapConfig pinMapConfig) throws InvalidPinMappingException
      Description copied from class: BaseLcdGpioAdapter
      Verify that we have the required lcd pins mapped
      Specified by:
      validate in class BaseLcdGpioAdapter
      Throws:
      InvalidPinMappingException
    • 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

      public void setRegSelectState(LcdRegisterSelectState state)
      Description copied from interface: LcdGpioAdapter
      Sets the LCD's Register Select Pin state
      Parameters:
      state - The state of the Register Select Pin. Set to either LcdRegisterSelectState.COMMAND or LcdRegisterSelectState.DATA
    • setReadWriteState

      public void setReadWriteState(LcdReadWriteState state)
      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 - The PinState to set for the LCD Enable pin.