i2c_smbus_write_block_data: send 2 bytes (command+size) before data

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

 



Hello,

From an Intel's ATOM I want to send an I2C message from SMBus controller to
a TI's microcontroller configured as an I2C slave.

I used the following code:

handle = fopen ("/dev/i2c-14",O_RDWR); //open SMBUs controller

ioctl (handle, I2C_SLAVE, 0x43);  //set I2C slave destination address

i2c_smbus_write_block_data (handle, 0x00, 16, buffer); //send 16 bytes
message, command = 0x00

The message I want to send is: 0xAD, 0x2D, 0xFE, 0xCA, ..... 0x00  (16
bytes)

I'm using I2C sniffer to see what I sent and what I see is:

0x00, 0x10, 0xAD, 0x2D, 0xFE, 0xCA, .....

It seems the register (command) and length are also sent.

The MCU expect pure data without the 2 bytes: 0x00, 0x10

The above code runs under vanilla linux 3.2.48

Can you help ?

Thanks,
Z.V
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux