de.wagner_ibw.iow.lcd
Class DoubleLCDImpl

java.lang.Object
  |
  +--de.wagner_ibw.iow.lcd.LCDImpl
        |
        +--de.wagner_ibw.iow.lcd.DoubleLCDImpl
All Implemented Interfaces:
LCD, SpecialModeFunction
Direct Known Subclasses:
LCD4x27, LCD4x40

public class DoubleLCDImpl
extends LCDImpl

This is another implementation of the LCD special mode function. It supports only double controler LCD display. Additional hardware (74HCT02) and one IO-pin is needed.

Since:
0.9.4
Author:
Thomas Wagner

Field Summary
private  int currentEnable
           
private  int enableBit
           
private  int enablePort
           
 
Fields inherited from class de.wagner_ibw.iow.lcd.LCDImpl
charBlinking, cols, cursorOn, dispOn, iow, lineStartAdr, name, physicalRows, rows
 
Fields inherited from interface de.wagner_ibw.iow.SpecialModeFunction
SMF_CPS_ID, SMF_I2C_ID, SMF_LCD_ID, SMF_LED_ID, SMF_RC5_ID, SMF_SMX_ID, SMF_SPI_ID
 
Constructor Summary
DoubleLCDImpl(int enablePort, int enableBit)
           
 
Method Summary
 long clearLCD()
          OK Clears entire dislplay and sets DDRAM address 0 in address counter.
private  void enableE1()
           
private  void enableE2()
           
 void moveSprite(int row, java.lang.String[] sprites, int wait)
           
 long setCursor(int row, int col)
          OK Moves cursor to new Position.
 long setCursorDispOn()
          OK Convenient method: Turn LCD display on.
 long setCursorHome()
          OK Sets DDRAM address 0 in address counter.
 long setCursorOff()
          OK Convenient method: Turn LCD cursor off.
 long setCursorOn()
          OK Convenient method: Turn LCD cursor on.
 long setDisplayControl(boolean dispOn, boolean cursorOn, boolean charBlinking)
          OK Sets ON/OFF of all display (dispOn), cursor ON/OFF (cursorOn), and blink of cursor position character (cursorBlink).
 long setDispOff()
          OK Convenient method: Turn LCD display off.
 long setEntryMode(boolean moveForward, boolean shiftDisp)
          OK Sets cursor move direction and specifies display shift.
 void setIowDevice(AbstractIowDevcie iow)
          Sets the reference to an iow device for write report operations.
 long setShiftControl(boolean shiftDisp, boolean shiftDir)
          OK Moves cursor and shifts display whitout changing DDRAM contents.
 void setSpecialChar(int code, int[] pattern)
           
private  void toggleEnable()
           
private  long writeDoubleCmd(int cmd)
           
 void writeLine(int row, int col, boolean clear, java.lang.String str)
          Write the given String in the specified row and column.
 
Methods inherited from class de.wagner_ibw.iow.lcd.LCDImpl
check, checkCompatibility, getCols, getDisableReport, getEnableReport, getIowSpecialBits, getName, getReportIds, getRows, getSpecialModeFuncionId, initLCD, matchReportId, reportReceived, setCGRAMAddr, setCursorleft, setCursorRight, setDDRAMAddr, writeCmd, writeData, writeLine, writeString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

currentEnable

private int currentEnable

enablePort

private int enablePort

enableBit

private int enableBit
Constructor Detail

DoubleLCDImpl

public DoubleLCDImpl(int enablePort,
                     int enableBit)
Method Detail

clearLCD

public long clearLCD()
Description copied from interface: LCD
OK Clears entire dislplay and sets DDRAM address 0 in address counter.

Specified by:
clearLCD in interface LCD
Overrides:
clearLCD in class LCDImpl
Returns:
Number of written bytes (8 expected for a successful operation).

setCursorHome

public long setCursorHome()
Description copied from interface: LCD
OK Sets DDRAM address 0 in address counter. Also returns display from being shiftet to original position. DDRAM contents remain unchanged.

Specified by:
setCursorHome in interface LCD
Overrides:
setCursorHome in class LCDImpl
Returns:
Number of written bytes (8 expected for a successful operation).

setEntryMode

public long setEntryMode(boolean moveForward,
                         boolean shiftDisp)
Description copied from interface: LCD
OK Sets cursor move direction and specifies display shift. These operations are performed during data write and read.

Specified by:
setEntryMode in interface LCD
Overrides:
setEntryMode in class LCDImpl
Parameters:
moveForward - true: increment, false: decrement
shiftDisp - true: display is shifted, false: display is not shifted
Returns:
Number of written bytes (8 expected for a successful operation).

setDisplayControl

public long setDisplayControl(boolean dispOn,
                              boolean cursorOn,
                              boolean charBlinking)
Description copied from interface: LCD
OK Sets ON/OFF of all display (dispOn), cursor ON/OFF (cursorOn), and blink of cursor position character (cursorBlink).

Specified by:
setDisplayControl in interface LCD
Overrides:
setDisplayControl in class LCDImpl
Parameters:
dispOn - true: the display is on, false: display is off
cursorOn - true: cursor is displayed, false: cursor is not displayed
charBlinking - true: the character indicated by the cursor blinks, false: blinks not
Returns:
Number of written bytes (8 expected for a successful operation).

setShiftControl

public long setShiftControl(boolean shiftDisp,
                            boolean shiftDir)
Description copied from interface: LCD
OK Moves cursor and shifts display whitout changing DDRAM contents.

Specified by:
setShiftControl in interface LCD
Overrides:
setShiftControl in class LCDImpl
Parameters:
shiftDisp - true: display shift, false: cursor move;
shiftDir - true: shift to the right, false: shift to the left
Returns:
Number of written bytes (8 expected for a successful operation).

writeLine

public void writeLine(int row,
                      int col,
                      boolean clear,
                      java.lang.String str)
               throws java.lang.IllegalArgumentException
Description copied from interface: LCD
Write the given String in the specified row and column. If parm clear is true the row will be cleared before output. All characters exceeding the cols will be truncated.

Specified by:
writeLine in interface LCD
Overrides:
writeLine in class LCDImpl
Parameters:
row -
clear -
str -
java.lang.IllegalArgumentException

setCursor

public long setCursor(int row,
                      int col)
               throws java.lang.IllegalArgumentException
Description copied from class: LCDImpl
OK Moves cursor to new Position.

Specified by:
setCursor in interface LCD
Overrides:
setCursor in class LCDImpl
Parameters:
row - display line (1...4)
col - column in row (1...40)
java.lang.IllegalArgumentException

setCursorDispOn

public long setCursorDispOn()
Description copied from class: LCDImpl
OK Convenient method: Turn LCD display on.

Specified by:
setCursorDispOn in interface LCD
Overrides:
setCursorDispOn in class LCDImpl
Returns:
Number of written bytes (8 expected for a successful operation).

setDispOff

public long setDispOff()
Description copied from class: LCDImpl
OK Convenient method: Turn LCD display off.

Specified by:
setDispOff in interface LCD
Overrides:
setDispOff in class LCDImpl
Returns:
Number of written bytes (8 expected for a successful operation).

setCursorOn

public long setCursorOn()
Description copied from class: LCDImpl
OK Convenient method: Turn LCD cursor on.

Specified by:
setCursorOn in interface LCD
Overrides:
setCursorOn in class LCDImpl
Returns:
Number of written bytes (8 expected for a successful operation).

setCursorOff

public long setCursorOff()
Description copied from class: LCDImpl
OK Convenient method: Turn LCD cursor off.

Specified by:
setCursorOff in interface LCD
Overrides:
setCursorOff in class LCDImpl
Returns:
Number of written bytes (8 expected for a successful operation).

setSpecialChar

public void setSpecialChar(int code,
                           int[] pattern)
                    throws java.lang.IllegalArgumentException
Specified by:
setSpecialChar in interface LCD
Overrides:
setSpecialChar in class LCDImpl
java.lang.IllegalArgumentException

moveSprite

public void moveSprite(int row,
                       java.lang.String[] sprites,
                       int wait)
                throws java.lang.IllegalArgumentException
Specified by:
moveSprite in interface LCD
Overrides:
moveSprite in class LCDImpl
java.lang.IllegalArgumentException

setIowDevice

public void setIowDevice(AbstractIowDevcie iow)
Description copied from interface: SpecialModeFunction
Sets the reference to an iow device for write report operations.

Specified by:
setIowDevice in interface SpecialModeFunction
Overrides:
setIowDevice in class LCDImpl
Parameters:
iow - Instance of an iow device.

writeDoubleCmd

private long writeDoubleCmd(int cmd)

enableE1

private void enableE1()

enableE2

private void enableE2()

toggleEnable

private void toggleEnable()