1.18 Use Cases
147
}
printf( "’I2COperationStatus’ after write: %s.\n", i2cc.I2COperationStatus.readS().c_str() );
// Read some data. Similar condition as for write apply
const int bytesToRead = 4;
i2cc.I2CDeviceAddress.write( 0xA8 );
i2cc.I2CDeviceSubAddress.write( 0x00 );
i2cc.I2CDeviceSubAddressWidth.write( 8 );
i2cc.I2CBufferLength.write( bytesToRead ); // read ’bytesToRead’ bytes
i2cc.I2COperationMode.write( I2ComRead );
i2cc.I2COperationExecute.call();
I2COperationExecuteResult = i2cc.I2COperationExecute.call();
if( I2COperationExecuteResult != DMR_NO_ERROR )
{
printf( "’I2COperationExecute’ read failed. Return value: %s(%d).\n", ImpactAcquireException::getErrorCodeAsString( I2COperationExecuteResult ).c_str(), I2COperationExecuteResult );
}
printf( "’I2COperationStatus’ after read: %s.\n", i2cc.I2COperationStatus.readS().c_str() );
if( i2cc.I2CBuffer.binaryDataBufferSize() != bytesToRead )
{
printf( "’I2CBuffer’ reports %d bytes of data while %d bytes where expected.\n", i2cc.I2CBuffer.binaryDataBufferSize(), bytesToRead );
}
// usage of the convenience functions
i2cc.I2CWrite( 0xA4, 0x00, 8, string("TEST") );
const string i2cReadBuffer = i2cc.I2CRead( 0xA4, 0x00, 8, 4 );
}
else
{
printf( "I2CControl not available.\n" );
}
MATRIX VISION GmbH
Содержание MATRIX VISION mvBlueFOX Series
Страница 1: ...mvBlueFOX Technical Manual English Version 3 02...
Страница 2: ......
Страница 8: ......
Страница 19: ...1 6 Important Information 11 MATRIX VISION GmbH...
Страница 20: ...12 MATRIX VISION GmbH...
Страница 21: ...1 6 Important Information 13 1 6 3 Legal notice 1 6 3 1 For customers in the U S A Class B MATRIX VISION GmbH...
Страница 238: ...230 MATRIX VISION GmbH...