Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   C/C++ (http://www.chiefdelphi.com/forums/forumdisplay.php?f=183)
-   -   I2C - Current Address Read (http://www.chiefdelphi.com/forums/showthread.php?t=81887)

oddjob 02-04-2010 03:39 PM

I2C - Current Address Read
 
The I2C library Read() code is

Code:

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 02-05-2010 01:20 AM

Re: I2C - Current Address Read
 
Quote:

Originally Posted by oddjob (Post 913409)
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 02-05-2010 06:06 AM

Re: I2C - Current Address Read
 
As usual, you are one step ahead. Thanks.

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

jhersh 02-05-2010 11:47 AM

Re: I2C - Current Address Read
 
Quote:

Originally Posted by oddjob (Post 913812)
EDIT - any idea if/when the new sources will be posted at firstforge?

They have been since yesterday... in SVN anyway.

oddjob 02-05-2010 11:57 AM

Re: I2C - Current Address Read
 
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 02-05-2010 11:58 AM

Re: I2C - Current Address Read
 
Quote:

Originally Posted by oddjob (Post 913944)
I was looking at the snapshot area, and the new source zip file didn't make it to there yet.

snapshot

There now.

jhersh 02-05-2010 12:01 PM

Re: I2C - Current Address Read
 
Whoops... just put up the team update... not the source... just a few more minutes.

jhersh 02-05-2010 02:31 PM

Re: I2C - Current Address Read
 
Sorry for the confusion... the source is now posted as a snapshot.


All times are GMT -5. The time now is 10:39 AM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi