Re: I2C block reads with i2c-viapro: testers wanted

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Krzysztof,

> So, with one transaction, can I write an arbitrary number of bytes to
> the device, and then, in the same transaction, can I read one (or no,
> or with some controllers, more than one) byte(s) back?

In I2C mode, you can even alternate as many read and write sequences you
want in a single transaction. The target chip would of course need to
know how to interpret such a transaction though. I've never seen this
possibility used so far.

In SMBus mode, you are limited by the transaction types that have been
defined, but a number of them are composed of a write transaction and a
read transaction (separated by what is known as a "repeated start").
Read Byte, Read Word, Read Block and Read I2C Block are such
transactions. See the SMBus specification for the details.

> Interesting. Still, that limits it to 8-bit-addressable EEPROMs.

Depends on the SMBus. A SMBus controller could implement 16-bit address
I2C block transfers. I don't think I saw one do so far, but it's still
possible in theory.

Also note that this can easily be emulated using a Write Byte command
(which writes 2 bytes on the bus) to set the 16-bit addressed EEPROM
offset, then using continuous Receive Byte commands to get the data.
This is of course slower than a block read though.

> Are such things documented somewhere on the net (some datasheet
> maybe)?

The I2C specifications are available from Philips. The SMBus
specifications are available from smbus.org. Intel also has good
datasheets for all ICH chips.

http://www.semiconductors.philips.com/markets/mms/protocols/i2c/
http://www.smbus.org/specs/

More generally, see the lm_sensors project's links page:
http://www2.lm-sensors.nu/~lm78/cvs/lm_sensors2/doc/useful_addresses.html
and also:
http://secure.netroedge.com/~lm78/docs.html

Hope that helps,
-- 
Jean Delvare




[Index of Archives]     [Linux Kernel]     [Linux Hardware Monitoring]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux