|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface I2CPort
Abstraction for a port that supports I2C sensors.
Field Summary | |
---|---|
static int |
ALWAYS_ACTIVE
|
static int |
LEGO_MODE
|
static int |
NO_RELEASE
|
static int |
STANDARD_MODE
|
Method Summary | |
---|---|
int |
i2cBusy()
Check to see if the device is busy |
int |
i2cComplete(byte[] buffer,
int numBytes)
Complete the i2c transaction, and read any returned data. |
void |
i2cDisable()
Disable the device. |
void |
i2cEnable(int mode)
Enable the low level device |
int |
i2cStart(int address,
int internalAddress,
int numInternalBytes,
byte[] buffer,
int numBytes,
int transferType)
Start an i2c transaction. |
Methods inherited from interface lejos.nxt.BasicSensorPort |
---|
getMode, getType, setMode, setType, setTypeAndMode |
Field Detail |
---|
static final int STANDARD_MODE
static final int LEGO_MODE
static final int ALWAYS_ACTIVE
static final int NO_RELEASE
Method Detail |
---|
void i2cEnable(int mode)
mode
- One or more of the mode bits above.void i2cDisable()
int i2cBusy()
int i2cStart(int address, int internalAddress, int numInternalBytes, byte[] buffer, int numBytes, int transferType)
address
- The i2C address (note this is a 7 bit address)internalAddress
- The internal register addressnumInternalBytes
- The number of bytes in the internal addressbuffer
- The data to write to the device (null for reads)numBytes
- The number of bytes to transfertransferType
- 0 == read 1 == write
int i2cComplete(byte[] buffer, int numBytes)
buffer
- The buffer for a read (null for write)numBytes
- Number of bytes to transfer
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |