de.wagner_ibw.iow.lcd
Class AbstractLCD

java.lang.Object
  |
  +--de.wagner_ibw.iow.lcd.AbstractLCD
All Implemented Interfaces:
SpecialModeFunction
Direct Known Subclasses:
GLCD128x128, HD44780, LCD16x16Pio, LCD16x21, M50530Pio

public abstract class AbstractLCD
extends java.lang.Object
implements SpecialModeFunction

This is the interface for using alpha numerical LCD.

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
AbstractLCD()
           
 
Method Summary
abstract  void check()
          Shows a test pattern on display.
abstract  java.lang.String checkCompatibility(int id, int rev, int specialModes)
          Checks if it is possible to activate this special mode function.
abstract  void clearLCD()
          Clears entire dislplay and sets DDRAM address 0 in address counter.
 int getCols()
           
abstract  int[] getDisableReport()
          Returns the report that disables the special mode function.
abstract  int[] getEnableReport()
          Returns the report that enables the special mode function.
abstract  int[] getIowSpecialBits(int deviceIdentifier)
          Returns an array of bitmask(s) for port 0...1, 0...3 or 0...6 if this special mode function runs on this iow device.
abstract  java.lang.String getName()
          Returns the name of the special mode function.
abstract  int[] getReportIds()
          Returns the report id(s) which the implementation is interested in.
 int getRows()
           
abstract  int getSpecialModeFuncionId()
          Returns the special mode function id for this implementation.
abstract  boolean matchReportId(int reportId)
          Checks if this implementation is interested in this report.
abstract  void moveSprite(int row, java.lang.String[] sprites, int wait)
           
abstract  void reportReceived(int[] readBuffer)
          Callback method is called when a matching report was received.
abstract  void setCursor(int row, int col)
          Moves cursor to new Position.
abstract  void setCursorDispOn()
          Convenient method: Turn LCD display on.
abstract  void setCursorHome()
          Sets DDRAM address 0 in address counter.
abstract  void setCursorleft()
          Move LCD cursor to the left
abstract  void setCursorOff()
          Convenient method: Turn LCD cursor off.
abstract  void setCursorOn()
          Convenient method: Turn LCD cursor on.
abstract  void setCursorRight()
          Move LCD cursor to the right
abstract  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).
abstract  void setDispOff()
          Convenient method: Turn LCD display off.
abstract  void setEntryMode(boolean moveForward, boolean shiftDisp)
          Sets cursor move direction and specifies display shift.
abstract  void setIowDevice(AbstractIowDevice iow)
          Sets the reference to the underlying iow device for write report operations.
abstract  void setShiftControl(boolean shiftDisp, boolean shiftDir)
          Moves cursor and shifts display whitout changing DDRAM contents.
abstract  void setSpecialChar(int code, int[] pattern)
          Sets a special char in CGRAM.
abstract  void writeLine(int row, boolean clear, java.lang.String str)
          Write the given String in row specified by parm row.
abstract  void writeLine(int row, int col, boolean clear, java.lang.String str)
          Write the given String in the specified row and column.
abstract  void writeString(java.lang.String str)
          Write the given string to LCD.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractLCD

public AbstractLCD()
Method Detail

getRows

public int getRows()

getCols

public int getCols()

clearLCD

public abstract void clearLCD()
Clears entire dislplay and sets DDRAM address 0 in address counter.


setCursorHome

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


setEntryMode

public abstract void setEntryMode(boolean moveForward,
                                  boolean shiftDisp)
Sets cursor move direction and specifies display shift. These operations are performed during data write and read.

Parameters:
moveForward - true: increment, false: decrement
shiftDisp - true: display is shifted, false: display is not shifted

setDisplayControl

public abstract 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).

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 abstract void setShiftControl(boolean shiftDisp,
                                     boolean shiftDir)
Moves cursor and shifts display whitout changing DDRAM contents.

Parameters:
shiftDisp - true: display shift, false: cursor move;
shiftDir - true: shift to the right, false: shift to the left

writeLine

public abstract void writeLine(int row,
                               boolean clear,
                               java.lang.String str)
                        throws java.lang.IllegalArgumentException
Write the given String in row specified by parm row. If parm clear is true the row will be cleared before output. All characters exceeding cols will be truncated.

Parameters:
row -
clear -
str -
java.lang.IllegalArgumentException

writeLine

public abstract void writeLine(int row,
                               int col,
                               boolean clear,
                               java.lang.String str)
                        throws java.lang.IllegalArgumentException
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.

Parameters:
row -
clear -
str -
java.lang.IllegalArgumentException

writeString

public abstract void writeString(java.lang.String str)
Write the given string to LCD.

Parameters:
str - String to write

setCursor

public abstract void setCursor(int row,
                               int col)
                        throws java.lang.IllegalArgumentException
Moves cursor to new Position.

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

setCursorDispOn

public abstract void setCursorDispOn()
Convenient method: Turn LCD display on.


setDispOff

public abstract void setDispOff()
Convenient method: Turn LCD display off.


setCursorOn

public abstract void setCursorOn()
Convenient method: Turn LCD cursor on.


setCursorOff

public abstract void setCursorOff()
Convenient method: Turn LCD cursor off.


setCursorleft

public abstract void setCursorleft()
Move LCD cursor to the left


setCursorRight

public abstract void setCursorRight()
Move LCD cursor to the right


check

public abstract void check()
Shows a test pattern on display.


setSpecialChar

public abstract void setSpecialChar(int code,
                                    int[] pattern)
                             throws java.lang.IllegalArgumentException
Sets a special char in CGRAM.

Parameters:
code -
pattern -
Throws:
java.lang.IllegalArgumentException

moveSprite

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

checkCompatibility

public abstract java.lang.String checkCompatibility(int id,
                                                    int rev,
                                                    int specialModes)
Description copied from interface: SpecialModeFunction
Checks if it is possible to activate this special mode function. This depends on id and/or rev of the iow device and/or already activated special mode functions.

Specified by:
checkCompatibility in interface SpecialModeFunction
Parameters:
id - Id of the current IO-Warrior device.
rev - Rev of the current IO-Warrior device.
specialModes - Special modes from the current IO-Warrior device.
Returns:
Error string if special mode function is not available. Returns null if special mode function is available.

getDisableReport

public abstract int[] getDisableReport()
Description copied from interface: SpecialModeFunction
Returns the report that disables the special mode function.

Specified by:
getDisableReport in interface SpecialModeFunction
Returns:
Special mode function disable report.

getEnableReport

public abstract int[] getEnableReport()
Description copied from interface: SpecialModeFunction
Returns the report that enables the special mode function.

Specified by:
getEnableReport in interface SpecialModeFunction
Returns:
Special mode function enable report.

getIowSpecialBits

public abstract int[] getIowSpecialBits(int deviceIdentifier)
Description copied from interface: SpecialModeFunction
Returns an array of bitmask(s) for port 0...1, 0...3 or 0...6 if this special mode function runs on this iow device. Returns a array of lenght zero if no bits used by this special mode function. 1 means this bit is dedicated by special mode function. 0 means this bit is free for normal pin io operations.

Specified by:
getIowSpecialBits in interface SpecialModeFunction
Parameters:
deviceIdentifier - Iow device identifier (AbstractIowDevice.IOW24ID<(code>, AbstractIowDevice.IOW24ID or AbstractIowDevice.IOW56ID).
Returns:
Array of int that contains bitmask(s) for special mode function bits.

getName

public abstract java.lang.String getName()
Description copied from interface: SpecialModeFunction
Returns the name of the special mode function.

Specified by:
getName in interface SpecialModeFunction
Returns:
Name of the special mode function.

getReportIds

public abstract int[] getReportIds()
Description copied from interface: SpecialModeFunction
Returns the report id(s) which the implementation is interested in.

Specified by:
getReportIds in interface SpecialModeFunction
Returns:
Int array of special mode function id(s).

getSpecialModeFuncionId

public abstract int getSpecialModeFuncionId()
Description copied from interface: SpecialModeFunction
Returns the special mode function id for this implementation.

Specified by:
getSpecialModeFuncionId in interface SpecialModeFunction
Returns:
Special mode function id (SMF_LCD_ID,SMF_RC5_ID,SMF_I2C_ID,SMF_CPS_ID,SMF_SPI_ID).

matchReportId

public abstract boolean matchReportId(int reportId)
Description copied from interface: SpecialModeFunction
Checks if this implementation is interested in this report.

Specified by:
matchReportId in interface SpecialModeFunction
Parameters:
reportId - Report id of the received report.
Returns:
True if it fits or false if not.

reportReceived

public abstract void reportReceived(int[] readBuffer)
Description copied from interface: SpecialModeFunction
Callback method is called when a matching report was received.

Specified by:
reportReceived in interface SpecialModeFunction
Parameters:
readBuffer - Read buffer from a received report.

setIowDevice

public abstract 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
Parameters:
iow - Instance of an iow device.