Properties in this class will only be available if a device has a local I2C bus and this is configured for access from an application. Right now this is only the case for mvBlueFOX-MLC devices.
import java.nio.ByteBuffer;
{
{
final int BUF_SIZE = 2;
byte[] data_bytes = new byte[BUF_SIZE];
data_bytes[0] = 'A';
data_bytes[1] = 'B';
ByteBuffer data = ByteBuffer.allocateDirect( BUF_SIZE );
data.put( data_bytes );
}
{
final int BUF_SIZE = 9;
byte[] data_bytes = new byte[BUF_SIZE];
data_bytes[0] = 'D';
data_bytes[0] = 'E';
data_bytes[0] = 'A';
data_bytes[0] = 'D';
data_bytes[0] = ' ';
data_bytes[0] = 'B';
data_bytes[0] = 'E';
data_bytes[0] = 'E';
data_bytes[0] = 'F';
ByteBuffer data = ByteBuffer.allocateDirect( BUF_SIZE );
data.put( data_bytes );
}
if( I2COperationExecuteResult != TDMR_ERROR.DMR_NO_ERROR )
{
System.out.println( String.format( "'I2COperationExecute' write failed. Return value: %s(%d).", ImpactAcquireException.getErrorCodeAsString( I2COperationExecuteResult ), I2COperationExecuteResult ) );
}
final int bytesToRead = 4;
if( I2COperationExecuteResult != TDMR_ERROR.DMR_NO_ERROR )
{
System.out.println( String.format( "'I2COperationExecute' read failed. Return value: %s(%d).", ImpactAcquireException.getErrorCodeAsString( I2COperationExecuteResult ), I2COperationExecuteResult ) );
}
{
System.out.println( String.format(
"'I2CBuffer' reports %d bytes of data while %d bytes where expected.", i2cc.
getI2CBuffer().
binaryDataBufferSize(), bytesToRead ) );
}
final String i2cReadBuffer = i2cc.
I2CRead( 0xA4, 0x00, 8, 4 );
}
else
{
System.out.println( "I2CControl not available." );
}
boolean isValid()
Checks if the internal component referenced by this object is still valid.
Definition Component.java:418
Properties for accessing features belonging to the I2C control(Device specific interface layout only)...
Definition I2CControl.java:255
void I2CWrite(int deviceAddress, int deviceSubAddress, int deviceSubAddressWidth, String data)
Write data to a I2C device.
Definition I2CControl.java:400
PropertyI getI2CBufferLength()
An integer property controlling the length of the mapping between the I2C device and the mvIMPACT....
Definition I2CControl.java:369
String I2CRead(int deviceAddress, int deviceSubAddress, int deviceSubAddressWidth, int byteCnt)
Read data from an I2C device.
Definition I2CControl.java:385
Method getI2COperationExecute()
Calling this function will execute the operation selected by mvIMPACT.acquire.I2CControl....
Definition I2CControl.java:314
PropertyI getI2CDeviceSubAddressWidth()
An enumerated integer property storing the sub-address width(in bits) of the I2C device to communicat...
Definition I2CControl.java:345
PropertyI getI2COperationStatus()
Represents the I2C operation execution status.
Definition I2CControl.java:323
PropertyI getI2CDeviceSubAddress()
An integer property storing the sub-address of the I2C device to communicate with.
Definition I2CControl.java:354
PropertyI getI2CDeviceAddress()
An integer property storing the address of the I2C device to communicate with.
Definition I2CControl.java:329
PropertyS getI2CBuffer()
Defines the intermediate access buffer that allows the exchange of data between the I2C device and th...
Definition I2CControl.java:363
PropertyI getI2COperationMode()
An enumerated integer property to select the I2C operation.
Definition I2CControl.java:308
int call(StringVector params)
Calls an underlying driver function.
Definition Method.java:129
PropertyI write(int value, int index)
Writes one value to the property.
Definition PropertyI.java:350
int read(int index)
Reads a value from a property.
Definition PropertyI.java:198
void writeBinary(java.nio.ByteBuffer pBuf, int index)
Writes a block of binary data to one entry of the property.
Definition PropertyS.java:401
long binaryDataBufferSize(int index)
Returns the size(in bytes) needed for the binary representation of the string buffer.
Definition PropertyS.java:88
String readS(int index, String format)
Reads data from this property as a string.
Definition Property.java:293
Valid I2C operation modes.
Definition TI2COperationMode.java:15
static final int I2ComWrite
Selects I2C write access.
Definition TI2COperationMode.java:19
static final int I2ComRead
Selects I2C read access.
Definition TI2COperationMode.java:17