oddjob
February 4, 2010, 3:39pm
#1
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
jhersh
February 5, 2010, 1:20am
#2
oddjob:
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
oddjob
February 5, 2010, 6:06am
#3
As usual, you are one step ahead. Thanks.
EDIT - any idea if/when the new sources will be posted at firstforge ?
jhersh
February 5, 2010, 11:47am
#4
They have been since yesterday… in SVN anyway.
oddjob
February 5, 2010, 11:57am
#5
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.
jhersh
February 5, 2010, 12:01pm
#7
Whoops… just put up the team update… not the source… just a few more minutes.
jhersh
February 5, 2010, 2:31pm
#8
Sorry for the confusion… the source is now posted as a snapshot.