I2C - Current Address Read

The I2C library Read() code is


Synchronized sync(m_semaphore);
m_module->m_fpgaDIO->writeI2CConfig_Address(m_deviceAddress, &status);
m_module->m_fpgaDIO->writeI2CConfig_BytesToWrite(sizeof(registerAddress), &status);
m_module->m_fpgaDIO->writeI2CConfig_BytesToRead(count, &status);
m_module->m_fpgaDIO->writeI2CDataToSend(registerAddress, &status);
UINT8 transaction = m_module->m_fpgaDIO->readI2CStatus_Transaction(&status);
m_module->m_fpgaDIO->strobeI2CStart(&status);
while(transaction == m_module->m_fpgaDIO->readI2CStatus_Transaction(&status)) taskDelay(1);
while(!m_module->m_fpgaDIO->readI2CStatus_Done(&status)) taskDelay(1);
data = m_module->m_fpgaDIO->readI2CDataReceived(&status);

I’m not sure, but that appears to be a I2C Random Address Read protocol.

Does anyone have I2C code for Current Address Read?

Start -> Address|1 -> Ack -> Data -> No Ack -> Stop

The current implementation will read “count” bytes without reinitializing.

So you want to read without sending the register address? If that is what you mean, you should be able to simply use the new “Transaction” entry-point in the I2C class and pass 0 for the sendSize. This was added in the update that came out today.

-Joe

As usual, you are one step ahead. Thanks.

EDIT - any idea if/when the new sources will be posted at firstforge?

They have been since yesterday… in SVN anyway.

I was looking at the snapshot area, and the new source zip file didn’t make it to there yet.

snapshot

EDIT - there is a new release there, but it looks like it is the update patch, not the source zip file.

There now.

Whoops… just put up the team update… not the source… just a few more minutes.

Sorry for the confusion… the source is now posted as a snapshot.