Re: IEEE-754 Float to int

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

 



Hi,

My hardware gives me the board temperature as a float 32bits.
So, at some point my hardware gives me a 32bit IEEE-754 float, like this :

regmap_read(device->regmap, ADDR0, &temp);
value = temp << 16;
regmap_read(device->regmap, ADDR1, &temp);
value |= temp;

So, value has a 32bit float now, and I would like to print over hwmon
sysfs API. Like :

temp
Current temperature as reported by thermal zone (sensor).
Unit: millidegree Celsius
RO, Required


Read 26.92387 --> Read 26923 at /sys/class/hwmon/hwmon0/temp0_input
Simple, no float operations.

How I can do it ?

Thanks!

--
Lucas Tanure
--
To unsubscribe from this list: send the line "unsubscribe linux-hwmon" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [LM Sensors]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux