The latest SMBus spec V3.0 20th Dec 2014 shows only one type of block write/read (excluding block process call):
6.5.7 Block Write/Read
Write: Address(Wr), Command, Count = N, Byte 1, Byte 2, ..., Byte N [, PEC]
Read: Address(Wr), Command, Address(Rd), Count = N, Byte 1, Byte 2, ..., Byte N [, PEC]
However, looking at the Linux user-space interface, there are 3 block transaction types to use with ioctl I2C_SMBUS
from uapi/linux/i2c.h:
#define I2C_SMBUS_BLOCK_DATA 5
#define I2C_SMBUS_I2C_BLOCK_BROKEN 6
#define I2C_SMBUS_I2C_BLOCK_DATA 8
Following the code under drivers/i2c/* it delegates to smbus_xfer
/master_xfer
(if emulated) in i2c_algorithm
, which is specific to an adapter/device.
1. Do all these transaction types end up following the block wire spec for SMBus 3.0?
2. And how would I decide which one I need to use?
I am creating a Java JNA interface on Raspbian GNU/Linux 10 (buster)