Class Tmp117
A Texas Instruments TMP117 high-accuracy thermometer. Every call goes straight to the pamoja C ABI, which decodes exactly what the manufacturer's datasheet specifies.
public static class Tmp117
- Inheritance
-
Tmp117
- Inherited Members
Methods
AveragingConversions(byte)
Returns how many conversions a TMP117 averaging code folds into one result.
public static byte AveragingConversions(byte code)
Parameters
codebyteThe code.
Returns
- byte
The value the C ABI computes.
AveragingMicros(byte)
Returns how long a TMP117 averaging code takes to convert.
public static uint AveragingMicros(byte code)
Parameters
codebyteThe code.
Returns
- uint
The value the C ABI computes.
Celsius(short)
Converts a raw TMP117 temperature register to degrees Celsius.
public static float Celsius(short raw)
Parameters
rawshortThe raw.
Returns
- float
The value the C ABI computes.
ConfigBits(PamojaTmp117Config)
Assembles the 16-bit TMP117 configuration register value.
public static ushort ConfigBits(PamojaTmp117Config config)
Parameters
configPamojaTmp117ConfigThe config.
Returns
- ushort
The value the C ABI computes.
ConfigFromBits(ushort)
Parses a 16-bit TMP117 configuration register value.
public static PamojaTmp117Config ConfigFromBits(ushort bits)
Parameters
bitsushortThe bits.
Returns
- PamojaTmp117Config
The decoded value.
Exceptions
- PamojaException
The device data is not valid.
CycleMicros(byte, byte)
Returns how often a TMP117 updates its result for a cycle and averaging code.
public static uint CycleMicros(byte cycle, byte averaging)
Parameters
Returns
- uint
The value the C ABI computes.
CycleNominalMicros(byte)
Returns the nominal cycle a TMP117 conversion-cycle code selects.
public static uint CycleNominalMicros(byte code)
Parameters
codebyteThe code.
Returns
- uint
The value the C ABI computes.
DataReady(ushort)
Reports whether a TMP117 configuration register says a result is ready.
public static bool DataReady(ushort config)
Parameters
configushortThe config.
Returns
- bool
The value the C ABI computes.
DeviceId(ushort)
Reads the device identifier out of a TMP117 device-ID register.
public static ushort DeviceId(ushort raw)
Parameters
rawushortThe raw.
Returns
- ushort
The value the C ABI computes.
EepromBusy(ushort)
Reports whether a TMP117 configuration register says an EEPROM write is running.
public static bool EepromBusy(ushort config)
Parameters
configushortThe config.
Returns
- bool
The value the C ABI computes.
EepromUnlockBusy(ushort)
Reports whether a TMP117 EEPROM unlock register says a write is running.
public static bool EepromUnlockBusy(ushort unlock)
Parameters
unlockushortThe unlock.
Returns
- bool
The value the C ABI computes.
HighAlert(ushort)
Reports whether a TMP117 configuration register flags a high alert.
public static bool HighAlert(ushort config)
Parameters
configushortThe config.
Returns
- bool
The value the C ABI computes.
LowAlert(ushort)
Reports whether a TMP117 configuration register flags a low alert.
public static bool LowAlert(ushort config)
Parameters
configushortThe config.
Returns
- bool
The value the C ABI computes.
MicroCelsius(short)
Converts a raw TMP117 temperature register to micro-degrees Celsius.
public static int MicroCelsius(short raw)
Parameters
rawshortThe raw.
Returns
- int
The value the C ABI computes.
NanoCelsius(short)
Converts a raw TMP117 temperature register to nano-degrees Celsius.
public static long NanoCelsius(short raw)
Parameters
rawshortThe raw.
Returns
- long
The value the C ABI computes.
RawFromCelsius(float)
Builds the TMP117 temperature register that decodes to a temperature in Celsius.
public static short RawFromCelsius(float celsius)
Parameters
celsiusfloatThe celsius.
Returns
- short
The value the C ABI computes.
RawFromMicroCelsius(int)
Builds the TMP117 temperature register that decodes to a temperature.
public static short RawFromMicroCelsius(int microCelsius)
Parameters
microCelsiusintThe micro celsius.
Returns
- short
The value the C ABI computes.
Revision(ushort)
Reads the die revision out of a TMP117 device-ID register.
public static byte Revision(ushort raw)
Parameters
rawushortThe raw.
Returns
- byte
The value the C ABI computes.
TemperatureBytes(short)
Builds the two bytes a TMP117 sends for a temperature register.
public static byte[] TemperatureBytes(short raw)
Parameters
rawshortThe raw.
Returns
- byte[]
The decoded value.
Exceptions
- PamojaException
The device data is not valid.
TemperatureFromBytes(ReadOnlySpan<byte>)
Reads the two bytes a TMP117 sends for a temperature register.
public static short TemperatureFromBytes(ReadOnlySpan<byte> bytes)
Parameters
bytesReadOnlySpan<byte>The bytes.
Returns
- short
The decoded value.
Exceptions
- PamojaException
The device data is not valid.