| 
 | |||||||||
| 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 | STANDARD_MODE | 
| Fields inherited from interface lejos.nxt.SensorConstants | 
|---|
| MODE_ANGLESTEP, MODE_BOOLEAN, MODE_CELSIUS, MODE_FARENHEIT, MODE_PCTFULLSCALE, MODE_PERIODCOUNTER, MODE_RAW, MODE_TRANSITIONCNT, TYPE_ANGLE, TYPE_CUSTOM, TYPE_LIGHT_ACTIVE, TYPE_LIGHT_INACTIVE, TYPE_LOWSPEED, TYPE_LOWSPEED_9V, TYPE_NO_SENSOR, TYPE_REFLECTION, TYPE_SOUND_DB, TYPE_SOUND_DBA, TYPE_SWITCH, TYPE_TEMPERATURE | 
| 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
| 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 | ||||||||