|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--cork.device.AbstractDevice | +--cork.net.i2c.AbstractI2CDevice | +--cork.module.ti.PCF8574
Driver for controlling a Texas Instruments PCF8574 Remote 8-Bit I/O Expander chip.
The IO port can be controlled as an array of 8 boolean values, or as a byte value where the binary representation of a number between 0 and 255 sets the bits of the port. e.g. setting the byte to 0 (binary=00000000) will set all 8 physical buts to logic low, and setting the byte to 255 (binary=11111111) will set all 8 bits on teh physical device to logic high.
Field Summary | |
static int |
ADDRESS_56
Description of the Field |
static int |
ADDRESS_57
Description of the Field |
static int |
ADDRESS_58
Description of the Field |
static int |
ADDRESS_59
Description of the Field |
static int |
ADDRESS_60
Description of the Field |
static int |
ADDRESS_61
Description of the Field |
static int |
ADDRESS_62
Description of the Field |
static int |
ADDRESS_63
Description of the Field |
Constructor Summary | |
PCF8574(int address)
Constructor for the PCF8574 object. |
Method Summary | |
void |
getBits(boolean[] buffer)
Gets the bits of the PCF8574 object. |
int |
getByte()
Gets the bits of the PCF8574 object. |
java.lang.String |
getDeviceDestription()
Gets the deviceDestription attribute of the CMPS03 object |
java.lang.String |
getDeviceName()
Gets the deviceName attribute of the CMPS03 object |
I2CDevice |
getI2CDevice()
Gets this instance. |
void |
setBits(boolean[] bits)
Sets the bits of the PCF8574 object. |
void |
setByte(int bits)
Sets the bits of the PCF8574 object. |
Methods inherited from class cork.net.i2c.AbstractI2CDevice |
capture, destroy, getBusMaster, getDeviceAddress, isCaptured, read, release, start, stop, tick, write |
Methods inherited from class cork.device.AbstractDevice |
addEventListener, removeEventListener, sendDeviceEvent |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int ADDRESS_56
public static final int ADDRESS_57
public static final int ADDRESS_58
public static final int ADDRESS_59
public static final int ADDRESS_60
public static final int ADDRESS_61
public static final int ADDRESS_62
public static final int ADDRESS_63
Constructor Detail |
public PCF8574(int address)
address
- The address that the physical device has been pinstrapped
to. The default if no pins are strapped is ADDRESS_56.Method Detail |
public void getBits(boolean[] buffer) throws I2CException
buffer
- The buffer to put the bits into. The buffer should
have a length of at least 8.I2CException
- if the bits can not be returned for some reason.public int getByte() throws I2CException
I2CException
- Description of Exceptionpublic java.lang.String getDeviceName()
public java.lang.String getDeviceDestription()
public I2CDevice getI2CDevice()
getI2CDevice
in class AbstractI2CDevice
public void setByte(int bits) throws I2CException
bits
- int all 8 bits as a byte.I2CException
- if the bits can not be set for some reason.public final void setBits(boolean[] bits) throws I2CException
bits
- a boolean array with a length of at least 8.I2CException
- if the bits can not be set for some reason.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |