Hi Nick, On Tue, 15 Jul 2008 07:29:56 +0000 (GMT), Nick Teen wrote: > > You probably want to use i2c_smbus_write_i2c_block_data instead. With > > i2c_smbus_write_block_data, the first data byte isn't real data, > > instead in indicates how many bytes follow until the end of the block. > > It should result in "5D W 11 33 44" in your case though, not sure why > > you get "5D W 11 03 33" instead. > > i'm aware of the length field and i2c_smbus_write_i2c_block_data doesn't > work, too. Now i get: 5D W 11 44 > > unsigned char values[3]; > int reg = 0x11; > values[0] = 0x33; > values[1] = 0x44; > i2c_smbus_write_i2c_block_data(fd, reg, 2, values); > > If i change the third parameter (length) to 1 I get the 0x33.
Ah, you're in user-space, using i2c-dev? You should have told us so. > I've no idea! :-( I don't remember any similar problem, so no idea either. I can only suspect that your bus driver is doing something wrong. So please give us the detail of your setup: * Which version of i2c-dev.h are you using? * What architecture are you working on? * Which kernel version are you using? * What i2c bus driver are you using? * How do you know for sure what actually goes on the bus? -- Jean Delvare _______________________________________________ i2c mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/i2c
