Ta ta - die Lösung: Darwin sources
Habe folgenden wurm gefunden
---
ioreg -n IOHWSensor | awk '/location/ || /current-value/ || /"type"/' | sed -e 's/[^"]*"//' -e 's/" =//' -e 's/location//' -e 's/type//' -e 's/"//g' | awk '{ d=($2/65536); if ($1=="current-value") print substr(d,1,7) "\t" ; if ($1!="current-value") print $0 }' | sed -e 's/temperature/Celsius/' -e 's/voltage/volts/' -e 's/fanspeed/fan RPM/' -e 's/current/Amps/' -e 's/^temp$//' -e 's/ //' | awk '{ if ((NR % 3) == 0) print $0; else printf $0 " " }'
---
und der im Vergleich zu Temperaturemonitor gibt (außer für die CPU T-Diode) eigentlich die gleichen Celisius werte raus. Und wie war das noch mit division gleich bitshift ? 65536= 0x10000, dass würde also sagen, dass die unteren 16 Bit ausgeblendet werden. Ahh, ok es wird getrennt: die oberen 16 bit vor dem komma und die unteren als Nachstellen
okay im Darwin Source für einen der Sensoren habe ich folgendes noch gefunden:
IOReturn IOI2CLM7x::getTemperature(SInt32 *temperature)
{
IOReturn status;
UInt8 bytes[2];
SInt16 reading;
status = readI2C((UInt8 )kTemperatureReg, bytes, 2);
if(status != kIOReturnSuccess)
{
ERRLOG("IOI2CLM7x::getTemperature(0x%x) readI2C failed.\n", getI2CAddress());
return status;
}
reading = *((SInt16 *) bytes);
// Temperature data is represented by a 9-bit, twoÕs complement word with
// an LSB equal to 0.5C (least significant 7 bits are undefined).
// Extra casting is required to make sure we sign-extend the temperature, to
// handle negative temperatures.
*temperature = ( ( ( SInt16 ) ( reading & 0xFF80 ) ) << 8 );
return kIOReturnSuccess;
}
Für den Maxim6690 gilt :
else // format the 16.16 fixed point temperature and return it
*temp = ( ( ( ( SInt8 ) integer ) << 16 ) | ( ( fraction & 0xE0 ) << 8 );