Hi all!!
I was wondering if anyone succeed on using this compass/tilt sensor
(http://article.gmane.org/gmane.linux.drivers.i2c/3933/match=hmc6343), without
the I2C kernel module?
To summarize the challenge here, this device reply to a byte command with 6
bytes before its stop, and it also need a custom delay (1ms) between the read
and write commands.
Using:
adresse=0x32;
command1=0x50; //0x50:Headings, 0x55:Tilt, 0x45:Magneto
union i2c_smbus_data sixbuff;
if (ioctl(file, I2C_SLAVE, adresse >> 1) >= 0) {
i2c_smbus_access(file, I2C_SMBUS_WRITE, command1, I2C_SMBUS_BYTE, NULL);
usleep(1000);
i2c_smbus_access(file, I2C_SMBUS_READ, 0, I2C_SMBUS_BYTE, &sixbuff);
}
My first 2 values are corrects (Heading) but the 2 others don't vary.... never
(for 0x45 and 0x55 commands also).
Anyone used the i2c-dev.h userspace functions with this device?
Thanks!
Dave.
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html