Table of Contents

Class Tmp117

Namespace
Pamoja.Sensors
Assembly
Pamoja.Sensors.dll

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

code byte

The 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

code byte

The 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

raw short

The 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

config PamojaTmp117Config

The 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

bits ushort

The 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

cycle byte

The cycle.

averaging byte

The averaging.

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

code byte

The 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

config ushort

The 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

raw ushort

The 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

config ushort

The 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

unlock ushort

The 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

config ushort

The 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

config ushort

The 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

raw short

The 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

raw short

The 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

celsius float

The 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

microCelsius int

The 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

raw ushort

The 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

raw short

The 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

bytes ReadOnlySpan<byte>

The bytes.

Returns

short

The decoded value.

Exceptions

PamojaException

The device data is not valid.