de.wagner_ibw.iow.lcd
Class DoubleHD44780Ahw

java.lang.Object
  |
  +--de.wagner_ibw.iow.lcd.AbstractLCD
        |
        +--de.wagner_ibw.iow.lcd.HD44780
              |
              +--de.wagner_ibw.iow.lcd.DoubleHD44780Ahw
All Implemented Interfaces:
SpecialModeFunction
Direct Known Subclasses:
LCD4x27Ahw, LCD4x40Ahw

public class DoubleHD44780Ahw
extends HD44780

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
 
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
DoubleHD44780Ahw(int enablePort, int enableBit)
           
 
Method Summary
 void clearLCD()
          Clears entire dislplay and sets DDRAM address 0 in address counter.
 void moveSprite(int row, java.lang.String[] sprites, int wait)
           
 void setCursor(int row, int col)
          OK Moves cursor to new Position.
 void setCursorDispOn()
          Convenient method: Turn LCD display on.
 void setCursorHome()
          Sets DDRAM address 0 in address counter.
 void setCursorOff()
          OK Convenient method: Turn LCD cursor off.
 void setCursorOn()
          OK Convenient method: Turn LCD cursor on.
 void setDisplayControl(boolean dispOn, boolean cursorOn, boolean charBlinking)
          Sets ON/OFF of all display (dispOn), cursor ON/OFF (cursorOn), and blink of cursor position character (cursorBlink).
 void setDispOff()
          OK Convenient method: Turn LCD display off.
 void setEntryMode(boolean moveForward, boolean shiftDisp)
          Sets cursor move direction and specifies display shift.
 void setIowDevice(AbstractIowDevice iow)
          Sets the reference to the underlying iow device for write report operations.
 void setShiftControl(boolean shiftDisp, boolean shiftDir)
          Moves cursor and shifts display whitout changing DDRAM contents.
 void setSpecialChar(int code, int[] pattern)
          Sets a special char in CGRAM.
 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.HD44780
check, checkCompatibility, getDisableReport, getEnableReport, getIowSpecialBits, getName, getReportIds, getSpecialModeFuncionId, matchReportId, reportReceived, setCGRAMAddr, setCursorleft, setCursorRight, setDDRAMAddr, writeLine, writeString
 
Methods inherited from class de.wagner_ibw.iow.lcd.AbstractLCD
getCols, getRows
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DoubleHD44780Ahw

public DoubleHD44780Ahw(int enablePort,
                        int enableBit)
Method Detail

clearLCD

public void clearLCD()
Description copied from class: AbstractLCD
Clears entire dislplay and sets DDRAM address 0 in address counter.

Overrides:
clearLCD in class HD44780

setCursorHome

public void setCursorHome()
Description copied from class: AbstractLCD
Sets DDRAM address 0 in address counter. Also returns display from being shiftet to original position. DDRAM contents remain unchanged.

Overrides:
setCursorHome in class HD44780

setEntryMode

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

Overrides:
setEntryMode in class HD44780
Parameters:
moveForward - true: increment, false: decrement
shiftDisp - true: display is shifted, false: display is not shifted

setDisplayControl

public void setDisplayControl(boolean dispOn,
                              boolean cursorOn,
                              boolean charBlinking)
Description copied from class: AbstractLCD
Sets ON/OFF of all display (dispOn), cursor ON/OFF (cursorOn), and blink of cursor position character (cursorBlink).

Overrides:
setDisplayControl in class HD44780
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

setShiftControl

public void setShiftControl(boolean shiftDisp,
                            boolean shiftDir)
Description copied from class: AbstractLCD
Moves cursor and shifts display whitout changing DDRAM contents.

Overrides:
setShiftControl in class HD44780
Parameters:
shiftDisp - true: display shift, false: cursor move;
shiftDir - true: shift to the right, false: shift to the left

writeLine

public void writeLine(int row,
                      int col,
                      boolean clear,
                      java.lang.String str)
               throws java.lang.IllegalArgumentException
Description copied from class: AbstractLCD
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 cols will be truncated.

Overrides:
writeLine in class HD44780
Parameters:
row -
clear -
str -
java.lang.IllegalArgumentException

setCursor

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

Overrides:
setCursor in class HD44780
Parameters:
row - display line (1...4)
col - column in row (1...40)
java.lang.IllegalArgumentException

setCursorDispOn

public void setCursorDispOn()
Description copied from class: HD44780
Convenient method: Turn LCD display on.

Overrides:
setCursorDispOn in class HD44780

setDispOff

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

Overrides:
setDispOff in class HD44780
Returns:
Number of written bytes (8 expected for a successful operation).

setCursorOn

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

Overrides:
setCursorOn in class HD44780
Returns:
Number of written bytes (8 expected for a successful operation).

setCursorOff

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

Overrides:
setCursorOff in class HD44780
Returns:
Number of written bytes (8 expected for a successful operation).

setSpecialChar

public void setSpecialChar(int code,
                           int[] pattern)
                    throws java.lang.IllegalArgumentException
Description copied from class: AbstractLCD
Sets a special char in CGRAM.

Overrides:
setSpecialChar in class HD44780
Parameters:
code -
pattern -
Throws:
java.lang.IllegalArgumentException

moveSprite

public void moveSprite(int row,
                       java.lang.String[] sprites,
                       int wait)
                throws java.lang.IllegalArgumentException
Overrides:
moveSprite in class HD44780
Parameters:
row -
sprites -
wait -
Throws:
java.lang.IllegalArgumentException

setIowDevice

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

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