i2c read block

354 views
Skip to first unread message

Francis

unread,
Feb 3, 2017, 6:24:02 AM2/3/17
to BeagleBoard
Hi,

I am trying to create an application on top/based on the i2c tools.
Everything was working well, except the i2c_smbus_block_process_call(), which returns an error when called.

Below is the output of i2cdetect -F:

Functionalities implemented by /dev/i2c-2:
I2C                              yes
SMBus Quick Command              no
SMBus Send Byte                  yes
SMBus Receive Byte               yes
SMBus Write Byte                 yes
SMBus Read Byte                  yes
SMBus Write Word                 yes
SMBus Read Word                  yes
SMBus Process Call               yes
SMBus Block Write                yes
SMBus Block Read                 no
SMBus Block Process Call         no
SMBus PEC                        yes
I2C Block Write                  yes
I2C Block Read                   yes

-----

Based from it, I could tell that SMBus Process Call is not supported.
could anyone suggests an alternative or give directions on how to make a process call?

Thanks in advance!

Francis

Graham

unread,
Feb 3, 2017, 11:12:30 AM2/3/17
to BeagleBoard
Francis:

Referring to:

SMBus Process Call:
===================

This command selects a device register (through the Comm byte), sends
16 bits of data to it, and reads 16 bits of data in return.

So, write 16 bits to a specific register, followed by a 16 bit read.

It seems you could synthesize this by using a "SMBus Write Word" followed by a "SMBus Read Word"

Or synthesize it out of single byte primitives, or ... .

You just need to make sure that if you stack up multiple commands to do the same thing, that in a multi-threaded environment, that the OS does not let other threads share/grab the device in between your commands.

--- Graham

==

William Hermans

unread,
Feb 3, 2017, 11:37:37 AM2/3/17
to beagl...@googlegroups.com
Well the reason why the functionality you mention is not supported should be obvious from your output above. Block read isn't supported either. Honestly though, I'm not even sure how the block process call functionality is even useful. What's the point of writing up to 31 bytes into ONE register, and reading it back again ?

As far as answering your question goes. Technically you can not duplicate this functionality. Realistically, you could attempt to use the standard I2C block read listed above, or just use i2c_smbus_read_byte_data(), and loop over the whole register set ? Again, I honestly do not get the point of such a "feature".
Reply all
Reply to author
Forward
0 new messages