From: Michael R. <re...@eu...> - 2005-06-01 11:59:23
|
Hi Luis, > For my embedded board, i'm also thinking to add temperature reading, as > the sensor is also present in the other I2C bus. And no, i will not use > lm_sensors for that. The device is not supported and the whole > lm_sensors is kinda bloated for what I need. To give you an idea, > reading the temperature is a 6 liner . > --------------------- > i2c_device = open("/dev/i2c-1",O_RDWR); > ioctl(i2c_device,I2C_SLAVE, (0x90>>1) ); > temp = i2c_smbus_read_word_data(i2c_device, 0); > temp = ((((temp && 0x00FF)<< 9) + (temp >> 8)) >> 3) / 2; > printf("temperature: %i \n",temp); > close(i2c_device); > --------------------- Looks like a candiate for a plugin (but independent from the driver). Maybe a as-generic-as-possible one, so you can read from any i2c device... bye, Michael -- Michael Reinelt <re...@eu...> http://home.pages.at/reinelt GPG-Key 0xDF13BA50 ICQ #288386781 |