This is library release 1.0.3, in file LibMPSSE_1.0.3.zip found at https://ftdichip.com/software-examples/mpsse-projects/libmpsse-i2c-examples/
1. See http://www.ftdicommunity.com/index.php?topic=644.0 - post made August 16, 2022, 10:48:47 AM
I2C_Read8bitsAndGiveAck(...) function, in $\LibMPSSE_1.0.3\source\ftdi_i2c.c, around line 941 - change:
Code: [Select]
buffer[noOfBytes++] = DIRECTION_SCLOUT_SDAOUT; // was DIRECTION_SCLOUT_SDAIN; make SDA output to provide read ACK
2. Related to #1:
I2C_FastRead(...) function, in $\LibMPSSE_1.0.3\source\ftdi_i2c.c, around line 1314 - change:
Code: [Select]
outBuffer[i++] = DIRECTION_SCLOUT_SDAOUT; // was DIRECTION_SCLOUT_SDAIN; make SDA output to provide read ACK
3. I2C_FastRead(...) returns number of bits read always, not bytes
I2C_FastRead(...) function, in $\LibMPSSE_1.0.3\source\ftdi_i2c.c, around line 1324:
In the released code, it has the statement:
Code: [Select]
*sizeTransferred = j;
where 'j' is the number of bits to be read. However, this only is correct for option flag I2C_TRANSFER_OPTIONS_FAST_TRANSFER_BITS if the actual bits read match the requested bits to read (this statement may be premature - may be better to wait for actual read), as I read the manual and the code comments.(A) Put this statement behind something like:
Code: [Select]
if (options & I2C_TRANSFER_OPTIONS_FAST_TRANSFER_BITS)
(B) Below this code, towards the bottom of the function, there is released code:
Code: [Select]
if (options & I2C_TRANSFER_OPTIONS_FAST_TRANSFER_BYTES)
status = FT_Channel_Read(I2C, handle, bytesToTransfer, buffer, &bytesRead);
Replace this with something like:
Code: [Select]
if (options & I2C_TRANSFER_OPTIONS_FAST_TRANSFER_BYTES)
{
status = FT_Channel_Read(I2C, handle, bytesToTransfer, buffer, &bytesRead);
*sizeTransferred = bytesRead;
}