de.wagner_ibw.iow
Interface SpecialModeFunction

All Known Implementing Classes:
AbstractLCD, I2C, RC5, SPI, SwitchMatrix

public interface SpecialModeFunction

Interface for special mode function implementations.

Author:
Thomas Wagner

Field Summary
static int SMF_CPS_ID
          Special mode function id for current pin status special mode function.
static int SMF_I2C_ID
          Special mode function id for I2C special mode function.
static int SMF_LCD_ID
          Special mode function id for LCD special mode function.
static int SMF_LED_ID
          Special mode function id for Led Matrix special mode function.
static int SMF_RC5_ID
          Special mode function id for RC5 special mode function.
static int SMF_SMX_ID
          Special mode function id for Switch Matrix (SMX) special mode function.
static int SMF_SPI_ID
          Special mode function id for SPI special mode function.
 
Method Summary
 java.lang.String checkCompatibility(int id, int rev, int specialModes)
          Checks if it is possible to activate this special mode function.
 int[] getDisableReport()
          Returns the report that disables the special mode function.
 int[] getEnableReport()
          Returns the report that enables the special mode function.
 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.
 java.lang.String getName()
          Returns the name of the special mode function.
 int[] getReportIds()
          Returns the report id(s) which the implementation is interested in.
 int getSpecialModeFuncionId()
          Returns the special mode function id for this implementation.
 boolean matchReportId(int reportId)
          Checks if this implementation is interested in this report.
 void reportReceived(int[] readBuffer)
          Callback method is called when a matching report was received.
 void setIowDevice(AbstractIowDevice iow)
          Sets the reference to the underlying iow device for write report operations.
 

Field Detail

SMF_LCD_ID

public static final int SMF_LCD_ID
Special mode function id for LCD special mode function.

See Also:
Constant Field Values

SMF_RC5_ID

public static final int SMF_RC5_ID
Special mode function id for RC5 special mode function.

See Also:
Constant Field Values

SMF_I2C_ID

public static final int SMF_I2C_ID
Special mode function id for I2C special mode function.

See Also:
Constant Field Values

SMF_CPS_ID

public static final int SMF_CPS_ID
Special mode function id for current pin status special mode function.

See Also:
Constant Field Values

SMF_SPI_ID

public static final int SMF_SPI_ID
Special mode function id for SPI special mode function.

See Also:
Constant Field Values

SMF_SMX_ID

public static final int SMF_SMX_ID
Special mode function id for Switch Matrix (SMX) special mode function.

Since:
0.9.4
See Also:
Constant Field Values

SMF_LED_ID

public static final int SMF_LED_ID
Special mode function id for Led Matrix special mode function. (Prepared for further use).

Since:
0.9.x
See Also:
Constant Field Values
Method Detail

getSpecialModeFuncionId

public int getSpecialModeFuncionId()
Returns the special mode function id for this implementation.

Returns:
Special mode function id (SMF_LCD_ID,SMF_RC5_ID,SMF_I2C_ID,SMF_CPS_ID,SMF_SPI_ID).

getReportIds

public int[] getReportIds()
Returns the report id(s) which the implementation is interested in.

Returns:
Int array of special mode function id(s).

reportReceived

public void reportReceived(int[] readBuffer)
Callback method is called when a matching report was received.

Parameters:
readBuffer - Read buffer from a received report.

matchReportId

public boolean matchReportId(int reportId)
Checks if this implementation is interested in this report.

Parameters:
reportId - Report id of the received report.
Returns:
True if it fits or false if not.

setIowDevice

public void setIowDevice(AbstractIowDevice iow)
Sets the reference to the underlying iow device for write report operations.

Parameters:
iow - Instance of an iow device.

getIowSpecialBits

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

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.
Since:
0.9.4

getEnableReport

public int[] getEnableReport()
Returns the report that enables the special mode function.

Returns:
Special mode function enable report.

getDisableReport

public int[] getDisableReport()
Returns the report that disables the special mode function.

Returns:
Special mode function disable report.

checkCompatibility

public java.lang.String checkCompatibility(int id,
                                           int rev,
                                           int specialModes)
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.

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.
Since:
0.9.4

getName

public java.lang.String getName()
Returns the name of the special mode function.

Returns:
Name of the special mode function.
Since:
0.9.4