|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--de.wagner_ibw.iow.i2c.I2C
Implementation of the I2C special mode function.
Field Summary | |
static int |
I2C_SPEED_100KHZ
|
static int |
I2C_SPEED_400KHZ
|
static int |
I2C_SPEED_50KHZ
|
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 | |
I2C()
Constructor |
|
I2C(int speed)
Constructor. |
Method Summary | |
void |
addI2CDevice(I2CDevice dev)
Adds i2c device implementation (e.g. an instance of LM75.java). |
java.lang.String |
checkCompatibility(int id,
int rev,
int specialModes)
Checks if it is possible to activate this special mode function. |
boolean |
equals(java.lang.Object o)
Indicates whether some other I2C object is "equal to" this one. |
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. |
int |
hashCode()
Returns a hash code value for this special mode function object. |
boolean |
matchReportId(int reportId)
Checks if this implementation is interested in this report. |
void |
removeI2CDevice(I2CDevice dev)
Removes i2c device implementation. |
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. |
java.lang.String |
toString()
Returns a string representation of the object. |
Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int I2C_SPEED_100KHZ
public static final int I2C_SPEED_400KHZ
public static final int I2C_SPEED_50KHZ
Constructor Detail |
public I2C()
public I2C(int speed)
speed
- I2C special mode function speed byte (only for IOW56).Method Detail |
public void addI2CDevice(I2CDevice dev) throws java.lang.IllegalArgumentException
dev
- Instance of an i2c device implemenation.
java.lang.IllegalArgumentException
- if the i2c slave address was already assigned.public void removeI2CDevice(I2CDevice dev)
dev
- Instance of an i2c device implemenation.public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public int[] getDisableReport()
SpecialModeFunction
getDisableReport
in interface SpecialModeFunction
public int[] getEnableReport()
SpecialModeFunction
getEnableReport
in interface SpecialModeFunction
public int[] getIowSpecialBits(int deviceIdentifier)
SpecialModeFunction
getIowSpecialBits
in interface SpecialModeFunction
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.
public int[] getReportIds()
SpecialModeFunction
getReportIds
in interface SpecialModeFunction
public int getSpecialModeFuncionId()
SpecialModeFunction
getSpecialModeFuncionId
in interface SpecialModeFunction
public boolean matchReportId(int reportId)
SpecialModeFunction
matchReportId
in interface SpecialModeFunction
reportId
- Report id of the received report.
public void reportReceived(int[] readBuffer)
SpecialModeFunction
reportReceived
in interface SpecialModeFunction
readBuffer
- Read buffer from a received report.public void setIowDevice(AbstractIowDevice iow)
SpecialModeFunction
setIowDevice
in interface SpecialModeFunction
iow
- Instance of an iow device.public java.lang.String checkCompatibility(int id, int rev, int specialModes)
SpecialModeFunction
checkCompatibility
in interface SpecialModeFunction
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.
public java.lang.String getName()
SpecialModeFunction
getName
in interface SpecialModeFunction
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |